Browse Source

Add agignore to speed up searching

Thomas Dy 9 years ago
parent
commit
d29caa719e
3 changed files with 64 additions and 1 deletions
  1. 53 0
      .agignore
  2. 4 0
      .vim/ag-unite
  3. 7 1
      .vimrc

+ 53 - 0
.agignore

@@ -0,0 +1,53 @@
+.git
+
+# browsers
+/.config/chromium
+/.config/google-chrome
+/.mozilla
+
+# plugins
+/.emacs.d
+/.vim/plugged
+/.vim/undo
+/.zgen
+
+# personal stuff
+/.root/etc
+/.root/opt
+/.root/home
+/.dotfiles
+
+# xdg things
+/.cache
+/.local
+
+# games
+/.wine
+/.steam
+/.PlayOnLinux
+
+# chat
+/.purple
+/.thumbnails
+/.Skype
+
+# package managers
+/.cargo
+/.multirust
+/.npm
+/.node-gyp
+/.ivy2
+/.m2
+/.lein
+/.sbt
+/.gradle
+/.cordova
+/.plugman
+/.gem
+/.vagrant.d
+
+# irrelevant folders
+/Documents/Anki
+/Downloads
+/Expansion
+/Workspace

+ 4 - 0
.vim/ag-unite

@@ -0,0 +1,4 @@
+#!/bin/sh
+cd $1
+touch /tmp/a
+ag --hidden --nocolor --nogroup -g ''

+ 7 - 1
.vimrc

@@ -15,7 +15,13 @@ call plug#end()
 let g:signify_vcs_list = [ 'git' ]
 
 call unite#filters#matcher_default#use(['matcher_fuzzy'])
-let g:unite_source_rec_async_command = ['ag', '--follow', '--nocolor', '--nogroup', '-g', '']
+
+" use ag if present
+if executable('ag')
+  " we run a wrapper around ag so it respects agignore
+  let g:unite_source_rec_async_command = ['sh', expand('~/.vim/ag-unite')]
+endif
+
 autocmd FileType unite call s:unite_settings()
 function! s:unite_settings()
   " Enable navigation with control-j and control-k in insert mode