From 4eca702e945843081d3fa65cb58fa5143029f24b Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Thu, 16 Aug 2018 00:19:38 +0800 Subject: [PATCH] Add Rag command for fzf --- vimrc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vimrc b/vimrc index cc62b8e..20a1411 100644 --- a/vimrc +++ b/vimrc @@ -269,7 +269,12 @@ let g:ctrlp_match_func = { 'match': 'cpsm#CtrlPMatch' } " --color: Search color options command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(), 1, 0) +function! s:with_git_root() + let root = systemlist('git rev-parse --show-toplevel')[0] + return v:shell_error ? {} : {'dir': root} +endfunction +command! -bang -nargs=* Rag call fzf#vim#ag_raw(, s:with_git_root()) " ==== conque ==== " command aliases