" zz centers the cursor, so combining this with navigation commands keeps my " cursor centered " nnoremap j jzz " nnoremap k kzz " nnoremap gg ggzz " nnoremap G Gzz " I navigate my splits using hjkl. This setup allows for fast " switching, which is important as I often end up with 3-4 splits after a while nnoremap h :wincmd h nnoremap j :wincmd j nnoremap k :wincmd k nnoremap l :wincmd l " These mappings just exist because I'm lazy, and they only really work in " QWERTY nnoremap w :w nnoremap q :q " As I don't use the arrow keys for navigation, I remapped them to allow for " resizing of my splits. If you hold down shift, you can control the size of " the splits more precisely nnoremap :resize +5 nnoremap :resize -5 nnoremap :vertical resize +5 nnoremap :vertical resize -5 nnoremap :resize +1 nnoremap :resize -1 nnoremap :vertical resize +1 nnoremap :vertical resize -1 " Disable arrow keys in editing & visual mode, as I have no need for them inoremap inoremap inoremap inoremap vnoremap vnoremap vnoremap vnoremap " Tabs bindings " TODO improve on these " Create tab nnoremap o :tabnew " Close current tab nnoremap p :tabclose " Go to next tab nnoremap i :tabnext " Go to previous tab nnoremap u :tabprevious " This function allows me to switch between a dark & light theme. I mainly use " the dark theme, but when I'm sitting outside, the light theme can be much " more readable function! ColorschemeToggle() if g:colors_name == 'flattened_dark' colorscheme flattened_light else colorscheme flattened_dark endif endfunction nnoremap c :call ColorschemeToggle() " As I'm constantly tweaking my config, I use keybindings to easily open & " source it without leaving my session nnoremap vs :source $MYVIMRC " Opens CtrlP in my config directory nnoremap ve :split:exec 'CtrlP ' . fnamemodify($MYVIMRC, ':h') " This was probably one of the best ideas I found (it wasn't my original idea). " By remapping Esc to jk, I could switch between modes without moving my hands. " This improved my speed by much more than I was expecting, and helped with not " straining my hands as much. inoremap jk inoremap " I use this binding to quickly switch between two files. nnoremap a " Terminal keybindings " I use the terminal inside Neovim a lot, so I have some keybindings to easily " open one " Use jk in terminal as well tnoremap jk " I explicitely use $SHELL, because my main shell is not necessarily Bash, and " I want to use my main shell inside Vim as well nnoremap rr :e term://$SHELL nnoremap rh :vsp:wincmd h:e term://$SHELL nnoremap rl :vsp:e term://$SHELL nnoremap rk :sp:wincmd k:e term://$SHELL nnoremap rj :sp:e term://$SHELL