aboutsummaryrefslogtreecommitdiffhomepage
path: root/vim/init/keymaps.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/init/keymaps.vim')
-rw-r--r--vim/init/keymaps.vim12
1 files changed, 6 insertions, 6 deletions
diff --git a/vim/init/keymaps.vim b/vim/init/keymaps.vim
index 211a0d1..14d813b 100644
--- a/vim/init/keymaps.vim
+++ b/vim/init/keymaps.vim
@@ -78,7 +78,7 @@ vnoremap <leader>, :terminal<CR>
78map <leader>pp :setlocal paste!<cr> 78map <leader>pp :setlocal paste!<cr>
79 79
80" Switch CDW to root git directory 80" Switch CDW to root git directory
81nnoremap <Leader>cdg :execute 'cd' fnameescape(fnamemodify(finddir('.git', escape(expand('%:p:h'), ' ') . ';'), ':h'))<CR>:pwd<CR> 81nnoremap <Leader>cg :execute 'cd' fnameescape(fnamemodify(finddir('.git', escape(expand('%:p:h'), ' ') . ';'), ':h'))<CR>:pwd<CR>
82" Switch CWD to the directory of the open buffer 82" Switch CWD to the directory of the open buffer
83map <leader>cd :cd %:p:h<cr>:pwd<cr> 83map <leader>cd :cd %:p:h<cr>:pwd<cr>
84 84
@@ -450,17 +450,17 @@ endfunc
450" 下面进行 grep,这样能方便的对相关项目进行搜索 450" 下面进行 grep,这样能方便的对相关项目进行搜索
451"---------------------------------------------------------------------- 451"----------------------------------------------------------------------
452if executable('rg') 452if executable('rg')
453 noremap <silent><F2> :AsyncRun! -cwd=<root> rg -n --no-heading 453 noremap <silent><F2> :AsyncRun! -cwd=<root> rg -n --no-heading
454 \ --color never -g *.h -g *.c* -g *.py -g *.js -g *.vim 454 \ --color never -g *.h -g *.c* -g *.py -g *.js -g *.vim
455 \ <C-R><C-W> "<root>" <cr> 455 \ <C-R><C-W> "<root>" <cr>
456elseif has('win32') || has('win64') 456elseif has('win32') || has('win64')
457 noremap <silent><F2> :AsyncRun! -cwd=<root> findstr /n /s /C:"<C-R><C-W>" 457 noremap <silent><F2> :AsyncRun! -cwd=<root> findstr /n /s /C:"<C-R><C-W>"
458 \ "\%CD\%\*.h" "\%CD\%\*.c*" "\%CD\%\*.py" "\%CD\%\*.js" 458 \ "\%CD\%\*.h" "\%CD\%\*.c*" "\%CD\%\*.py" "\%CD\%\*.js"
459 \ "\%CD\%\*.vim" 459 \ "\%CD\%\*.vim"
460 \ <cr> 460 \ <cr>
461else 461else
462 noremap <silent><F2> :AsyncRun! -cwd=<root> grep -n -s -R <C-R><C-W> 462 noremap <silent><F2> :AsyncRun! -cwd=<root> grep -n -s -R <C-R><C-W>
463 \ --include='*.h' --include='*.c*' --include='*.py' 463 \ --include='*.h' --include='*.c*' --include='*.py'
464 \ --include='*.js' --include='*.vim' 464 \ --include='*.js' --include='*.vim'
465 \ '<root>' <cr> 465 \ '<root>' <cr>
466endif 466endif