diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-07-04 14:00:41 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-07-04 14:00:41 +0800 |
commit | 7031bb7e1ac3c26c3e2837b10805c34d399de1fd (patch) | |
tree | 7185f80c19f3636e041697ed5138aa49f86c932d /vim/init/keymaps.vim | |
parent | a31d8dbea212442e2ed132516e42b72258b2ccd7 (diff) |
Update
Diffstat (limited to 'vim/init/keymaps.vim')
-rw-r--r-- | vim/init/keymaps.vim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vim/init/keymaps.vim b/vim/init/keymaps.vim index 26a3787..048b737 100644 --- a/vim/init/keymaps.vim +++ b/vim/init/keymaps.vim | |||
@@ -83,10 +83,13 @@ vnoremap <leader>, :terminal<CR> | |||
83 | " Toggle paste mode on and off | 83 | " Toggle paste mode on and off |
84 | map <leader>pp :setlocal paste!<CR> | 84 | map <leader>pp :setlocal paste!<CR> |
85 | 85 | ||
86 | " Switch CDW to root git directory | ||
87 | nnoremap cdg :execute 'cd' fnameescape(fnamemodify(finddir('.git', escape(expand('%:p:h'), ' ') . ';'), ':h'))<CR>:pwd<CR> | ||
88 | " Switch CWD to the directory of the open buffer | 86 | " Switch CWD to the directory of the open buffer |
89 | nnoremap cd :cd %:p:h<CR>:pwd<CR> | 87 | nnoremap cd :cd %:p:h<CR>:pwd<CR> |
88 | " Switch CDW to root git directory | ||
89 | nnoremap cdg :execute 'cd' fnameescape(fnamemodify(finddir('.git', escape(expand('%:p:h'), ' ') . ';'), ':h'))<CR>:pwd<CR> | ||
90 | " alias for cd | ||
91 | nnoremap cd.. :cd .. <CR>:pwd<CR> | ||
92 | nnoremap cd... :cd ../.. <CR>:pwd<CR> | ||
90 | 93 | ||
91 | " Move one line up and down | 94 | " Move one line up and down |
92 | nnoremap <C-j> ddp | 95 | nnoremap <C-j> ddp |