"--------------- Standard settings ------------------ set nocompatible " No compatibility with legacy Vi set tabstop=2 " a tab is two spaces set smarttab " Tab should always be smart set softtabstop=2 " when hitting , pretend like a tab is removed, even if spaces set expandtab " expand tabs by default (overloadable per file type later) set shiftwidth=2 " number of spaces to use for autoindenting set shiftround " use multiple of shiftwidth when indenting with '<' and '>' set autoindent " always set autoindenting on set copyindent " copy the previous indentation on autoindenting set backspace=indent,eol,start " allow backspacing over everything in insert mode set tags=tags " for ctags - require more setup set ignorecase " ignore case when searching set smartcase " ignore case if search pattern is all lowercase, set autowrite " Save on buffer switch - Automatically save before :next, :make etc. set autoread " Automatically reread changed files without asking me anything set backspace=indent,eol,start " Enable backspace set noswapfile " Don't use swapfile set encoding=utf-8 " Set default encoding set undofile " Save undo's after file closes set undodir=$HOME/.vim/undo " where to save undo histories set undolevels=1000 " How many undos set undoreload=10000 " number of lines to save for undo "--------------- UI Settings ------------------ color solarized set t_Co=256 " Set terminal colour to 256 set showcmd " show command in bottom bar set cursorcolumn " Highlight the current column set colorcolumn=80 " Highlight 80th column set showmatch " Show matching bracket set number " always show line numbers set visualbell " don't beep set noerrorbells " fucking don't beep set so=7 " Set 7 lines to the cursor - when moving vertically using j/k set incsearch " Shows the match while typing set hlsearch " Highlight found searches set lazyredraw " Don't redraw while executing macros (good performance config) set wrap " Wrap lines set gfn=Monaco:h14 " for MacVim highlight Search cterm=underline "--------------- Let mappings ------------------ let mapleader = ',' " Better leader key "-------------------- Mappings ------------ nmap ev :tabedit ~/.vimrc.local " Quickly edit vimrc file nmap w :w! " Quickly write current file imap jj " ESC is far far away jj is much better nmap pn op " Paste on new Line from the cursor nmap bd :bd " Close buffer nmap q :q " Quit without bang nmap ba :1,1000 bd! " Close all the buffers "-------------------- Plugin Related Mappings ------------ nmap :NERDTreeToggle " Toggle NERDTreeToggle quickly "----------------Vim Super Enhancements------------------ later 9999999d " Remember history for 9999999 days. Great for redo, undo etc. "--------------------Auto-Commands -------------- augroup autosourcing autocmd! autocmd BufWritePost .vimrc source % " Auto source .vimrc on changes autocmd BufLeave,FocusLost * silent! wall " Auto save on buffer leave & focus lost augroup END "-------------------- sublime like settings ------------ " it wont hurt to mimic sublime for now. " Adding comment on the same line inserts the comment. Investigate. imap o " open sidebar with cmd+k map :nerdtreetabstoggle map :ctrlp imap o imap :call feedkeys( line('.')==1 ? '' : 'ddkP' ) imap ddp " switch between tabs with cmd+1, cmd+2,..." map 1gt map 2gt map 3gt map 4gt map 5gt map 6gt map 7gt map 8gt map 9gt " insert mode imap 1gt imap 2gt imap 3gt imap 4gt imap 5gt imap 6gt imap 7gt imap 8gt imap 9gt " Notes and Tips " zz to center current line. " ,,w to invoke easymotion