Last active
November 25, 2016 12:31
-
-
Save drasill/adb258e1363a22e6e433 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
function! s:escape(path) | |
return substitute(a:path, ' ', '\\ ', 'g') | |
endfunction | |
function! GitGrepHandler(line) | |
let parts = split(a:line, ':') | |
let [fn, lno] = parts[0 : 1] | |
execute 'e '. s:escape(fn) | |
execute lno | |
normal! zz | |
endfunction | |
command! -nargs=+ Fgg call fzf#run({ | |
\ 'source': 'git grep -n -I --untracked -i "<args>"', | |
\ 'sink': function('GitGrepHandler'), | |
\ 'options': '+m', | |
\ 'tmux_height': '60%' | |
\ }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use it with vim-plug :