Skip to content

Instantly share code, notes, and snippets.

@hyuki0000
Created March 21, 2017 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hyuki0000/c2eec9f51b4870acad9b2a26b8831cc6 to your computer and use it in GitHub Desktop.
Save hyuki0000/c2eec9f51b4870acad9b2a26b8831cc6 to your computer and use it in GitHub Desktop.
LaTeXGrep - 前もって定めておいたディレクトリ内をvimgrepするコマンド
" vimgrep given pattern in predefined directories.
function LaTeXGrep(pattern)
execute 'vimgrep' a:pattern '$DOCGIRL/note/doc*/*.tex' '$DOCGIRL/doc*/*.tex'
copen
endfunction
command -nargs=1 LaTeXGrep call LaTeXGrep(<f-args>)
@hyuki0000
Copy link
Author

hyuki0000 commented Mar 21, 2017

環境変数$DOCGIRLは、~/.bash_profileなどで、

export DOCGIRL="/Users/YOURNAME/Documents/doc/girl/"

のように指定しておく。もっと再帰的に降りていきたいときには、ディレクトリを、

'$DOCGIRL/doc*/**/*.tex'

のように**で表記するとよい。詳しくは、:help starstar-wildcard 参照。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment