set nocompatible " Show absolute line number for cursor, and relative for everything else set number relativenumber " Split in the right directions set splitbelow splitright " incsearch: search for string as you're typing it " ignorecase + smartcase: do a case-insensitive search by default, but switch " to case-sensitive if the search string contains capital letters " nohlsearch: don't highlight search results set incsearch ignorecase smartcase nohlsearch " noexpandtab: insert tabs, not spaces " tabstop=4: display tabs as 4 spaces set noexpandtab tabstop=4 " Automatically keep the indentation of the previous line set autoindent " Create both swap & undo files set swapfile undofile " Update screen more often set updatetime=250 " Center cursor in buffer set scrolloff=999 " Enable syntax highlighting where possible syntax enable " Set space as map key let mapleader = ' ' " Use jk as escape inoremap inoremap jk " Some useful shortcuts nnoremap w :w nnoremap q :q " Switch between splits nnoremap h :wincmd h nnoremap j :wincmd j nnoremap k :wincmd k nnoremap l :wincmd l " Create new splits nnoremap fh :vsp:wincmd h nnoremap fj :sp nnoremap fk :sp:wincmd k nnoremap fl :vsp " Resize splits using arrow keys 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 other modes inoremap inoremap inoremap inoremap vnoremap vnoremap vnoremap vnoremap " Manage tabs nnoremap ee :$tabnew nnoremap eL :tabnew nnoremap eH :-tabnew nnoremap ed :tabclose nnoremap el :tabnext nnoremap eh :tabprevious " Easier 'go back' binding nnoremap a nnoremap gb