Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Most of my changes of indentation require zero keystrokes. My editor knows that if the previous line ends with a {, the next line should have an extra level of indent. And if I start a line with }, the indentation should be lowered by one level.

If I want to shift a line, it requires two keystrokes: >> or <<. Three keystrokes to do two lines: 2>> or 2<<. Two keystrokes to do the rest of the paragraph, the rest of the screen, or the rest of the file: <}, <L or <G. Three for the next five paragraphs: <5}.

Note that's quite independent of whether I use tabs or spaces for indentation. I've set up my editor to not insert tabs when hitting the tab key (but if I really want to, I can do ^V^I (two keystrokes)) - it will use spaces. But I seldomly have the need to use the tab key (well, unless in "command mode", then it cycles between visible buffers).

Note that removing 4 internal spaces doesn't require 4 keystrokes: 4x or 4X will do. For multiple lines of code that need 4 spaces to be removed, I navigate to a corner of the rectangle, mark its place: ma, move to its opposite corner, and delete the block: d\a.


In reply to Re: No Hard Tabs in Code by JavaFan
in thread No Hard Tabs in Code by Xiong

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (1)
As of 2021-10-20 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (81 votes). Check out past polls.

    Notices?