Ⅰ. 插件描述
Vim plugin for using ack-grep with iterm for fast and easy search in projectⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/cab-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/cab-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/cab-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/cab.vim
Ⅳ. 文档说明
ONLY FOR MAC (for the present)
Cab is a Vim plugin for using ack-grep (http://betterthangrep.com) in
common with iterm (http://www.iterm2.com/) for fast and easy search in
a project from vim.
It uses current working directory as a root.
It's possible to use Cab only with iterm (not with terminal) bacause cab
uses applescript API for interaction with iterm (or iterm2).
How to use Cab:
in the main mode:
place the cursor on the word to search and press <Leader>f
it will open new tab of the iterm and run the command "ack -Q <word for search>"
in the visual mode:
select a range of text to search and press <Leader>f
it will open new tab of the iterm and run the command "ack -Q <text for search>"
in the command mode:
type :Cab <text for search>
it will open new tab of the iterm and run the coommand "ack -Q <text for search>"
Cab automatically escape special symbols and quotes. You can search for
any text. For exaple
:Cab Search for this "quoted" 'text' and / slashes
You can redefine a method of invoking ack using global variable cab_ack_cmd
Example (write it in the your ~/.vimrc file):
let g:cab_ack_cmd = "ack-grep -irn --ignore-dir=assets"
For installation use vimball:
vim cab.vmb
:so %