From 77f5dd9693576af7fde80bdc99700f21eff01d6b Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Wed, 9 Feb 2022 17:53:48 +0100 Subject: WIP moving to all lua and new structure --- plugin/keymaps.vim | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 plugin/keymaps.vim (limited to 'plugin/keymaps.vim') diff --git a/plugin/keymaps.vim b/plugin/keymaps.vim new file mode 100644 index 0000000..10f9bdb --- /dev/null +++ b/plugin/keymaps.vim @@ -0,0 +1,71 @@ +scriptencoding utf-8 + +nnoremap * /\<=expand('')\> +nnoremap # ?\<=expand('')\> + +vnoremap p "_dP + +nnoremap Y y$ + +nnoremap n nzzzv +nnoremap N Nzzzv +nnoremap J mzJ`z + +inoremap , ,u +inoremap . .u +inoremap ! !u +inoremap ? ?u +inoremap $ $u +inoremap > >u + +vnoremap < >gv + +nnoremap h :wincmd h +nnoremap j :wincmd j +nnoremap k :wincmd k +nnoremap l :wincmd l +nnoremap q :wincmd q +" Make windows to be basically the same size +nnoremap = = + +nnoremap wv :vsp +nnoremap wh :sp + +nnoremap :cnext +nnoremap :cprev + +nnoremap i :lnext +nnoremap o :lprev + +nnoremap bd :bd + +nnoremap dp ":saveas " . expand('%') + +" For moving quickly up and down, +" Goes to the first line above/below that isn't whitespace +" Thanks to: http://vi.stackexchange.com/a/213 +nnoremap gj :let _=&lazyredraw:set lazyredraw/\%=virtcol(".")v\S:nohl:let &lazyredraw=_ +nnoremap gk :let _=&lazyredraw:set lazyredraw?\%=virtcol(".")v\S:nohl:let &lazyredraw=_ + +" Run the last command +nnoremap c : + + +if has('nvim') + " Make esc leave terminal mode + tnoremap + tnoremap + + " Easy moving between the buffers + tnoremap h + tnoremap j + tnoremap k + tnoremap l + + " Try and make sure to not mangle space items + tnoremap + tnoremap +endif + +nnoremap x :call alpha#save_and_exec() -- cgit v1.2.3