diff options
author | aktersnurra <gustaf.rydholm@gmail.com> | 2021-02-07 20:35:46 +0100 |
---|---|---|
committer | aktersnurra <gustaf.rydholm@gmail.com> | 2021-02-07 20:35:46 +0100 |
commit | a29fa44b3a0bd6f726ab2e8169dec35b697b04a0 (patch) | |
tree | 49e40e6e6b5b0378ea47638f77039bb4ae4c42b5 /.config/nvim/keys | |
parent | 251cde74e3bdfe70776aac644ee8858515fbc55c (diff) |
neovim config added
Diffstat (limited to '.config/nvim/keys')
-rw-r--r-- | .config/nvim/keys/mappings.vim | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/.config/nvim/keys/mappings.vim b/.config/nvim/keys/mappings.vim new file mode 100644 index 0000000..7ab490e --- /dev/null +++ b/.config/nvim/keys/mappings.vim @@ -0,0 +1,44 @@ +" 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>" + +" 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 + +nnoremap <Leader>o o<Esc>^Da +nnoremap <Leader>O O<Esc>^Da |