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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.