" Change the global leader to the space bar let mapleader = ' ' " Easily switch between buffers nnoremap gn :bn nnoremap gp :bp nnoremap gd :bd " ================== Top row "nnoremap nnoremap q :Files nnoremap w :Commits nnoremap e :set nu! nnoremap r :call matchadd('OverLength', '\%101v', 100) nnoremap t :OverCommandLine%s/ "nnoremap y nnoremap u w nnoremap i nnoremap o nnoremap p " Easily show all git diffs nnoremap [ :GFiles? " Easily show all git files nnoremap ] :GFiles " Easily go through all the commits for a specific file nnoremap \ :BCommits " ================== Middle row nnoremap a :NERDTreeToggle "nnoremap s nnoremap d :TagbarToggle nnoremap f :VimFiler nnoremap g :set hlsearch! nnoremap h :Buffers " Easily jump between lines in all open files nnoremap j :Lines " Easily jump between lines in the same file nnoremap k :BLines " Easily search for any line in all files in the project nnoremap l :Ag " Easily open new files in horizontal and vertical splits nnoremap ; :split w :Files nnoremap ' :vsplit w :Files " ================== Bottom row " Note that I personally don't use + z/x/c/n/m/,/. nnoremap v :Ack! "\b\b" "nnoremap b nnoremap n o nnoremap m O " Bind the right beautify function based on what file is open autocmd FileType javascript map b :call JsBeautify() autocmd FileType json map b :call JsonBeautify() autocmd FileType jsx map b :call JsxBeautify() autocmd FileType html map b :call HtmlBeautify() autocmd FileType css map b :call CSSBeautify() " Easily enter 'zen mode' with Goyo and Pencil " We have to explicitly set vertsplit again since Goyo resets it for some reason nnoremap 2 :PencilSoft:Goyo:hi vertsplit ctermfg=8 ctermbg=none nnoremap 3 :mksession! ~/.vim_session nnoremap 4 :source ~/.vim_session nnoremap 8 :15winc - nnoremap 9 :15winc + nnoremap 0 :winc =