Skip to content

Instantly share code, notes, and snippets.

@mllg
Created November 10, 2014 21:42
Show Gist options
  • Save mllg/eb716e394f0a0ffc6f7e to your computer and use it in GitHub Desktop.
Save mllg/eb716e394f0a0ffc6f7e to your computer and use it in GitHub Desktop.
function! GitFZF()
let l:git_root = system('git rev-parse --show-toplevel 2> /dev/null')
if empty(l:git_root)
execute 'FZF'
else
echom l:git_root
call fzf#run({
\ 'source' : 'git ls-tree -r --full-tree --name-only HEAD',
\ 'sink' : 'e',
\ 'dir' : substitute(l:git_root, "\n$", '', ''),
\ 'tmux_height': g:fzf_tmux_height
\ })
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment