aboutsummaryrefslogtreecommitdiff
path: root/stow/vim/.vim/rc/maps.vim
diff options
context:
space:
mode:
Diffstat (limited to 'stow/vim/.vim/rc/maps.vim')
-rw-r--r--stow/vim/.vim/rc/maps.vim73
1 files changed, 73 insertions, 0 deletions
diff --git a/stow/vim/.vim/rc/maps.vim b/stow/vim/.vim/rc/maps.vim
new file mode 100644
index 0000000..cd83cf2
--- /dev/null
+++ b/stow/vim/.vim/rc/maps.vim
@@ -0,0 +1,73 @@
+""" Maps """
+
+nnoremap Y y$
+nnoremap <leader>x :w<CR>:! ./%
+inoremap <leader>w <Esc>:w<Enter>
+inoremap <leader><leader> <Esc>/<++><Enter>cf>
+
+" Showing tabs and trailing spaces
+nnoremap <leader>l :set list!<CR>
+
+" Clipboard
+nnoremap <leader>p "+p
+nnoremap <leader>y "+yy
+vnoremap <leader>y "+y
+nnoremap <leader>d "+dd
+vnoremap <leader>d "+d
+
+nnoremap <leader>vrc :80vsp ~/.vimrc<CR>
+nnoremap <leader>S :!tmux split-window -l '40\%'<CR><CR>
+
+" Split navigation
+map <C-h> <C-w>h
+map <C-j> <C-w>j
+map <C-k> <C-w>k
+map <C-l> <C-w>l
+map <A-h> <C-w><
+map <A-j> <C-w>+
+map <A-k> <C-w>-
+map <A-l> <C-w>>
+map <A-H> <C-w>10<
+map <A-J> <C-w>5+
+map <A-K> <C-w>5-
+map <A-L> <C-w>10>
+
+" Opening netrw
+nnoremap <leader>f :40Vexplore<CR>
+nnoremap <leader>F :40Lexplore<CR>
+
+" Moving -here-
+nnoremap <leader>h :cd %:h<CR>
+
+" Spelling
+nnoremap <leader>ss :set spell!<CR>
+nnoremap <leader>sl :set spelllang=
+nnoremap <leader>sL :setlocal spelllang=
+
+" Open file under cursor
+nnoremap go :!xdg-open <cfile><CR>
+
+nnoremap <C-n> :tabnew<CR>
+"nnoremap <Tab> gt "Can't be set without also remapping <C-i>
+"nnoremap <S-Tab> gT
+
+" hlnext: Highlighting searches
+nnoremap <silent> n n:call HLNext(0.1)<CR>
+nnoremap <silent> N N:call HLNext(0.1)<CR>
+function! HLNext(blinktime)
+ set invcursorline
+ redraw
+ exec 'sleep'.float2nr(a:blinktime*400).'m'
+ set invcursorline
+ redraw
+endfunction
+
+" dragvisuals: dragging visual blocks
+vmap <expr> <LEFT> DVB_Drag('left')
+vmap <expr> <RIGHT> DVB_Drag('right')
+vmap <expr> <DOWN> DVB_Drag('down')
+vmap <expr> <UP> DVB_Drag('up')
+vmap <expr> D DVB_Duplicate()
+
+" Search text that does not exist
+nnoremap <leader>/ /grtfjx<CR>