Takazudo
5/8/2011 - 4:57 PM

ggisty.vim

" Ggisty
" just grep the gist directory.
" needs gisty to use this. see the pages below.
" http://d.hatena.ne.jp/swdyh/20081207/1228655198
" TODO: needs to handle 'No match' error
"
" write the code to .vimrc to define gists root dir
" 
"let g:ggistyRootPath = '~/dev/gists'
"
command! -nargs=+ Ggisty call s:ggisty(<q-args>)
function! s:ggisty(args)
	silent execute 'vimgrep /' . a:args . '/j ' . g:ggistyRootPath . '/** | cw'
	if len(getqflist()) != 0
		copen
	else
		exit
	endif
endfunction