1. aghttps://github.com/ggreer/the_silver_searcher)比grep、ack更快的递归搜索文件内容(速度对比:`ag`>`ack`>`grep`)

    # centos 6+(epel)
    yum install the_silver_searcher
  2. 安装到 vim

    • 安装

      cd /usr/share/vim/vim74/plugin
      #cd ~/.vim/plugin
      git clone https://github.com/rking/ag.vim ag
    • 全局配置 vim /etc/vimrc

      " 自动缩进
      set autoindent
      
      " ag 插件(请注意:默认为全局搜索,因此必须指明文件路径,不过支持正则表达式)
      set runtimepath^=/usr/share/vim/vim74/plugin/ag.vim
      let g:ag_prg="/usr/bin/ag --vimgrep"
      let g:ag_working_path_mode="r"