diff options
Diffstat (limited to 'keys/mappings.vim')
-rw-r--r-- | keys/mappings.vim | 79 |
1 files changed, 41 insertions, 38 deletions
diff --git a/keys/mappings.vim b/keys/mappings.vim index 57a763f1..b1740c0d 100644 --- a/keys/mappings.vim +++ b/keys/mappings.vim @@ -1,42 +1,45 @@ -" Better nav for omnicomplete -inoremap <expr> <c-j> ("\<C-n>") -inoremap <expr> <c-k> ("\<C-p>") - -" Use alt + hjkl to resize windows -nnoremap <M-j> :resize -2<CR> -nnoremap <M-k> :resize +2<CR> -nnoremap <M-h> :vertical resize -2<CR> -nnoremap <M-l> :vertical resize +2<CR> - -" I hate escape more than anything else -inoremap jk <Esc> -inoremap kj <Esc> - -" Easy CAPS -inoremap <c-u> <ESC>viwUi -nnoremap <c-u> viwU<Esc> - -" TAB in general mode will move to text buffer -nnoremap <TAB> :bnext<CR> -" SHIFT-TAB will go back -nnoremap <S-TAB> :bprevious<CR> - -" Alternate way to save -nnoremap <C-s> :w<CR> -" Alternate way to quit -nnoremap <C-Q> :wq!<CR> -" Use control-c instead of escape -nnoremap <C-c> <Esc> -" <TAB>: completion. -inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>" + +if !exists('g:vscode') + " Better nav for omnicomplete + inoremap <expr> <c-j> ("\<C-n>") + inoremap <expr> <c-k> ("\<C-p>") + + " I hate escape more than anything else + inoremap jk <Esc> + inoremap kj <Esc> + + " Easy CAPS + " inoremap <c-u> <ESC>viwUi + " nnoremap <c-u> viwU<Esc> + + " TAB in general mode will move to text buffer + nnoremap <TAB> :bnext<CR> + " SHIFT-TAB will go back + nnoremap <S-TAB> :bprevious<CR> + + " Alternate way to save + nnoremap <C-s> :w<CR> + " Alternate way to quit + nnoremap <C-Q> :wq!<CR> + " Use control-c instead of escape + nnoremap <C-c> <Esc> + " <TAB>: completion. + inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>" + + + " Better window navigation + nnoremap <C-h> <C-w>h + nnoremap <C-j> <C-w>j + nnoremap <C-k> <C-w>k + nnoremap <C-l> <C-w>l + + " Use alt + hjkl to resize windows + nnoremap <M-j> :resize -2<CR> + nnoremap <M-k> :resize +2<CR> + nnoremap <M-h> :vertical resize -2<CR> + nnoremap <M-l> :vertical resize +2<CR> +endif " Better tabbing vnoremap < <gv vnoremap > >gv - -" Better window navigation -nnoremap <C-h> <C-w>h -nnoremap <C-j> <C-w>j -nnoremap <C-k> <C-w>k -nnoremap <C-l> <C-w>l - |