Created
January 14, 2009 06:41
-
-
Save soh335/46822 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"{{{ | |
"Buffer全部から検索して結果をQuickFixに出力する | |
"http://ogijun.g.hatena.ne.jp/secondlife/20080310/1205128105 | |
function Moregrep(word) | |
if exists("s:hasqf") | |
silent ccl | |
endif | |
cexpr '' " clear quickfix | |
let current = bufnr('%') | |
silent exec ':bufdo | try | vimgrepadd ' . '/' . a:word .'/j/' . ' % | catch | endtry' | |
silent exec ':b '. current | |
if !empty(getqflist()) | |
silent cw | |
let s:hasqf = 1 | |
else | |
echohl ErrorMsg | |
echomsg "no pattern" a:word | |
echohl None | |
return | |
endif | |
endfunction | |
command! -nargs=1 Moregrep :call Moregrep(<f-args>) | |
nmap <space>go :execute '.cc'<CR> | |
"}}} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment