3
votes
Accepted
Put many Perl-Filters into ~/.vim
You could use !.
Mark the lines you want to filter. Then hit !. The cursor will jump to the command line prefilled with
:'<,'>!
Then just type the filter you want to use. E.g.
:'<,'>!~/...
3
votes
Accepted
VIM Macro to delete all Perl POD?
Just use an ex command with searches for ranges:
:/^=[^\s]/,/^=cut/ delete
Repeat with @:. Or, for the whole file,
:g/^=[^\s]/,/^=cut/ delete
You can make it a hotkey with dp
:nnoremap <leader&...
2
votes
VIM Macro to delete all Perl POD?
You can do the following mappings:
" *D*elete *P*od
nnoremap <leader>dp gg/^=[^\s]<cr>V/^=cut<cr>d
" *F*old *P*od
nnoremap <leader>fp /^=[^\s]<cr>V/^=cut<cr>jzf
...
1
vote
Define a fold that can not be searched, and that isn't affected by other fold commands?
You can probably use foldexpr to do this.
Here is a gist written by a person on the Internet. It defines a foldexpr function for folding the POD format.
I tried it on a random Perl script I found on ...
Only top scored, non community-wiki answers of a minimum length are eligible