.vimrc

.vimrc

SO having worked in a lot of different editors, gui or otherwise, I've compiled a small vimrc that I find pretty useful. Some of the notable features include:

  • leader, n, = Make new pane in desired direction
  • leader, m, = Move current pane to (or flip it with another pane) in the desired direction
  • leader, = Set focus to pane in direction
  • leader, b, = Switch current panes active file to next buffer

There are other notable features, but the configuration is documented well.

"----------------------------------------
" Start general configurations
"----------------------------------------
set nocompatible " don't lose new vim features due to compatibility  
set ts=2 sw=2 et " 2 space tabs (tabstop=2, shiftwidth=2, expandtab=true)  
set autoindent "Always autoindent  
set hlsearch " highlight search terms  
set incsearch " show search while typing it  
set smartcase " ignore case if search is lc, sensitive otherwise  
set showmatch " set show matching parenthesis  
set mouse=a " Allow mouse scrolling (peer programming)  
set backspace=indent,eol,start " Allow backspace to work normally  
set number " Turn on line numbers  
set laststatus=2 " Always show statusline  
set list "Show invisible characters, next line specifies characters  
set listchars=eol:¬,nbsp:¤,space:·,trail:•,tab:››,extends:…,precedes:…,conceal:‡  
set rtp+=~/.vim/bundle/Vundle.vim " set runtime path to use vundle for plugins

"----------------------------------------
" Start Vundle and loading plugins
"----------------------------------------
call vundle#begin()  
Plugin 'gmarik/Vundle.vim'  
Plugin 'digitaltoad/vim-jade'  
Plugin 'wavded/vim-stylus'  
Plugin 'stulzer/heroku-colorscheme'  
Plugin 'Yggdroot/indentLine'  
Plugin 'othree/yajs.vim'  
Plugin 'airblade/vim-gitgutter'  
Plugin 'scrooloose/nerdtree'  
Plugin 'Xuyuanp/nerdtree-git-plugin'  
Plugin 'bling/vim-airline'  
Plugin 'blueyed/vim-diminactive'  
call vundle#end()

filetype plugin indent on " Plugins default to indent

"---------------------------------------
" Reconfigure Plugin Options
"---------------------------------------
let g:indentLine_char="│" " Change indentation looks  
let g:airline#extensions#tabline#enabled=1 " turn on buffer 'tabs'  
let g:airline#extensions#tabline#fnamemod=':t' " change 'tab' names to just filename  
let g:airline_powerline_fonts=1 " Ensure to use pretty powerline fonts  
hi ColorColumn ctermfg=8 ctermbg=0  
set hidden " Helpful when using visible buffers

"---------------------------------------
" Keyboard mappings
"---------------------------------------
let mapleader=","  
nmap \ :NERDTreeToggle<CR>  
nmap <leader>T :enew<CR>  
nmap <leader>b<right> :bnext<CR>  
nmap <leader>b<left> :bprevious<CR>  
nmap <leader>bq :bp <BAR> bd #<CR>  
nmap <leader>bl :ls<CR>  
nmap <leader>n<down> :rightbelow sb #<CR>  
nmap <leader>n<up> :leftabove sb #<CR>  
nmap <leader>n<left> :vert leftabove sb #<CR>  
nmap <leader>n<right> :vert rightbelow sb #<CR>  
nnoremap <leader><down> <C-w><down>  
nnoremap <leader><right> <C-w><right>  
nnoremap <leader><left> <C-w><left>  
nnoremap <leader><up> <C-w><up>  
nnoremap <leader>m<up> <C-w>K  
nnoremap <leader>m<down> <C-w>K<C-w>r  
nnoremap <leader>m<left> <C-w>H  
nnoremap <leader>m<right> <C-w>H<C-w>r  
nnoremap j gj  
nnoremap k gk

"---------------------------------------
" Highlight invisibiles (xterm256 required)
"---------------------------------------
syntax on "Make sure syntax highlighting is on  
highlight NonText ctermfg=239  
highlight SpecialKey ctermfg=239  

About Nathaniel Inman

I'm a gamer, graphic designer, musician and software engineer. C++ and Javascript are my favorite two programming languages for which I develop exclusively in vim, tmux and zsh on Arch Linux.

Kansas City, Missouri http://www.theoestudio.com