[Chicago-talk] Notes on vim+perl(+PuTTY)
arodland at comcast.net
Thu Mar 15 20:58:52 PDT 2007
Not so much a tutorial as "this is what I do", but people might find some or
all of these things useful if editing perl in vim
"" Perl-related things
" Create a command "Tidy" -- accept a range but default to whole file
" Any args given to Tidy will be passed to perltidy after your defaults
command -range=% -nargs=* Tidy <line1>,<line2>!
\perltidy your favorite perltidy options here <args>
" Turn on syntax folding for Perl files
" Fold ifs and loops and such too
" Highlight POD using syntax/pod.vim
" If you have vim before 7.0...
"" Other things
" Enable the mouse when working in xterms or on a console with GPM
" Use 3 columns to show fold markers (clickable, in mouse mode)
" End of vimrc stuff
This last bit, I may be making up, but I'm pretty sure I'm not -- I believe
that the windows PuTTY also supports accessing the windows clipboard through
the xterm clipboard functions, meaning that you should be able to yank into
the register "+ and have that text come out in the windows clipboard on the
local machine, and likewise paste from "+ and it will paste what's in the
clipboard. If that doesn't do it, try "*, and if that doesn't do it, check
for options (sorry, I don't have a windows machine handy to test it with).
If you want to have even a little more fun with perlish things in vim, there's
a script called perl-support.vim available from the vim scripts repository at
< http://www.vim.org/scripts/script.php?script_id=556 > -- it has mappings to
deal with comments, macros for inserting various bits of code for you to fill
in the blanks, quickfix support for perl -c (hit a key to pop up a buffer
with either a "Compiled OK" message or a list of errors from perl -c, and
jump right to the errors), and perldoc access from right within the module.
Some fairly nifty stuff there. More info, screenshots, and installation
instructions at the above-mentioned link.
Anything else anyone wants to know about vim geekery?
More information about the Chicago-talk