diff --git a/.vimrc b/.vimrc index b87a31b..cde5455 100644 --- a/.vimrc +++ b/.vimrc @@ -407,12 +407,16 @@ let g:CommandTMaxDepth = 7 " * FZF let g:rg_command = ' \ rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --color "always" - \ -g "*.{js,json,php,md,styl,jade,html,config,py,cpp,c,go,hs,rb,conf}" \ -g "!{.git,node_modules,vendor}/*" ' +"\ -g "*.{js,json,php,md,styl,jade,html,config,py,cpp,c,go,hs,rb,conf}" + command! -bang -nargs=* RipGrep call fzf#vim#grep(g:rg_command .shellescape(), 1, 0) +command! -bang -nargs=* RipGrepCword call fzf#vim#grep(g:rg_command . "-q " . expand(''), 1, 0) let g:fzf_buffers_jump = 1 +" Empty value to disable preview window altogether +let g:fzf_preview_window = '' " * VimOrganizer " default Tag list. Will be changed in near future so @@ -751,20 +755,29 @@ nnoremap fn :lnext " Prev quickfix. nnoremap fp :lprev "nnoremap aa :Denite -mode=normal -buffer-name=search-buffer grep -nnoremap ac :Denite -resume -mode=normal -buffer-name=search-buffer -nnoremap aw :DeniteCursorWord -mode=normal -buffer-name=search-buffer grep +nnoremap ac :Denite -resume -buffer-name=search-buffer grep +nnoremap aw :DeniteCursorWord -buffer-name=search-buffer grep call denite#custom#map('insert', '', '') -call denite#custom#var('grep', 'command', ['pt']) -call denite#custom#var('grep', 'default_opts', - \ ['--nogroup', '--nocolor', '--smart-case']) -call denite#custom#var('grep', 'recursive_opts', []) -call denite#custom#var('grep', 'pattern_opt', []) -call denite#custom#var('grep', 'separator', ['--']) -call denite#custom#var('grep', 'final_opts', []) -call denite#custom#option('search-buffer', 'highlight_matched_char', 'deniteMatchedChar') +"call denite#custom#var('grep', 'command', ['rg']) +"call denite#custom#var('grep', 'default_opts', + "\ ['--no-heading', '--color', 'never', '--smart-case']) +"call denite#custom#var('grep', 'recursive_opts', []) +"call denite#custom#var('grep', 'pattern_opt', []) +"call denite#custom#var('grep', 'separator', ['--']) +"call denite#custom#var('grep', 'final_opts', []) +"call denite#custom#option('search-buffer', 'highlight_matched_char', 'deniteMatchedChar') +call denite#custom#var('grep', { + \ 'command': ['rg'], + \ 'default_opts': ['-i', '--vimgrep', '--no-heading'], + \ 'recursive_opts': [], + \ 'pattern_opt': ['--regexp'], + \ 'separator': ['--'], + \ 'final_opts': [], + \ }) nnoremap g :Denite -buffer-name=search-buffer grep nnoremap aa :RipGrep! -nnoremap :Files! `git rev-parse --show-toplevel` +"nnoremap :Files! `git rev-parse --show-toplevel` +nnoremap :GFiles nnoremap :Buffers " For C++ -- A is a great plugin which allows you to jump from the c file to the " header and vice-versa. Mneumonic here is headerheader. @@ -798,3 +811,19 @@ if !empty($VIRTUAL_ENV) " let g:python_host_prog = $VIRTUAL_ENV . '/bin/python' " let g:python3_host_prog = $VIRUTAL_ENV . '3/bin/python' endif + +autocmd FileType denite call s:denite_my_settings() +function! s:denite_my_settings() abort + nnoremap + \ denite#do_map('do_action') + "nnoremap d + "\ denite#do_map('do_action', 'delete') + "nnoremap p + "\ denite#do_map('do_action', 'preview') + nnoremap q + \ denite#do_map('quit') + nnoremap i + \ denite#do_map('open_filter_buffer') + nnoremap + \ denite#do_map('toggle_select').'j' +endfunction