Skip to content

Instantly share code, notes, and snippets.

@evansb
Last active December 22, 2015 08:49
Show Gist options
  • Save evansb/6447660 to your computer and use it in GitHub Desktop.
Save evansb/6447660 to your computer and use it in GitHub Desktop.
My .vimrc
set nocompatible
filetype off
if has("gui_running")
set guifont=Source\ Code\ Pro\ for\ Powerline:h12
set linespace=3
endif
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'Lokaltog/powerline-fonts'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'MarcWeber/vim-addon-mw-utils'
Bundle 'Raimondi/delimitMate'
Bundle 'bling/vim-airline'
Bundle 'bling/vim-bufferline'
Bundle 'Shutnik/jshint2.vim'
Bundle 'SirVer/ultisnips'
Bundle 'altercation/vim-colors-solarized'
Bundle 'chriskempson/base16-vim'
Bundle 'dag/vim2hs'
Bundle 'eagletmt/ghcmod-vim'
Bundle 'eagletmt/neco-ghc'
Bundle 'edkolev/tmuxline.vim'
Bundle 'gcmt/tube.vim'
Bundle 'hdima/python-syntax'
Bundle 'honza/vim-snippets'
Bundle 'jonathanfilip/vim-lucius'
Bundle 'kchmck/vim-coffee-script'
Bundle 'kien/ctrlp.vim'
Bundle 'majutsushi/tagbar'
Bundle 'plasticboy/vim-markdown'
Bundle 'scrooloose/nerdcommenter'
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/syntastic'
Bundle 'sjl/gundo.vim'
Bundle 'terryma/vim-multiple-cursors'
Bundle 'tomtom/tlib_vim'
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-surround'
Bundle 'tpope/vim-dispatch'
Bundle 'vim-scripts/pep8'
Bundle 'xolox/vim-misc'
Bundle 'xolox/vim-notes'
Bundle 'digitaltoad/vim-jade'
"AutoCompletion Stuff
Bundle 'Shougo/neocomplete.vim'
Bundle 'ervandew/supertab'
Bundle 'osyo-manga/vim-marching'
Bundle 'osyo-manga/reunions'
Bundle 'Shougo/vimproc'
let g:tube_terminal = "iterm"
"Neocomplete & Marching
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#sources#syntax#min_keyword_length = 2
let g:marching_clang_command = "clang"
let g:marching_clang_command_option = "-std=c++11"
let g:marching_enable_neocomplete = 1
let g:SuperTabContextDefaultCompletionType = 'context'
"Syntastic
let g:syntastic_auto_jump = 2
let g:syntastic_auto_loc_list = 0
let g:syntastic_javascript_checkers = ['jshint']
let g:syntastic_python_checkers = ['pyflakes']
let g:syntastic_haskell_checkers = ['hlint']
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = ' -std=c++11 -stdlib=libc++'
let g:syntastic_mode_map = { 'mode': 'active',
\ 'active_filetypes': ['c','cpp', 'python', 'haskell'],
\ 'passive_filetypes': ['puppet'] }
let g:syntastic_always_populate_loc_list=1
let g:syntastic_auto_loc_list=1
let g:syntastic_check_on_open=1
" Easy Motion
let g:EasyMotion_leader_key = '<Leader>'
" Airline
let g:airline_theme = 'zenburn'
let g:airline_detect_modified = 1
let g:airline_detect_paste = 1
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tagbar#enabled = 1
let g:airline#extensions#bufferline#enabled = 1
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#syntastic#enabled = 1
let g:airline#extensions#tmuxline#enabled = 1
let g:airline#extensions#whitespace#enabled = 1
let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing']
let g:bufferline_echo = 0
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'N',
\ 'i' : 'I',
\ 'R' : 'R',
\ 'c' : 'C',
\ 'v' : 'VL',
\ 'V' : 'VB',
\ '' : 'Vsl',
\ 's' : 'LSbs',
\ }
let g:airline_left_sep = ''
let g:airline_right_sep = ''
"TmuxLine
let g:tmuxline_preset = {
\'a' : '#S',
\'b' : '#W',
\'win' : '#I',
\'x' : '',
\'y' : '#(~/itunes.sh)',
\'z' : '#(whoami) @ #h - %a %d %b %R' ,
\'options' : {'status-justify' : 'left'}}
let g:tmuxline_separators = {
\ 'left' : '',
\ 'right' : '',
\ 'space' : ' '}
"ctrlP configuration
let g:ctrlp_map = '<C-p>'
let g:ctrlp_cmd = 'CtrlP ~/Code'
let g:ctlrp_custom_ignore = '\v[\/]\.(git|hg|svn)$'
let g:ctlrp_working_path_mode = 'c'
"Gundo
nnoremap <Leader>g :GundoToggle<CR>
"Indentline
let g:indentLine_char = '┊'
filetype plugin on
filetype indent on
filetype on
"Cursor
set guicursor=n-v-c-i:block-Cursor
set guicursor+=n-v-c-i:blinkon0
" Basic configuration
set t_Co=256
set history=700
set showmode!
set encoding=utf-8
set number
set columns=80
set lines=35
set textwidth=80
set splitright
set guioptions-=r
set guioptions-=L
set shortmess+=I
set noswapfile
set visualbell
set ttyfast
set showcmd
set showmatch
set title
set autoread
set autowrite
set formatoptions-=o
set backspace=indent,eol,start
set whichwrap+=<,>,h,l
set linespace=2
set history=400
set expandtab
set shiftwidth=4
set tabstop=4
set softtabstop=4
set autoindent
set smartindent
set incsearch
set hlsearch
set ignorecase
set smartcase
set wrap
set linebreak
set wildmenu
set nofoldenable
nnoremap J mzJ`z
nnoremap j gj
nnoremap k gk
nnoremap <space> /
nnoremap <c-space> ?
nnoremap ; :
syntax enable
nnoremap <Esc> <Esc>:noh<CR><Esc>
vnoremap < <gv
vnoremap > >gv
nnoremap es A;<Esc>;
nnoremap E $
nnoremap B 0
nnoremap <Left> b
nnoremap <Right> w
inoremap jj <ESC>
""""""""""""""""""""""""""""""""""""""""
" Haskell
""""""""""""""""""""""""""""""""""""""""
nnoremap <C-h>t :GhcModType<CR>
nnoremap <C-h>c :GhcModTypeClear<CR>
""""""""""""""""""""""""""""""""""""""""
" Eye Candy
"""""""""""""""""""""""""""""""""""""""""
let base16colorspace=256
colorscheme base16-ocean
set background=dark
set laststatus=2
""""""""""""""""""""""""""""""""""""""""
" Quick Shortcut
"""""""""""""""""""""""""""""""""""""""""
nnoremap <Leader>C :tabedit ~/.vimrc<CR>
nnoremap <Leader>1 :NERDTreeToggle<CR>
nnoremap <Leader>2 :Tagbar<CR>
nnoremap <Leader>4 :cd ~/Code<CR>
nnoremap <leader>5 :so %<CR>
""""""""""""""""""""""""""""""""""""""""
" Emacs Window Tiling
""""""""""""""""""""""""""""""""""""""""
nnoremap <C-x>o <Esc><C-W>w
nnoremap <C-x>3 <Esc>:vsp<CR>
nnoremap <C-x>2 <Esc>:sp<CR>
nnoremap <C-x>1 <Esc>:only<CR>
nnoremap <Down> <C-W>j<C-W>_
nnoremap <Up> <C-W>k<C-W>_
nnoremap <Right> <C-W>l<C-W>_
nnoremap <Left> <C-W>h<C-W>_
""""""""""""""""""""""""""""""""""""""""
" Custom Function
""""""""""""""""""""""""""""""""""""""""
function! DeleteTrailingWS()
exe "normal mz"
%s /\s\+$//ge
exe "normal `z"
endfunc
autocmd BufWrite *.py :call DeleteTrailingWS()
autocmd BufWrite *.coffee :call DeleteTrailingWS()
autocmd BufWritePost *.hs GhcModCheckAndLintAsync
"Dispatch
nnoremap <F9> :Dispatch<CR>
autocmd FileType java let b:dispatch = 'javac %'
autocmd FileType cpp let b:dispatch = 'clang++ -std=c++11 -O3 -o a %'
autocmd FileType python let b:dispatch = 'python3 %'
autocmd FileType haskell let b:dispatch = 'runhaskell %'
autocmd FileType html let b:dispath = 'open %'
" Omni completion
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment