paperlined.org
apps > vim
document updated 12 years ago, on Aug 30, 2011
There are some standard snippets that I keep in the registers, so I can quickly run various macros.

Anything that's marked like this means that you should press Ctrl-V before typing that character, as a way to enter it as a literal.

To make these stick, make sure you have ~/.viminfo being saved.

Register P [run current Perl script]

:!PATH=.:$PATH %^M

Register C [do a check-syntax on current Perl script]

:!perl -c % 2>&1 | head -20^M

User-defined Ex commands

Instead of using registers, you can put these in your ~/.vimrc. This uses user-defined Ex commands instead of registers:
"   :CC     do a syntax-check on the current Perl program
"   :PP     run the current Perl program
"   :PPL    run the current Perl program, piped to less
command! PP        !PATH=.:$PATH %
command! PPL       !PATH=.:$PATH % | less
command! CC        !perl -c % 2>&1 | head -20