3

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. :'<,'>!~/filters/fix-umlauts.pl To filter the entire file use :%!~/filters/fix-umlauts.pl To only filter the current line, just hit !! and the command line is ...


3

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>dp :g/^=[^\s]/,/^=cut/ delete<cr>


2

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 To either delete the first POD of the file, or fold the next POD accessible from your cursor (if you are in a POD, only part of it will be folded)


1

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 this site (warning no https). The foldexpr seems to work okay. It might work well enough for your use case that you can tweak it. On the example script I ...


Only top voted, non community-wiki answers of a minimum length are eligible