filter : apply filters to text, by filetype
script karma |
Rating 7/3,
Downloaded by 885 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Michael Goerz |
|
script type |
utility |
|
description |
You can filter text in vim by executing the following command
:%!filter_executable
With an appropriate collection of filters, this feature can help to format text or source code, pretty print, or do advanced editing.
However, each filter has to be in your $PATH (unless you want to specify the path manually), and you have to remember the name of the program.
Also, if you have many filters, organizing them can be complicated. You may be tempted to give them long names, or you may be feeling that you end up clogging your $PATH with numerous filters that you only use in rare situations.
This plugin helps to solve this problem. You maintain your filter scripts inside of your vim folder, in a folder 'filters' with subfolders per filetype (~/.vim/filters/all for filters that are always available).
You can then apply a filter both with an Ex command (:Filter) and with a shortcut (\f in normal mode, <C-L>f in insert mode, by default). The plugin looks in ~/.vim/filters for filter scripts appropriate to the file type, and allows you to select one, interactively. The given current range is then filtered through the script. |
|
install details |
Put filter.vim inside of your plugins folder
Create the folders ~/.vim/filters, and ~/.vim/filters/all.
Organize any filter scripts that you have by filetype and put them in ~/.vim/filters (e.g. ~/.vim/filters/tex, ~/.vim/filters/mail, ...) |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 3.17.173.228
|