Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: No Hard Tabs in Code

by JavaFan (Canon)
on Jul 05, 2010 at 15:36 UTC ( #848078=note: print w/replies, xml ) Need Help??

in reply to No Hard Tabs in Code

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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://848078]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2021-10-23 08:55 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (87 votes). Check out past polls.