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

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 enable them:

    " Attempt to load indenting rules if possible.
    if v:version >= 601
    filetype indent on
    endif

    This provides about 99% of my needs.

    -Dom

    • 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