Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

djberg96
  (email not shown publicly)

Journal of djberg96 (2603)

Thursday August 22, 2002
08:07 AM

advanced gvim

[ #7240 ]
In the last week, I've learned a few more gvim commands to make me more productive. There are so many damned commands, I wonder if anyone actually knows all of them.

Anyway, the new ones I learned were the ">" and "<" keys to indent or unindent a block of highlighted code. I also learned that you can do code folding and unfolding with zf and zo, respectively. Not the prettiest, but cool.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I kind of like Vim's indenting, although I also find it useful to use perltidy as a pipe, to really clean things up properly.

    Useful commands:

    • =} - Indent to next blank line.
    • =aB - Indent this "block".
    • ^T - (insert mode) Move to next indent.
    • ^D - (insert mode) Move to previous indent.
    • !}perltidy -q - Filter paragraph through perltidy.
    • !aBperltidy -q - Filter block through perltidy.

    Actually, the commands beginning with '=' there are only in Vim 6.1 and higher. I have this in my ~/.vimrc to enabl

    • Also, for those using vim, not gvim, shift-V starts a line block, and ctrl-V does a column block. I use it constantly.

      I also like to justify my (non-code) text fairly often, so I do plenty of :!fmt on those blocks.

      --

      --
      xoa

      • I tend to use gqap rather than fmt these days. fmt is a little inflexible...

        Of course, if I were a real fanatic, I'd be using DCONWAY's Text::AutoFormat [cpan.org].

        -Dom

        • I tend to use gqap rather than fmt these days. fmt is a little inflexible...

          I didn't know about :gqap. Thanks for the pointer.

          Of course, if I were a real fanatic, I'd be using DCONWAY's Text::AutoFormat.

          Don't think I didn't consider it... :-)

          --

          --
          xoa