" wreed vimrc " vim: set foldmethod=marker: python << end import vim end "{{{ ***** PLUGINS INSTALLATION ***** " " #####Vundle##### set nocompatible "required vundle setup filetype off set runtimepath+=~/.vim/bundle/vundle call vundle#begin() " Let Vundle manage itself Plugin 'gmarik/vundle' " ***** plugins that require more stuff (compilation) " As-you-type semantic completion. Plugin 'Valloric/YouCompleteMe', {'pinned': 1} " ***** simple plugins " can launch an interactive program within an Vim buffer (like bash or other shells) Plugin 'oplatek/Conque-Shell' " easy buffer management. Replaced by Unite "Plugin 'jlanzarotta/bufexplorer' " supposedly make '%' more powerful Plugin 'tmhedberg/matchit' " Provides awesome commenting shortcuts Plugin 'scrooloose/nerdcommenter' " Shows file browser. (replaces netrw and :Explore) Plugin 'scrooloose/nerdtree' " the Solarized colorscheme Plugin 'altercation/vim-colors-solarized' " show tabs up on top prettily Plugin 'mkitt/tabline.vim' " shows an outline of all Tags in a file Plugin 'majutsushi/tagbar' " Snippet completion Plugin 'SirVer/ultisnips' " Make vim priiiiity Plugin 'bling/vim-airline' " about 3 billion colorschemes Plugin 'flazz/vim-colorschemes' " Asynchonous building and launching of programs Plugin 'tpope/vim-dispatch' " Makes motions way better. lets you jump anywhere on the screen Plugin 'Lokaltog/vim-easymotion' " Allows multiple cursors at once. very useful Plugin 'wreed4/vim-multiple-cursors' " Dependency for vim-snippets Plugin 'tomtom/tlib_vim' " A library of snippets that work with Utilsnip Plugin 'wreed4/vim-snippets' " ability to surround text objects with things like quotes or parens Plugin 'tpope/vim-surround' " Amazing plugin that makes a lot of things obsolete... Plugin 'unite.vim' " Make Tmux pretty Plugin 'edkolev/tmuxline.vim' " switch between header files easily Plugin 'a.vim' " pretty JSON stuff Plugin 'elzr/vim-json' " Diff directories quickly and powerfully Plugin 'DirDiff.vim' Plugin 'wreed4/vim-lvimrc' " end installed plugins call vundle#end() filetype plugin indent on " #####Pathogen##### " call pathogen#infect() " call pathogen#helptags() " }}} "{{{ ***** PLUGIN SETTINGS ***** " " #####PyMode##### "let pymode_lint_ignore="E501,E401,E225,W191,W391,W404" " use rope code assist instead of a complete function " au FileType python inoremap '=RopeCodeAssistInsertMode()=pumvisible() ? "\C-p>\Down>" : ""' " Tlist " Toggle tag list "nnoremap :TlistToggle " #####EasyMotion##### nmap s (easymotion-sn) " #####Tagbar##### let g:tagbar_autofocus = 1 let g:tagbar_left = 1 let g:tagbar_zoomwidth = 0 let g:tagbar_show_linenumbers = -1 let g:tagbar_foldlevel = 0 let g:tagbar_autoshowtag = 1 " open Tagbar automatically when viewing a supported file/files "autocmd VimEnter * nested :call tagbar#autoopen(1) " open Tagbar automatically when entering a buffer of supported file/files "autocmd BufEnter * nested :call tagbar#autoopen(0) " Toggle Tagbar nnoremap tt :TagbarToggle " #####Airline##### let g:airline_powerline_fonts=1 let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#show_tab_nr = 1 let g:airline#extensions#tabline#tab_nr_type = 1 let g:airline#extensions#tabline#show_close_button =1 let g:airline#extensions#tagbar#flags = 'f' let g:airline#extensions#tagbar#enabled = 1 let g:airline#extensions#whitespace#enabled = 0 let g:airline#extensions#tmuxline#enabled = 1 " #####NERDTree##### let g:NERDTreeHijackNetrw = 0 let g:NERDTreeDirArrows = 1 let g:NERDTreeWinPos = "right" let g:NERDTreeMouseMode = 2 let g:NERDTreeShowLineNumbers = 1 nnoremap nt :NERDTreeToggle nnoremap nf :NERDTreeFind " #####NerdCommenter##### imap NERDCommenterInsert " #####UltiSnips##### let g:UltiSnipsEditSplit = "vertical" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" let g:UltiSnipsSnippetsDir="~/.vim/UltiSnips" " #####CCTree##### nnoremap ct :CCTreeWindowToggle " #####ConqueTerm##### let g:ConqueTerm_CloseOnEnd = 1 "Conque spits out an error about CursorHoldI making it run slow. repress "these warnings let g:ConqueTerm_StartMessages = 0 let g:ConqueTerm_ReadUnfocused = 1 let g:ConqueTerm_ToggleKey = '' " #####Pyclewn##### " Only map keys if we're in Pyclewn if has("netbeans_enabled") "nmap :exe ":Cprint " . expand("") nmap "pyiw :Cprint p nmap :exe ":Cdbgvar " . expand("") vmap "py :Cprint p endif " #####YouCompleteMe##### " Do not open preview window when completing set completeopt=menuone let g:ycm_add_preview_to_completeopt = 0 " Auto Close preview window let g:ycm_autoclose_preview_window_after_insertion = 1 " Disable Tab for cycling through commands so that UtilSnips will still work let g:ycm_key_list_select_completion=[''] let g:ycm_key_list_previous_completion=[''] let g:ycm_collect_identifiers_from_tags_files=0 let g:ycm_collect_identifiers_from_comments_and_strings = 1 let g:ycm_complete_in_comments = 1 let g:ycm_key_invoke_completion = '' "let g:ycm_extra_conf_globlist = ['~/.ycm_extra_conf.py'] let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' let g:ycm_use_ultisnips_completer = 1 nnoremap ] :YcmCompleter GoTo " #####Multiple Cursors##### let g:multi_cursor_exit_from_insert_mode = 0 " #####Unite##### let g:unite_source_history_yank_enable = 1 call unite#filters#matcher_default#use(['matcher_fuzzy']) "nnoremap t :Unite -no-split -buffer-name=files -start-insert file_rec/async:! nnoremap e :Unite -buffer-name=files -toggle file nnoremap r :Unite -no-split -buffer-name=mru -start-insert file_mru nnoremap y :Unite -buffer-name=yank history/yank nnoremap j :Unite -no-split -buffer-name=jump jump nnoremap be :Unite -no-split -buffer-name=buffer buffer nnoremap / :Unite -keep-focus -no-quit -buffer-name=search vimgrep:% " "Doesn't work. Can't get plugins to play nice "nnoremap t :Unite -buffer-name=outline -start-insert outline " #####JSON.vim##### augroup json_autocmd autocmd! autocmd FileType json set autoindent autocmd FileType json set formatoptions=tcq2l autocmd FileType json set textwidth=78 shiftwidth=2 autocmd FileType json set softtabstop=2 tabstop=8 autocmd FileType json set expandtab autocmd FileType json set foldmethod=syntax augroup END " #####DirDiff##### let g:DirDiffExcludes = "*.d,.*.*.swp" " }}} "{{{ ***** VIM FEATURES ***** " " allow project-specific .vimrc files "set exrc set secure " allow the use of a modeline set modeline " automatically read a file if it changes outside of vim set autoread " hide buffers by default instead of unloading them set hidden " turn ruler on set ruler " set incremental search set hlsearch set incsearch " set status line always on set laststatus=2 " turn vim's mode printing off. Airline takes care of this set noshowmode " shorten the pause after leaving insert mode set ttimeoutlen=50 " set mouse always on. I like the mouse sometimes set mouse=a " 256 stuff " disable BackgroundColorErase (BCE) inside of 256-color tmux sessions if &term =~ '256color' set t_ut= endif " OR... do this shit instead if &term =~ '^screen' " tmux will send xterm-style keys when xterm-keys is on execute "set =\e[1;*A" execute "set =\e[1;*B" execute "set =\e[1;*C" execute "set =\e[1;*D" endif " set utf8 set encoding=utf-8 set fileencoding=utf-8 " New Splits default to right, or below set splitbelow set splitright "turn omnicomplete on set omnifunc=syntaxcomplete#Complete " }}} "{{{ ***** VISUALS ***** " set number set norelativenumber set expandtab set shiftwidth=4 set softtabstop=4 set autoindent set nosmartindent " Solarized settings "let g:solarized_termcolors=256 "set background=light "set background=dark "colorscheme solarized " seoul256 settings "let g:seoul256_background = 236 "colorscheme seoul256 "let g:airline_theme="tomorrow" "colorscheme bubblegum "set background=dark "colorscheme wombat256 "colorscheme zenburn "colorscheme kolor "colorscheme jellybeans colorscheme hybrid "colorscheme devbox-dark-256 "colorscheme Tomorrow-Night-Eighties "colorscheme Tomorrow-Night "colorscheme carvedwoodcool syntax on set showcmd "}}} "{{{ ***** KEY MAPPINGS ***** " " make backspace work set backspace=eol,start,indent set whichwrap+=<,>,h,l set whichwrap+=<,>,h,l set pastetoggle= nmap :mks! nnoremap :so ~/.vimrc " treat wrapped lines as multiple lines when navigating map j gj map k gk " Scroll the window up and down more intuitively nnoremap j nnoremap k " Open a new line and exit insert mode, staying on the same line nnoremap o ok nnoremap O Oj " Clean a line and exit insert mode nnoremap c cc " Open tag in new tab nnoremap T " Toggle TODOs as done or not nnoremap x :s/\[ \]TODO/[X]TODO/:nohl nnoremap :s/\[X\]TODO/[ ]TODO/:nohl " copy 'filename:linenumber' to @f register. useful for adding links to " places in files in comments nnoremap gf :let @f=@% . ':' . line('.') " WINDOW ORGANISATION " Smart way to move between windows map j map k map h map l map k map j map h map l " easy resize windows nnoremap + nnoremap - nnoremap 3< nnoremap 3> " easy move windows nnoremap nnoremap nnoremap nnoremap " }}} "{{{ ***** COMMANDS ***** " " make todo list command! -nargs=* -complete=file Todos Unite -keep-focus -auto-resize -no-quit -buffer-name=Todos vimgrep:*:TODO(wreed) "Wrapper for make sequence "replaced by vim-dispatch plugin command! -nargs=* MyMake execute '!clear' | make! | cw " Edit ~/.vimrc in a new tab command! -nargs=0 EditVimrc tabedit ~/.vimrc " }}}