call pathogen#infect() " Call pathogen to enable the plugins in ~/.vim/bundle call pathogen#helptags() filetype plugin on " Enable filetype plugins if &diff colorscheme industry endif set nocompatible set hidden " Allow buffer switching without saving set backup " Make a backup of the file before saving set backupdir=~/.vim/backup " Directory to write backups to (should exist) set directory=~/.vim/tmp " No more .sw[a-z] (swap) files all over the place (should exist) set history=1000 " Save a lot of history (default is 20) if has('persistent_undo') set undofile " Use persistent undo file set undodir=~/.vim/undo " Directory to write undo files to (should exist) set undolevels=1000 " Maximum number of changes that can be undone set undoreload=10000 " Maximum number of lines to save for undo on buffer reload endif set tabstop=2 " Number of spaces that equals a tab set shiftwidth=2 " Number of spaces to shift (e.g. >> and <<) with set expandtab " Insert spaces instead of tabs set autoindent " Automatically indent to the previous lines' indent level set visualbell " Use visual bell instead of a beep set ttyfast " Let vim know we have a fast terminal, regardless of $TERM set encoding=utf-8 " Set default file encoding to utf-8 set nopaste " Set paste off "colorscheme solarized " Use solarized color scheme set background=dark " With a dark background syntax on " Enable/Disable syntax highlighting "set relativenumber " Show relative line numbers from current line (instead of `set nu`) "set number set cursorline " Highlight current line highlight clear SignColumn " Make 'gutter' background match buffer background set listchars=tab:▸\ ,eol:¬ " Characters to use for tabs and newlines for `set list` set laststatus=2 " Always display the powerline statusline set noshowmode " Hide the default mode text (e.g. '-- INSERT --') below the status line set clipboard=unnamed set backspace=2 "set mouse=a " highlight trailing whitespace in red, but not on the line we're typing highlight TrailingWhitespace ctermbg=red guibg=red match TrailingWhitespace /\s\+$/ au InsertEnter * match TrailingWhitespace /\s\+\%#\@ ; q: noremap e :NERDTreeFind noremap :NERDTreeToggle " Bind vs to setup a vsplit buffer, scrolling 'below' the current buffer noremap vs :let @z=&so:set so=0 noscb:bo vsLjzt:setl scbp:setl scb:let &so=@z " Go down to next row, instead of next line nnoremap j gj " Go up to previous row, instead of previous line nnoremap k gk " Bind Y to yank from the cursor to the end of the line nnoremap Y y$ if has("autocmd") " Restore cursor position autocmd BufReadPost * \ if line("'\"") > 1 && line("'\"") <= line("$") | \ exe "normal! g`\"" | \ endif " Set filetype to arduino on .pde files autocmd! BufNewFile,BufRead *.pde setlocal ft=arduino " Change tab settings some file types autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 autocmd FileType rust setlocal tabstop=4 shiftwidth=4 softtabstop=4 " Enable 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 ruby setlocal omnifunc=rubycomplete#Complete autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc " Automatically invoke clang-format on buffer write au FileType c ClangFormatAutoEnable endif " Keep wrapped lines indented if v:version > 704 || v:version == 704 && has("patch338") set breakindent endif " key bindings for fugitive nnoremap gs :Gstatus nnoremap gd :Gdiff nnoremap gc :Gcommit -v nnoremap gb :Gblame " key bindings for tabularize nnoremap a= :Tabularize /= vnoremap a= :Tabularize /= nnoremap a: :Tabularize /: vnoremap a: :Tabularize /: nnoremap a :Tabularize / vnoremap a :Tabularize / " Airline let g:airline_powerline_fonts = 1 " Try to use powerline fonts let g:airline#extensions#branch#enabled = 1 " fugitive integration let g:airline#extensions#syntastic#enabled = 1 " syntastic integration let g:airline#extensions#hunks#enabled = 1 " show a summary of changed hunks let g:airline#extensions#hunks#non_zero_only = 0 " show only non-zero hunks let g:airline#extensions#hunks#hunk_symbols = ['+', '~', '-'] " hunk count symbols " Syntastic let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck'] " vim-go " Enable goimports to automatically insert import paths instead of gofmt let g:go_fmt_command = "goimports" " More syntax highlighting let g:go_highlight_functions = 1 let g:go_highlight_methods = 1 let g:go_highlight_structs = 1 let g:go_highlight_operators = 1 let g:go_highlight_build_constraints = 1 " YouCompleteMe extra_conf whitelist/blacklist let g:ycm_extra_conf_globlist = ['~/dev/*','~/sync/dev/*','!~/*'] au BufNewFile,BufRead /dev/shm/gopass.* setlocal noswapfile nobackup noundofile