I just learned that I can run perl scripts on my vim text window by using
:%!/path/to/script
Is there a way to set filter1 = /path/to/script so I only need to type :%!filter1?
I just learned that I can run perl scripts on my vim text window
Share
You can use
cabbrevto create a command-line abbreviation like this:If you the type
filter1followed by a space it will expand to to/path/to/script.And you can also put the
%!into the abbreviation if you only use it in this combination.Obviously, if you use this filter a lot it might be easier to create a keybinding for this:
This will map
,fto executing your filter…