diff options
Diffstat (limited to 'vim/init')
-rw-r--r-- | vim/init/basic.vim | 4 | ||||
-rw-r--r-- | vim/init/keymaps.vim | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/vim/init/basic.vim b/vim/init/basic.vim index 945c134..cdb5210 100644 --- a/vim/init/basic.vim +++ b/vim/init/basic.vim | |||
@@ -108,7 +108,7 @@ function! ToggleQuit() | |||
108 | echo message | 108 | echo message |
109 | endfunction | 109 | endfunction |
110 | 110 | ||
111 | nnoremap gl :call ToggleQuit()<CR> | 111 | nnoremap <leader><leader>gl :call ToggleQuit()<CR> |
112 | 112 | ||
113 | " Simply exit when closing the last buffer | 113 | " Simply exit when closing the last buffer |
114 | 114 | ||
@@ -117,7 +117,7 @@ function! Bye() | |||
117 | if g:quitVimWhenPressingCtrlC | 117 | if g:quitVimWhenPressingCtrlC |
118 | :silent! quit | 118 | :silent! quit |
119 | else | 119 | else |
120 | :echo "Press gl to allow quit with <C-c>" | 120 | :echo "Press <leader><leader>gl to allow quit with <C-c>" |
121 | endif | 121 | endif |
122 | else | 122 | else |
123 | :bdelete | 123 | :bdelete |
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 |