Skip to content

Instantly share code, notes, and snippets.

@junegunn
Created February 12, 2016 10: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 junegunn/4b85bdf042634d4f8324 to your computer and use it in GitHub Desktop.
Save junegunn/4b85bdf042634d4f8324 to your computer and use it in GitHub Desktop.
function! s:with_git_root()
let root = systemlist('git rev-parse --show-toplevel')[0]
return v:shell_error ? {} : {'dir': root}
endfunction
command! -nargs=* Rag
\ call fzf#vim#ag(<q-args>, extend(s:with_git_root(), g:fzf#vim#default_layout))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment