filter


Ⅰ. 插件描述

apply filters to text, by filetype

Ⅱ. 基本信息

创建日期:  2009-10-24
使用用户:  1
Github星:  1
插件作者:  Michael Goerz

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/filter'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/filter'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/filter'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/filter

Ⅳ. 文档说明

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.

添加新评论