set encoding=utf8 scriptencoding utf8 " If you are confused by not seeing a lot of text, push zi " For more info, see :help folding. Read General Notes section to learn " For neovim do: ln -s ~/.vimrc ~/.config/nvim/init.vim """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Plugins """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ vim-plug & paths " Like os.path.join, join all elements by path separator function! s:path_join(...) let l:sep = stridx(a:0, '\') != -1 || g:win_shell ? '\' : '/' return join(a:000, l:sep) endfunction " On Windows with cmd.exe use vimfiles, else use normal unix .vim folder let g:win_shell = (has('win32') || has('win64')) && &shellcmdflag =~? '/' let g:cygwin_shell = has('win32unix') let g:vim_dir = expand(g:win_shell ? '$USERPROFILE/AppData/Local/vim' : '~/.vim') " NVim specifc configuration if has('nvim') let g:vim_dir = expand(g:win_shell ? '$USERPROFILE/AppData/Local/nvim' : '~/.config/nvim') if exists('$DISPLAY') && !executable('xclip') echomsg 'WARNING: No xclip == No neovim clipboard' endif " Set python path for neovim integration let g:python_host_prog = s:path_join(g:vim_dir, 'python_bin') let g:python3_host_prog = s:path_join(g:vim_dir, 'python3_bin') " disable unneeded providers let g:loaded_perl_provider = 0 let g:loaded_ruby_provider = 0 endif try call plug#begin(s:path_join(g:vim_dir, 'plugged')) " Generate documentation skeletons. Early add, also uses . Plug 'kkoomen/vim-doge', { 'do': { -> doge#install() } } " Completion " Min patch for YCM, Neovim has it if !g:win_shell && !g:cygwin_shell && v:version >= 750 Plug 'Valloric/YouCompleteMe', { 'do': function('myutil#ycm_hook') } endif " YCM Alternative, no compilation " Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets' " Plug 'andreyorst/SimpleSnippets.vim' " Light ultisnips alt, no python dep "Plug 'artur-shaik/vim-javacomplete2' " Archived " Prefer async checks when available if has('nvim') || v:version >= 800 Plug 'dense-analysis/ale' " More info: https://github.com/dense-analysis/ale/wiki else Plug 'vim-syntastic/syntastic' | Plug 'myint/syntastic-extras' endif " Allows easy use of async jobs with unified interface Plug 'skywind3000/asyncrun.vim' if !has('nvim') && v:version < 7.5 echomsg 'vim AsyncRun will run sync. Requires patch : 7.4-1829' endif " UI Plug 'vim-airline/vim-airline' | Plug 'vim-airline/vim-airline-themes' Plug 'edkolev/tmuxline.vim' Plug 'junegunn/goyo.vim' Plug 'Konfekt/FastFold' Plug 'Valloric/ListToggle' Plug 'majutsushi/tagbar' Plug 'mhinz/vim-signify' Plug 'rhysd/committia.vim' Plug 'mbbill/undotree' "Plug 'simnalamburt/vim-mundo' " Needs some work, bit busted "Plug 'sjl/gundo.vim' Plug 'vim-scripts/taghighlight' " Movement Plug 'benjifisher/matchit.zip' Plug 'justinmk/vim-sneak' Plug 'MattesGroeger/vim-bookmarks' Plug 'vim-scripts/a.vim' Plug 'vim-scripts/tasklist.vim' " Editting Plug 'bkad/CamelCaseMotion' Plug 'godlygeek/tabular' Plug 'gorkunov/smartpairs.vim' Plug 'scrooloose/nerdcommenter' Plug 'tpope/vim-abolish' Plug 'tpope/vim-speeddating' Plug 'tpope/vim-surround' Plug 'vim-scripts/argtextobj.vim' Plug 'vim-scripts/DeleteTrailingWhitespace' if !has('nvim') Plug 'ConradIrwin/vim-bracketed-paste' endif " Searching & Files Plug 'ctrlpvim/ctrlp.vim' | Plug 'FelikZ/ctrlp-py-matcher' | Plug 'fisadev/vim-ctrlp-cmdpalette' Plug 'gabesoft/vim-ags' Plug 'ludovicchabant/vim-lawrencium' "Plug 'mileszs/ack.vim' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'tpope/vim-fugitive' "Plug 'zhaocai/DirDiff.vim' " Like kdiff inside vim " Misc Functions Plug 'embear/vim-localvimrc' "Plug 'jaxbot/github-issues.vim' " Not using atm Plug 'kopischke/vim-fetch' "Plug 'ludovicchabant/vim-gutentags' Plug 'mhinz/vim-hugefile' Plug 'tpope/vim-sleuth' Plug 'tyru/open-browser.vim' Plug 'starcraftman/cmdalias.vim' Plug 'junegunn/rainbow_parentheses.vim' " Syntax / File Specific if has('nvim') Plug 'nvim-lua/plenary.nvim' Plug 'scalameta/nvim-metals' endif Plug 'udalov/kotlin-vim' "Plug 'alfredodeza/coveragepy.vim' Plug 'chrisbra/csv.vim' Plug 'clones/vim-zsh' Plug 'elzr/vim-json' "Plug 'fatih/vim-go' , { 'do': ':GoUpdateBinaries' } Plug 'hdima/python-syntax' Plug 'junegunn/vader.vim' Plug 'justinmk/vim-syntax-extra' " Very large, enable when needed "Plug 'LaTeX-Box-Team/LaTeX-Box' "Plug 'plasticboy/vim-markdown' | Plug 'godlygeek/tabular' Plug 'rust-lang/rust.vim' "Plug 'Rykka/riv.vim' " Note taking plugin Plug 'sbdchd/neoformat' "Plug 'tfnico/vim-gradle' Plug 'tbastos/vim-lua' " Improved highlighting for lua Plug 'tomswartz07/vim-todo' Plug 'tpope/vim-markdown' "Plug 'vim-ruby/vim-ruby' "Plug 'vivien/vim-addon-linux-coding-style' " Linux Kernel style plugin Plug 'xolox/vim-misc' | Plug 'xolox/vim-lua-ftplugin' Plug 'zaiste/tmux.vim' " Web Programming Plug 'othree/html5.vim' Plug 'ap/vim-css-color' Plug 'hail2u/vim-css3-syntax' "Plug 'kchmck/vim-coffee-script' " Plug 'ternjs/tern_for_vim', { 'do' : 'npm install' } Plug 'pangloss/vim-javascript' Plug 'leafgarland/typescript-vim' Plug 'peitalin/vim-jsx-typescript' Plug 'styled-components/vim-styled-components', { 'branch': 'main' } Plug 'jparise/vim-graphql' Plug 'vim-scripts/jQuery' Plug 'Shutnik/jshint2.vim' "Plug 'StanAngeloff/php.vim' " Color Schemes I like Plug 'morhetz/gruvbox' Plug 'nanotech/jellybeans.vim' Plug 'tomasr/molokai' Plug 'w0ng/vim-hybrid' "Plug 'Reewr/vim-monokai-phoenix' " More vibrant monokai " Nice Alternatives "Plug 'danilo-augusto/vim-afterglow' "Plug 'chriskempson/vim-tomorrow-theme' "Plug 'Lokaltog/vim-distinguished' "Plug 'tpope/vim-vividchalk' "Plug 'vim-scripts/desert256.vim' " Large Selection to sample "Plug 'flazz/vim-colorschemes' if has('nvim') Plug 'fabius/molokai.nvim' | Plug 'rktjmp/lush.nvim' endif call plug#end() catch echomsg 'Run command `Bootstrap`. After restart run command `PlugInstall`.' endtry " }}} " {{{ plugin specific config " {{{ YouCompleteMe / Deoplete / Eclim " YouCompleteMe """"""""""""""" " Global fall back if no config present let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py' let g:ycm_autoclose_preview_window_after_insertion = 1 " Allow completion of identifiers in comments too let g:ycm_complete_in_comments = 1 " Allow ctags for identifier help "let g:ycm_collect_identifiers_from_tags_files = 1 " Use next line to disable ultisnips completion "let g:ycm_use_ultisnips_completer = 0 " Use the following to whitelist dirs for .ycm_extra_conf.py let g:ycm_extra_conf_globlist = [ \ '~/prog/*', \ '~/.shell/zsh-git-prompt/cxx/.ycm_extra_conf.py', \ ] " Force python 3 completion rather than default 2. "let g:ycm_python_binary_path = g:python3_host_prog " link rust src here, can't guarantee same location everywhere let g:ycm_rust_src_path = $RUST_SRC_PATH " Deoplete (next neocomplete, nvim/python3 only) """""""""" " Enable neocomplete at startup let g:deoplete#enable_at_startup = 1 " Use smartcase let g:deoplete#enable_smart_case = 1 " Automatically select first option let g:deoplete#enable_auto_select = 1 " Eclim """"""" " For eclim, YCM will query for completion "let g:EclimCompletionMethod = 'omnifunc' " Fix for signs "let g:EclimShowQuickfixSigns = 0 " }}} " {{{ Syntastic / ALE " Syntastic """"""""""" " " Set what chechers are active or passive " let g:syntastic_mode_map = { " \ 'mode': 'active', " \ 'active_filetypes': ['c', 'cpp', 'java', 'lisp', 'python', 'perl', 'ruby', " \ 'sh', 'xml', 'json', 'xhtml', 'html', 'css', 'javascript'] " \ } " " Check syntax on file open " "let g:syntastic_check_on_open = 1 " " Show errors in the line numbers to left " let g:syntastic_enable_signs = 1 " " Format the syntastic message " let g:syntastic_stl_format = '[%E{Err: %fe #%e}%B{, }%W{Warn: %fw #%w}]' " " List of files to ignore checking, may be useful later " let g:syntastic_ignore_files = [ '\m^/usr/include/' ] " " Always use location list " let g:syntastic_always_populate_loc_list = 1 " " Override, don't think I'll run any unsecure perl files " let g:syntastic_enable_perl_checker = 1 " " Manually set important checkers: " let g:syntastic_python_checkers = ['python', 'pylint', 'flake8'] " let g:syntastic_perl_checkers = ['perl', 'perlcritic'] " let g:syntastic_rst_checkers = ['sphinx'] " " Options to pass to above checkers take form: " " syntastic_filetype_checker_argtype = '' " " Command Run: " let g:syntastic_python_flake8_args = '--max-complexity 10' " ALE """"" " Override active checkers by 'lang' " let g:ale_linters = { " \'lua': ['luac'] " \} " Linting Programs: " For more info: /ALEMORE " lang | cmd | install " ======================================================================== " bash | shellcheck | sudo apt-get install shellcheck " c/cpp | cpplint | git clone https://github.com/google/styleguide.git " c/cpp | cppcheck | sudo apt-get install cppcheck " c/cpp | flawfinder | pip install flawfinder " cmake | cmakelint | pip install cmakelint " go | golint | go install golang.org/x/lint/golint@latest " lua | luacheck | luarocks install luacheck (alternative apt) " perl | perlcritic | cpan -i perlcritic " perl | perltidy | cpan -i perltidy " python | flake8 | pip install flake8 " python | pylint | pip install pylint " ruby | rubocop | gem install rubocop " rust | cargo | Installed with rust. Only works on file write. " vim | vim-vint | pip install vim-vint " xml | xmllint | sudo apt-get install libxml2-utils " yaml | yamllint | sudo apt-get install yamllint " Prefer low complexity funcs let g:ale_python_flake8_options = '--max-complexity 10' " }}} "{{{ Nerdcommenter / Nerdtree " Nerdcommenter """"""""""""""" " Produces this: /* int foo=2; */ let g:NERDSpaceDelims = 1 " Remove any extra spaces let g:NERDRemoveExtraSpaces = 1 " Trim on comment toggle let g:NERDTrimTrailingWhitespace = 1 " Nerdtree """""""""" " Control sort let g:NERDTreeNaturalSort = 1 "let g:NERDTreeCaseSensitiveSort = 1 " Show hidden files by default let g:NERDTreeShowHidden = 1 let g:NERDTreeSortHiddenFirst = 1 " Don't need window after selecting file let g:NERDTreeQuitOnOpen = 1 " Classic theme with |'s instead of >'s let g:NERDTreeDirArrows = 0 " Width of window let g:NERDTreeWinSize = 40 " Don't replace netrw (i.e. :e directory), defualt is 1 let g:NERDTreeHijackNetrw = 1 " Bookmarks can persist here let g:NERDTreeBookmarksFile = s:path_join(g:vim_dir, '.nerd_marks') " }}} " {{{AsyncRun """"""""""""" " See myutil#run in /autoload " Set project wide run/test commands with ".lvimrc" files " Override temporarily with buffer equivalents. " To run a command on current file: cmd %f "let g:amake_run = 'tox' "let g:amake_test = 'tox' " Open window on command for n pixels, and scroll let g:asyncrun_open = 10 " Trim blank lines let g:asyncrun_trim = 1 " }}} " {{{ UltiSnips """"""""""" " Set dir to .vim section let g:UltiSnipsSnippetsDir = s:path_join(g:vim_dir, 'snippets') " Force a version of python "let g:UltiSnipsUsePythonVersion = 2 " }}} " {{{ Doge """"""""""" let g:doge_doc_standard_python = 'reST' " }}} " {{{ vim-sneak """"""""""""""" " Allows quick motion when more than 2 matches let g:sneak#streak = 1 " Allows smart case usage of sneak let g:sneak#use_ic_scs = 1 " Toggle to allow or prevent sneak in netrw " When enabled, moves old s binding to s/S let g:sneak#map_netrw = 1 " }}} " {{{ CtrlP """"""""""" " Using user command speeds up but means have to change command for options " like hidden or ignores if executable('ag') let &grepprg = 'ag --nogroup --nocolor' let s:ctrlp_fallback = 'ag %s \ --nocolor --nogroup --depth 8 \ --hidden --follow --smart-case \ --ignore .bazaar \ --ignore .bzr \ --ignore .cache \ --ignore .ccache \ --ignore .git \ --ignore .hg \ --ignore .svn \ --ignore .ccache \ --ignore .DS_Store \ --ignore .opt \ --ignore .pytest_cache \ --ignore .pylint.d \ --ignore .shell \ --ignore .tox \ --ignore .wine \ --ignore .wine-pipelight \ --ignore "**/*.pyc" \ --ignore "**/*.class" \ --ignore "**/*.o" \ -g ""' elseif g:win_shell let s:ctrlp_fallback = 'dir %s /-n /b /s /a-d' else let s:ctrlp_fallback = 'find %s -type f' endif let g:ctrlp_user_command = { \ 'types': { \ 1: ['.git', 'cd %s && git ls-files . --cached --others --exclude-standard'], \ 2: ['.hg', 'hg --cwd %s locate -I .'], \ }, \ 'fallback': s:ctrlp_fallback \ } " Faster matcher if has('python') let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } endif " Open them horizontally split let g:ctrlp_open_multiple_files = 'h' " }}} " {{{ TagBar """""""""""" " Close on selecting an option let g:tagbar_autoclose = 1 " Focus on open let g:tagbar_autofocus = 1 " Compact the menu let g:tagbar_compact = 1 " Extra file support for tagbar " https://github.com/majutsushi/tagbar/wiki " go get -u github.com/jstemmer/gotags let g:tagbar_type_go = { \ 'ctagstype' : 'go', \ 'ctagsbin' : 'gotags', \ 'ctagsargs' : '-sort -silent', \ 'kinds' : [ \ 'p:package', \ 'i:imports:1', \ 'c:constants', \ 'v:variables', \ 't:types', \ 'n:interfaces', \ 'w:fields', \ 'e:embedded', \ 'm:methods', \ 'r:constructor', \ 'f:functions' \ ], \ 'kind2scope' : { \ 't' : 'ctype', \ 'n' : 'ntype' \ }, \ 'scope2kind' : { \ 'ctype' : 't', \ 'ntype' : 'n' \ }, \ 'sro' : '.', \ } " cabal install hasktags let g:tagbar_type_haskell = { \ 'ctagsbin' : 'hasktags', \ 'ctagsargs' : '-x -c -o-', \ 'kinds' : [ \ 'm:modules:0:1', \ 'd:data: 0:1', \ 'd_gadt: data gadt:0:1', \ 't:type names:0:1', \ 'nt:new types:0:1', \ 'c:classes:0:1', \ 'cons:constructors:1:1', \ 'c_gadt:constructor gadt:1:1', \ 'c_a:constructor accessors:1:1', \ 'ft:function types:1:1', \ 'fi:function implementations:0:1', \ 'o:others:0:1' \ ], \ 'kind2scope' : { \ 'm' : 'module', \ 'c' : 'class', \ 'd' : 'data', \ 't' : 'type' \ }, \ 'scope2kind' : { \ 'module' : 'm', \ 'class' : 'c', \ 'data' : 'd', \ 'type' : 't' \ }, \ 'sro' : '.', \ } " Depends on ~/.ctags let g:tagbar_type_make = { \ 'kinds':[ \ 'm:macros', \ 't:targets' \ ], \ } " Depends on ~/.ctags let g:tagbar_type_perl = { \ 'ctagstype' : 'perl', \ 'kinds' : [ \ 'p:package:0:0', \ 'w:roles:0:0', \ 'e:extends:0:0', \ 'u:uses:0:0', \ 'r:requires:0:0', \ 'o:ours:0:0', \ 'a:properties:0:0', \ 'b:aliases:0:0', \ 'h:helpers:0:0', \ 's:subroutines:0:0', \ 'd:POD:1:0' \ ], \ } " Depends on Universal Ctags (ctags.io) let g:tagbar_type_ruby = { \ 'kinds' : [ \ 'm:modules', \ 'c:classes', \ 'd:describes', \ 'C:contexts', \ 'f:methods', \ 'F:singleton methods' \ ], \ } " Depends on ~/.ctags let g:tagbar_type_rust = { \ 'ctagstype' : 'rust', \ 'kinds' : [ \ 'T:types,type definitions', \ 'f:functions,function definitions', \ 'g:enum,enumeration names', \ 's:structure names', \ 'm:modules,module names', \ 'c:consts,static constants', \ 't:traits', \ 'i:impls,trait implementations', \ ], \ } "}}} " {{{undotree """"""""""""" " To the left, diff expands to whole bottom let g:undotree_WindowLayout = 2 " Width of new split let g:undotree_SplitWidth = 35 " Focus on open let g:undotree_SetFocusWhenToggle = 1 " }}} " {{{ Ack.vim / Ag Flags """"""""""""" " Options when using ack " let g:ack_default_options = ' -s -H --nocolor --nogroup --column --sort-files --smart-case --follow' " " Options to use when searching with ag let g:agprg = 'ag --column --smart-case --follow' " }}} " {{{ lua-ftplugin """""""""""""""""" " Enable omnicomplete, works with ycm let g:lua_complete_omni = 1 " Disable automatic insertion let g:lua_complete_dynamic = 0 " }}} " {{{ Miscellaneous " Bookmarks """"""""""" " Center on jumping to bookmark let g:bookmark_center = 1 " When jumping from quicklist, close it let g:bookmark_auto_close = 1 " OpenBrowser """"""""""""" " Default engine to duckduck let g:openbrowser_default_search = 'duckduckgo' " DeleteTrailingWhitespace """""""""""""""""""""""""" " Always delete trailing whitespace from lines on save " Bit harsh, may cause issues if such space needed let g:DeleteTrailingWhitespace = 1 let g:DeleteTrailingWhitespace_Action = 'delete' " LargeFile """"""""""" " The size a file is considered large, in MiB. Manual -> HugefileToggle "let g:hugefile_trigger_size = 2 " Github Issues """"""""""""""" " On forks, find issues from upstream ONLY "let g:github_upstream_issues = 1 " Goyo.vim """""""""" " Archived, don't remember why I made this " Hooks that run on enter/exit of Goyo command " function! s:goyo_enter() " endfunction " function! s:goyo_leave() " endfunction " augroup my_goyo " autocmd! " autocmd! User GoyoEnter " autocmd! User GoyoLeave " autocmd User GoyoEnter nested call goyo_enter() " autocmd User GoyoLeave nested call goyo_leave() " augroup END " vim-prettier """""""""" let g:neoformat_try_node_exe = 1 " LocalVimrc """""""""""" " Allow non-sandbox let g:localvimrc_sandbox = 0 " Store decisions on Y/N/A in file let g:localvimrc_persistent = 1 let g:localvimrc_persistence_file = s:path_join(g:vim_dir, '.lvimrc_persist') " ListToggle (Valoric) """""""""""""""""""""" let g:lt_location_list_toggle_map = 'l' let g:lt_quickfix_list_toggle_map = 'q' "let g:lt_height = 10 " Rainbow Parentheses """"""""""""""""""""" let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle " }}} " }}} """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Status Line """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ " statusline (mainly fallback no airline) """""""""""" " Simple fallback, normally use airline " Missing ALE fallback ... let &statusline = '%<%1* %F%m%r%h %y || %{&fenc?&fenc:&enc}[%{&ff}]' if exists(':SyntasticInfo') let &statusline .= ' || %{SyntasticStatuslineFlag()}' endif let &statusline .= '%= %b(0x%B) || T%{tabpagenr()} W%{winnr()} B%{bufnr("%")} ' let &statusline .= '|| %p%% %l/%L : %c %0*' set laststatus=2 " vim-airline """"""""""""" " Enable syntastic integration let g:airline#extensions#syntastic#enabled = 1 " Enable a smart tab top let g:airline#extensions#tabline#enabled = 1 " Enable powerline fonts let g:airline_powerline_fonts = 1 " tmuxline """""""""" " Preset for my tmux line let g:tmuxline_preset = { \'a' : '#h', \'b' : '#(curl icanhazip.com)', \'win' : '#I #W', \'cwin' : '#I #W', \'y' : ['#S', '#I', '#P'], \'z' : ['%d %b %Y', '%H:%M:%S'], \'options' : {'status-justify': 'left'} \ } " }}} """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Key Mappings """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ " For custom key combos, use leader let g:mapleader = ',' " I feel like I should use this sometime ..... "let maplocalleader = '\\' " Never use ex mode nnoremap Q " Faster binding to escape insert/visual inoremap jk vnoremap i "inoremap " Aliasing some commands to make tabs/buffers easy to manage " Note with hidden set, buffers and tabs are largely the same try call cmdalias#add('bn', 'bnext') call cmdalias#add('bp', 'bprevious') call cmdalias#add('tn', 'tabn') call cmdalias#add('tp', 'tabp') call cmdalias#add('te', 'tabe') call cmdalias#add('td', 'tabclose') " I always forget for explore, make some shortcuts, Ev for v split, Et for tab call cmdalias#add('E', 'Explore') call cmdalias#add('Et', 'Texplore') call cmdalias#add('Ev', 'Sexplore') " Shortcuts for plugin management call cmdalias#add('pi', 'PlugInstall') call cmdalias#add('pu', 'PlugUpdate') call cmdalias#add('puu', 'PlugUpdate PlugUpgrade') call cmdalias#add('pc', 'PlugClean') " Neorformat call cmdalias#add('nf', 'Neoformat') catch endtry " Arrow keys to move through buffers/tabs nnoremap :bnext nnoremap :bprevious nnoremap :tabn nnoremap :tabp " Remap Space + direction to move between split windows nnoremap k :wincmd k nnoremap j :wincmd j nnoremap h :wincmd h nnoremap l :wincmd l " Change window down (j) then maximize buffer height (_) nnoremap j_ nnoremap k_ " Change window right (l) then maximize buffer width (|) nnoremap l:vertical resize:AirlineToggle:AirlineToggle nnoremap h:vertical resize:AirlineToggle:AirlineToggle " Make all windows equal in size "nnoremap q = " Open netrw easily "nnoremap e :Explore "nnoremap v :Vexplore "nnoremap h :Hexplore! " To open NERDTree when used nnoremap v :NERDTreeToggle " Find the current file in the source tree nnoremap vf :NERDTreeFind " Signify binding to jump between hunks nmap hj (signify-next-hunk) nmap hk (signify-prev-hunk) " Sneak explicit mappings nmap ; SneakNext xmap ; SneakNext nmap ' SneakPrevious xmap ' SneakPrevious " Key bindings for UltiSnips, all of these are ctrl + key let g:UltiSnipsExpandTrigger = '' let g:UltiSnipsListSnippets = '' let g:UltiSnipsJumpForwardTrigger = '' let g:UltiSnipsJumpBackwardTrigger = '' " Open the filetype specific file nnoremap ft :FTOpen " Binding for extra search modes nnoremap i :CtrlPCurWD nnoremap m :CtrlPMRUFiles nnoremap b :CtrlPBuffer nnoremap c :CtrlPCmdPalette nnoremap :CtrlPTag nnoremap >a :CtrlPBufTagAll " Add shortcut to jump to definition/declaration of c file nnoremap j :YcmCompleter GoTo " For smart TAB completion function! s:check_back_space() let l:col = col('.') - 1 return !l:col || getline('.')[l:col - 1] =~? '\s' endfunction inoremap pumvisible() ? "\" : \ check_back_space() ? "\" : \ neocomplete#start_manual_complete() " Shortcut to swap to header file, horizontal split nnoremap a :AS " Shortcut to swap to header file, vertical split nnoremap av :AV nnoremap d :%DeleteTrailingWhitespace vnoremap d :DeleteTrailingWhitespace " Hex editting command on x, archived " nnoremap x :%!xxd " nnoremap X :%!xxd -r " Fix oneline json files nnoremap jq :%!jq . nnoremap jQ :%!jq . -c " Paste toggle button, disables indents. No longer needed? "set pastetoggle= " Toggle line numbers nnoremap :set number!:sign unplace * inoremap :call feedkeys("\i") " Shortcut for tagbar outline of file nnoremap :TagbarToggle inoremap :call feedkeys("\") " Shortcut for gundo sidebar nnoremap :UndotreeToggle inoremap :call feedkeys("\") " Toggle showing whitespace nnoremap :set list! inoremap :call feedkeys("\i") " Shortcut to remember how to reindent file nnoremap mzgg=G'z " See " AsyncRun section, build in background " Set b:amake_run/test for per buffer, otherwise g for global nnoremap m :call myutil#test() nnoremap mr :call myutil#run() nnoremap ms :AsyncStop " I forgot the reason for this. Needed? if has('nvim') tnoremap endif " }}} """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General Options & Features """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ " Ensure backspace works as you'd expect, over lines/indents set backspace=indent,eol,start " This is the timeout on key combos and map commands set timeout set timeoutlen=500 " Set to auto read when a file is changed from the outside set autoread " Allow hiding of files, when using standard :e filename option set hidden " Folding method, for most code use indent, no need to clutter source set foldmethod=syntax set foldminlines=6 set foldnestmax=2 " Enable folding at the syntax level let g:javaScript_fold = 1 let g:php_folding = 1 let g:r_syntax_folding = 1 let g:ruby_fold = 1 let g:sh_fold_enabled = 1 let g:vimsyn_folding = 'af' let g:xml_syntax_folding = 1 " Sets how many lines of history & undo VIM has to remember set history=1000 set undolevels=1000 " Keep a persistent backup file, preserves undo history between edit sessions if has('persistent_undo') let &undodir = s:path_join(g:vim_dir, 'undo') try call mkdir(&undodir, 'p') catch endtry set undofile endif " Autocomplete feature for command mode (i.e. :command) set wildmenu set wildmode=longest,list,full " Turn backup off, since most files in a VCS set nobackup set nowritebackup set noswapfile " No annoying sound on errors set noerrorbells set visualbell set t_vb= " }}} """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => VIM User Interface & Search """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ " Set minimum screen size for GVim, on console just fill if has('gui_running') set lines=80 columns=140 endif " Set line numbering on left set number " Set position indicator on bottom right set ruler " Show command in last line, usually on by default set showcmd " Highlight current line in number side set cursorline " Minimum number of lines that will always be above/below cursor set scrolloff=10 " Highlight search results set hlsearch " Incrementally highlight first matching word as you type a search set incsearch " Show matching brackets when text indicator is over them set showmatch " How many tenths of a second to blink when matching brackets set matchtime=1 " For regular expressions turn magic on, don't need to \* in regex set magic " When searching ignore case unless contains a capital " Override with \c/\C flag in regex -- /\cword set ignorecase set smartcase " More intiutive when new splits at right and bottom set splitbelow set splitright " }}} """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Tab & Indents """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ " 1 tab == 4 spaces set softtabstop=4 set shiftwidth=4 set tabstop=4 " When using `<<` or `>>`, round to nearest multiple of shiftwidth set shiftround " Use spaces instead of tabs set expandtab " When push tab in insert shift by tabstop, when backspace delete tabstop amount set smarttab " Copy indent at current when inserting new line set autoindent " Wrap lines when hit right side, doesn't affect buffer set nowrap " When wrapping, respect the indent of original line if exists('&breakindent') set breakindent endif " Makes smarter decisions about what stays on wrapped line set linebreak " When inserting text, force a line break at this amount " Set to 0 to disable "set textwidth=150 set textwidth=0 " Show end of line and tabs on screen "set list set listchars=eol:$,tab:→→,trail:✘ " }}} """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Colors & Fonts """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ syntax off " Set dark background before, else colors off set background=dark try if &diff && (has('gui_running') || &t_Co > 255) colorscheme jellybeans elseif has('gui_running') || &t_Co > 255 colorscheme molokai " Molokai CursorLine isn't bright enough hi CursorLine ctermbg=236 else colorscheme gruvbox endif catch colorscheme desert endtry syntax on highlight ColorColumn ctermbg=238 function! s:match_col_no() let l:col_no = exists('b:match_column_no') ? b:match_column_no : 100 call matchadd('ColorColumn', '\%' . l:col_no . 'v', 100) endfunction " Set font when using gui version if has('gui_running') if has('gui_gtk2') set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 10 elseif has('gui_win32') set guifont=DejaVu_Sans_Mono_for_Powerline:h10:cANSI endif endif " }}} """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => NETRW File Explorer & File Ignore """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ " Customize netrw use a tree style and ignore some extensions let g:netrw_liststyle = 3 " Set the explorer sorting to case insensitive let g:netrw_sort_options = 'i' " Controls what happens when you push enter over file, default open in buffer let g:netrw_browse_split = 0 " This list is used to build the strings for wildignore and netrw_list_hide " Any file ending in one of these extensions will be ignored in command completion & netrw browser let s:hide_exts = ['jpg', 'jpeg', 'png', 'svg', 'bmp', 'gif', 'xpm', 'so', 'dll', 'exe', 'o', 'a'] let s:hide_exts += ['pyc', 'class', 'com', 'rar', 'zip', 'gz', 'bz2', '7z', 'iso', 'jar', 'dmg'] let s:hide_exts += ['deb', 'pdf'] " Add to ignore docs "let s:hide_exts += ['doc', 'docx', 'odt', 'xls', 'xlsx', 'ods', 'ppt', 'pptx', 'odp'] " Processing here to build the large regexp let s:wild_regex = '' let s:netrw_regex = '' for s:ext in s:hide_exts let s:wild_regex .= '*.' . s:ext . ',' let s:netrw_regex .= s:ext . '\|' endfor " Don't leave trailing separator let s:wild_regex = s:wild_regex[:-2] let s:netrw_regex = s:netrw_regex[:-3] " Hide VCS & build folders let s:vcs_hide = '\.git,\.hg,\.svn,\.bzr,\.cache,\.tox' let s:vcs_hide .= ',__pycache__,\w\+\.egg-info,\.pytest_cache' " When using autocomplete tab, ignore all matching strings let &wildignore = s:wild_regex . ',' . s:vcs_hide " When browsing with netrw, ignore all matching files to this regex let g:netrw_list_hide = '\w\+\.\(' . s:netrw_regex . '\)\*\?$\c,' . s:vcs_hide let g:NERDTreeIgnore = split(g:netrw_list_hide, ',') " Sort by extensions commonly found let s:sort_exts = ['h', 'hh', 'hpp', 'hxx', 'c', 'cc', 'cpp', 'cxx'] let s:sort_exts += ['go', 'rs', 'java', 'py', 'pl', 'rb'] let s:sort_exts += ['sql', 'html', 'css', 'js', 'json', 'csv'] let s:sort_exts += ['ini', 'toml', 'xml', 'yaml'] let g:netrw_sort_sequence = '[\/]$,\,' for s:ext in s:sort_exts let g:netrw_sort_sequence .= '\.' . s:ext . '$,' endfor let g:netrw_sort_sequence .= '*,\.info$,\.swp$,\.bak$,\~$' let g:NERDTreeSortOrder = split(g:netrw_sort_sequence, ',') " }}} """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Autocommands & Filetype Specific """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ " Protection against older Vim versions. Gvim reports falsely augroup = 0 sometimes if has('autocmd') if has('gui') augroup gui_cmds autocmd! " Stop bell on gvim autocmd GuiEnter * set visualbell t_vb= augroup END endif augroup buf_cmds autocmd! " Prevent undo files in some paths autocmd BufWritePre /tmp/* setlocal noundofile " All .md files should be markdown "autocmd BufRead,BufNewFile *.md set filetype=markdown " When change vimrc, reload it on write "autocmd BufWritePost $MYVIMRC source $MYVIMRC " When leaving window, save state to a file. Restore on return " Includes cursor position, fold states, "au BufWinLeave *.* silent! mkview "au BufWinEnter *.* silent! loadview "Highlight when I exceed a column limit autocmd BufEnter * call s:match_col_no() "Highlight the region autocmd BufWinEnter plug.vim syn region vimPythonRegion fold matchgroup=vimScriptDelim start=+execute\s*py_exe\s*"<<\s*EOF"*+ end=+^EOF$+ contains=@vimPythonScript augroup END " Register funcs with filetype load augroup ftype_cmds autocmd! " missing keywords for bash statement syntax autocmd FileType sh execute 'syntax keyword shStatement source shopt' " s is sort in tagbar, use alternate autocmd FileType tagbar nmap s Sneak_s autocmd FileType tagbar nmap S Sneak_S " easily escape quickfix/location buffer autocmd FileType qf nnoremap q :q augroup END augroup netrw_cmds autocmd! autocmd FileType netrw nmap x gh autocmd FileType netrw nunmap augroup END endif " }}} """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Useful Functions & Commands """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ " TODO: Move to myutil when feeling less lazy. " A simple colorscheme function to test colors for a buffer " Allow both cycling choosing by name command! -nargs=0 SchemeNext call Color.Next() command! -nargs=0 SchemeBack call Color.Prev() command! -nargs=0 SchemePick call Color.Pick() let g:Color = {} function! g:Color.Init(remDefaults) " Populate list let l:schemes = split(globpath(&runtimepath, 'colors/*.vim'), '\n') if a:remDefaults == 1 let l:pattern = g:win_shell ? 'vim7.4withLua' : 'share/vim' let l:schemes = filter(l:schemes, 'v:val !~ l:pattern') endif let l:self.list = sort(map(l:schemes, "fnamemodify(v:val, ':t')[0:-5]")) " Find current index let l:self.cur = 0 for l:scheme in l:schemes if l:scheme ==? g:colors_name break endif let l:self.cur += 1 endfor let l:self.default = l:self.cur + 1 if (len(l:self.list) > 26) echomsg 'too many schemes, listing first 26' return endif endfunction " Returns a string with anchors for confirm dialog function! g:Color.Choices() let l:msg = '' let l:char = 'A' for l:s in l:self.list let l:msg .= '&' . l:char . l:s . "\n" let l:char = nr2char(char2nr(l:char) + 1) " Stop at 26th if l:char ==? '[' break endif endfor return l:msg[0:-2] endfunction function! g:Color.Set() " Set new scheme syntax off set background=dark execute 'colorscheme ' . l:self.list[l:self.cur] syntax on echomsg 'colorscheme is now: ' . g:colors_name endfunction function! g:Color.Next() let l:self.cur = (l:self.cur + 1) % len(l:self.list) call l:self.Set() endfunction function! g:Color.Prev() let l:self.cur = (l:self.cur - 1) % len(l:self.list) call l:self.Set() endfunction function! g:Color.Pick() " Returns cur of 1 - n choices let l:self.cur = confirm('Pick Scheme From:', l:self.Choices(), l:self.default) - 1 call l:self.Set() endfunction call g:Color.Init(1) " For a block of lines change spacing from old tab size to new tab size command! -nargs=+ -range=% CS call s:ChangeSpace(, , ) command! -nargs=+ -range=% ChangeSpace call s:ChangeSpace(, , ) function! s:ChangeSpace(line1, line2, old_tab, new_tab) let l:rtab_cmd = printf('%s,%sretab', a:line1, a:line2) execute printf('set ts=%s sts=%s sw=%s noet', a:old_tab, a:old_tab, a:old_tab) execute l:rtab_cmd . '!' execute printf('set ts=%s sts=%s sw=%s et', a:new_tab, a:new_tab, a:new_tab) execute l:rtab_cmd endfunction " Open the ftplugin file for current buffer command! -nargs=0 FTOpen call s:FTOpen() function! s:FTOpen() let l:file = printf('%s/ftplugin/%s.vim', g:vim_dir, &filetype) execute 'sp ' . l:file endfunction command! -nargs=+ FileFetch call g:FileFetch() function! g:FileFetch(src, dst) let l:dst_dir = fnamemodify(a:dst, ':h') if !isdirectory(l:dst_dir) call mkdir(l:dst_dir, 'p') endif if has('python') call s:fetch_python(a:src, a:dst) elseif has('ruby') call s:fetch_ruby(a:src, a:dst) elseif executable('curl') silent execute printf('!curl -fLo %s %s >/dev/null 2>&1', a:dst, a:src) elseif executable('wget') silent execute printf('!wget -O %s %s >/dev/null 2>&1', a:dst, a:src) else throw 'Need any of: `curl` or `wget` or +python or +ruby' endif redraw! echomsg 'File ' . fnamemodify(a:src, ':t') . ' written to ' . a:dst . '.' endfunction function! s:fetch_python(src, dst) python << EOF import urllib import vim urllib.urlretrieve(vim.eval('a:src'), vim.eval('a:dst')) EOF endfunction function! s:fetch_ruby(src, dst) ruby << EOF require 'open-uri' File.open(VIM::evaluate('a:dst'), 'w') do |f| f << open(VIM::evaluate('a:src')).read end EOF endfunction command! -nargs=0 Bootstrap call s:bootstrap() function! s:bootstrap() let l:plug_src = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' let l:plug_dst = s:path_join(g:vim_dir, 'autoload', 'plug.vim') call g:FileFetch(l:plug_src, l:plug_dst) echo 'Restart and run `PlugInstall`.' endfunction command! -nargs=0 VimrcUpdate call s:vimrc_update() function! s:vimrc_update() let l:src = 'https://raw.githubusercontent.com/starcraftman/dot/master/files/vimrc' call g:FileFetch(l:src, $MYVIMRC) echo '$MYVIMRC is up to date.' endfunction " Bundle env variables, vimrc & .vim folders for remote deploy command! -nargs=0 BundleVim call s:bundle_vim() function! s:bundle_vim() let l:src = 'https://raw.githubusercontent.com/junegunn/myvim/master/myvim' let l:dst = 'myvim' call g:FileFetch(l:src, l:dst) execute '!bash ' . l:dst call delete(l:dst) endfunction command! -nargs=0 Spell call s:tog_spell() function! s:tog_spell() if &spell setlocal nospell else setlocal spell spelllang=en_ca endif endfunction " }}} """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => General Notes """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " {{{ " Quick Links """"""""""""" " {{{ " * To Learn Vim: vimtutor " The vim tutor is an introductory programs, useful for beginners " " * Vim Cheatsheet and Tutorial: " http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html " " * Vim regex: " http://www.vimregex.com/ " " * Vim Script: Learn to make plugins and contructs like loops, vars and commands " http://learnvimscriptthehardway.stevelosh.com/ " " * Vim Syntax/Indent Files: " http://robots.thoughtbot.com/writing-vim-syntax-plugins " " * Vim NETRW remote editting " http://www.vim.org/scripts/script.php?script_id=1075 " " * Explore plugins at: " http://vimawesome.com/ " * For detailed breakdown of basic vim options, I started by looking at this one: " http://amix.dk/vim/vimrc.html " " * For color schemes: " Large selection of schemes: https://github.com/flazz/vim-colorschemes " Put schemes in ~/.vim/colors or use a plugin manager " Favourites In Order: " molokai, jellybeans, desert256, wombat256mod, mrkn256, xoria256, twilight256 " " }}} " " ALEMORE """"""""" " {{{ " Store direct links to handy linting projects. For install and reference. " lang | cmd | notes/site " ============================================================ " bash | shellcheck | https://github.com/koalaman/shellcheck " c/cpp | cpplint | git clone https://github.com/google/styleguide.git " c/cpp | cppcheck | http://cppcheck.sourceforge.net " c/cpp | flawfinder | https://www.dwheeler.com/flawfinder " cmake | cmakelint | https://github.com/richq/cmake-lint " go | golint | https://godoc.org/github.com/golang/lint " lua | luacheck | https://github.com/mpeterv/luacheck " perl | perlcritic | https://github.com/Perl-Critic/Perl-Critic/ " perl | perltidy | http://perltidy.sourceforge.net " python | flake8 | https://github.com/pycqa/flake8 " python | pylint | https://github.com/PyCQA/pylint " ruby | rubocop | https://github.com/bbatsov/rubocop " rust | cargo | https://github.com/rust-lang/cargo " vim | vim-vint | https://github.com/Kuniwak/vint " xml | xmllint | http://xmlsoft.org/xmllint.html (Standard platform tool) " yaml | yamllint | https://github.com/adrienverge/yamllint " }}} " Installation Procedure """""""""""""""""""""""" " {{{ " 1) Install Vim 7.4 with Python, Lua & Signs: " a) Automated Build " BuildSrc.py vim " " b) Manual Build " https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source " " b) Windows " Download and extract: " http://tuxproject.de/projects/vim/complete-x86.7z " Put the lua52.dll in the root project " http://sourceforge.net/projects/luabinaries/files/5.2/Windows%20Libraries/Dynamic/" " " c) Windows Babun (Cygwin) " https://github.com/babun/babun " " 2) Check Support for features: " :echo has('lua') && has('python') && has('signs') " " 3) Next setup config fils (.vim, .vimrc and so on) " a) Python Script " SysInstall home " Symbolically links .vim & .vimrc to home " Bootstraps vim plugin manager " Sets up powerline fonts for airline " " b) Manually link/copy/download above. See ~/.my_scripts/dot_files " Link from ~/.my_scripts/dot_files to $HOME " Get Manager: " vim +Bootstrap +qa " Powerline Fonts: " See steps at: " http://powerline.readthedocs.org/en/latest/installation.html " " 4) Open vim and install plugins " :PluginInstall " " 5) Further Config: " Plug : Requires nvim/python/ruby for parallel install " YouCompleteMe : Requires cpp compilation, done on hook for *nix " vim-airline : Powerline fonts optional, see SysInstall.py home " TagBar : Requires exhuberant tags, see BuildSrc.py ctags " taghighlight : Same as above " vim-ags/ack.vim : Ag/Ack on system, see BuildSrc.py dev " eclim : See manual steps from site " }}} " Plugin Information """""""""""""""""""" " {{{ " Plug: " Minimal new plugin manager with parallelism, nvim/python/ruby " PlugUpdate only does bundles, PlugUpgrade for manager " https://github.com/junegunn/vim-plug " neocomplete: " Fairly complete YCM replacement for on Windows " https://github.com/Shougo/neocomplete.vim " YouCompleteMe: " Very good autocomplete, includes path completion, " automatic function indexing and clang checking with syntastic " Info at url below or use ycm_compile.py in my repo " https://github.com/Valloric/YouCompleteMe " Syntastic: " Syntax checking without running code usually on buffer write " https://github.com/scrooloose/syntastic " Extra Info: http://blog.jpalardy.com/posts/how-to-configure-syntastic/ " vim-signify: " Shows the diff of file being eddited to left of numbers, i.e. 'gutter' " https://github.com/mhinz/vim-signify " vim-airline: " Plugin that gives nice colored status line " https://github.com/bling/vim-airline " See :help airline and AirlineToggle " NB: Be sure to patch ~/.fonts with powerline-fonts " See: https://powerline.readthedocs.org/en/latest/installation/linux.html#font-installation " tmuxline.vim: " Copy airline scheme onto tmux on vim startup " https://github.com/jedkolev/tmuxline.vim " ultisnips: " Same as SnipMate, seems that project may be unmaintained " https://github.com/SirVer/ultisnips " Required default snippets now externalized to below " https://github.com/honza/vim-snippets " vim-sneak: " Provies quick motion for cursor " Keys: " s - search for word " ; - next word " ' - prev word match " ctrl + o - back to start " https://github.com/justinmk/vim-sneak " CtrlP: " Fuzzy file finding that is a bit easier than CtrlT " Searches under root, looks for .hg/.git or so to define top " Use Ctrl+P to access " Original: " https://github.com/kien/ctrlp.vim " Fork: Original no longer updating " https://github.com/ctrlpvim/ctrlp.vim " Faster Matching: " https://github.com/'FelikZ/ctrlp-py-matcher " TagBar: " A outline of the files contents " Uses exuberant ctags, not GNU ctags " See info at: https://github.com/majutsushi/tagbar " taghighlight: " Allow highlighting types based on ctags " https://github.com/vim-scripts/taghighlight " Gundo: " Graphical tree like explorer for visualizing undo history " Project: https://github.com/sjl/gundo.vim " Usage: http://sjl.bitbucket.org/gundo.vim/#Usage " Seems original maintainer afk " Fork: https://github.com/simnalamburt/vim-mundo " NERDComment: " Bunch of comment commands. Mainly ci to comment line " https://github.com/scrooloose/nerdcommenter " NERDTree: " Plugin that is a pretty NETRW replacement. I'm not sure I want it, but may re-evaluate " Open with :NERDTree command " https://github.com/scrooloose/nerdtree " vim-abolish: " Help for renaming, has easy syntax alternative to regexp " https://github.com/tpope/vim-abolish " vim-fugitive: " Provides git integration " https://github.com/tpope/vim-fugitive " vim-sleuth: " Detects the right whitespace useage based on file detection " https://github.com/tpope/vim-sleuth " vim-speeddating: " Make , work for dates " https://github.com/tpope/vim-speeddating' " vim-surround: " Modify the tags or brackets of code " https://github.com/tpope/vim-surround " vim-lawrencium: " Provides hg integration " https://github.com/ludovicchabant/vim-lawrencium " vim-ags: " Excellent ag integration " https;//github.com/gabesoft/vim-ags " ack.vim: " Same as ag.vim, though based on ack-grep a perl file " https://github.com/mileszs/ack.vim " FastFold: " Make folding much faster " https://github.com/zaiste/tmux.vim " Tabular: " Align text easily with regex patterns " https://github.com/godlygeek/tabular " vim-bookmarks: " Easier bookmarks, with or without annotation " verbose map m " https://github.com/MattesGroeger/vim-bookmarks " committia: " Display diff in the vim commit box " https://github.com/rhysd/committia.vim " DirDiff: " Diffs two dirs with vim: DirDiff dir1 dir2 " https://github.com/zhaocai/DirDiff.vim " CamelCaseMotion: " Defines ,w/,b/,e text objects for maipulating camelCase or snake_case " Example: v3i,w - visual select 3 subsections to w " https://github.com/bkad/CamelCaseMotion " argtextobj.vim: " Defines aa/ia text object for modifying functions " Example: cia - change first argument, leaves comma after " https://github.com/vim-scripts/argtextobj.vim " smartpairs.vim: " Easy visual selections, use vv to select on matching pair " https://github.com/gorkunov/smartpairs.vim " github-issues.vim: " Github integration inside commit windows " https://github.com/jaxbot/github-issues.vim " vim-fetch: " Do immediate line/col jumps to a file, i.e. :e file:20:44 " https://github.com/kopischke/vim-fetch " vim-matchit: " Extends the % command to jump to matching xml or if/fi tags " https://github.com/edsono/vim-matchit " A.vim: " Swap between a c source and header file with :A " https://github.com/vim-scripts/a.vim " DeleteTrailingWhitespace: " Use [Range]DeleteTrailingWhitespace, where range is an optional line range " https://github.com/vim-scripts/DeleteTrailingWhitespace " vim-localvimrc: " Allows project specific settings with .lvimrc files " https://github.com/embear/vim-localvimrc " vim-markdown: " Adds support for markdown syntax " https://github.com/plasticboy/vim-markdown/ " open-browser: " OpenBrowserSearch - Search for term in default browser " https://github.com/tyru/open-browser.vim " vim-togglelist: " Provides simple keystroke to toggle lists " https://github.com/kshenoy/vim-togglelist " tmux.vim: " Syntax highlighting for .tmux.conf files " https://github.com/zaiste/tmux.vim " vim-zsh: " Better syntax highlighting for zsh " https://github.com/clones/vim-zsh " python-syntax: " Much better syntax highlighting " https://github.com/hdima/python-syntax " csv.vim: " Whole suite to make editting csv easier " https://github.com/chrisbra/csv.vim " LaTeX-Box: " Better highlighting and functions for LaTeX " https://github.com/LaTeX-Box-Team/LaTeX-Box " hugefile: " For very large files, turn off some features " https://github.com/mhinz/vim-hugefile " Vader.vim: " Testing framework for vim, no dependencies " Execute .vader files with Vader file.vader " https://github.com/junegunn/vader.vim " vim-tasklist: " t -> quickfix with todos/fixmes " https://github.com/vim-scripts/tasklist.vim " vim-bracketed-paste: " No more paste toggle before pasting " https://github.com/ConradIrwin/vim-bracketed-paste " goyo.vim: " Distraction free writing/reading " https://github.com/junegunn/goyo.vim " vim-syntax-extra: " Extra syntax goodness for c, flex, bison " https://github.com/justinmk/vim-syntax-extra " vim-todo " Simple todo with highlighting " https://github.com/tomswartz07/vim-todo " }}} " Less Used Plugins """"""""""""""""""" " {{{ " Vundle: " Very good plugin manager, only supports git " Need to look into revision support, doesn't work at this time " https://github.com/gmarik/vundle " Pathogen: " A manual alternative to Vundle " https://github.com/tpope/vim-pathogen " vim-startify: " Nicer homepage with MRU files TODO " https://github.com/mhinz/vim-startify " vim-gutentags: " Ctags background generation & updating TODO " https://github.com/ludovicchabant/vim-gutentags " ag.vim (Silver Searcher): " Searches code quickly, faster than grep " https://github.com/rking/ag.vim " linux-coding-style: " C Files for kernel coding style " https://github.com/vivien/vim-addon-linux-coding-style " Cmd Alias: " Better command remapping instead of cabbr " http://www.vim.org/scripts/script.php?script_id=746 " https://github.com/vim-scripts/cmdalias.vim " CtrlP Switcher: " Finds files in the tree similar to current buffer " https://github.com/ivan-cukic/vim-ctrlp-switcher " SnipMate: " Allows you to expand boilerplate code " https://github.com/msanders/snipmate.vim " Usage: http://www.bestofvim.com/plugin/snipmate/ " Related: https://github.com/scrooloose/snipmate-snippets " EasyMotion " Provides alternative motion for word jumping " Use w to jump then select " https://github.com/Lokaltog/vim-easymotion " Golden View: " Based on golden ratio for windows " https://github.com/zhaocai/GoldenView.vim " Golden Ratio: " Plugin that resizes windows on focus gain " https://github.com/roman/golden-ratio " html5.vim: " Provides better highlighting for new html5 elements " https://github.com/Sothree/html5.vim " vim-css-color: " Provides highlighting of color codes like hex and regular words like red " https://github.com/ap/vim-css-color " vim-css3-syntax: " Provides better highlighting for css3 files " https://github.com/hail2u/vim-css3-syntax " vim-javascript: " Has some improvements to syntax and indents " https://github.com/pangloss/vim-javascript " jshint: " Provides javascript checking, requires node.js and other installation steps " https://github.com/Shutnik/jshint2.vim " jQuery: " Plugin provides better highlighting for jQuery " https://github.com/vim-scripts/jQuery " php.vim: " Improved php syntax files " https://github.com/elzr/vim-json " vim-ruby: " Provides better syntax, indent and config for ruby dev " https://github.com/vim-ruby/vim-ruby/wiki/VimRubySupport " }}} " Notes To Remember """"""""""""""""""" " {{{ " * To indent: " 5>>: Indent next 5 lines 1 tab " 5<<: De-Indent next 5 lines 1 tab " " * Use :help [option|key] to get info " For plugins: :help syntastic, :help YCM " " * To override language specific settings, see ~/.vim/ftplugin for lang files " " * With auto indent on, need to use: set paste|nopaste or to toggle " paste mode that will prevent the auto indenting/format " " * See scrolloff value for interesting effect on vim " Keeps certain amount of lines always below cursor when scrolling " " * See list for ability to see trailing whitespace " " * Omni complete within file: + p, + n for previous and following identifier " " * To see all errors list: " open -> :Errors " close -> :lclose " NB: Overrides location list when called " " * Code comment: " current line -> , c c " block comment (with visual) -> V (select) , c c " toggle comment for lines: , c i " " * Reindent a file: " Whole File: ,t " Some Lines: = " " * To see folded code: " za " " * To see conflicting maps: " :verbose map jd " " * To repeat last command (colon): `@:`, to repeat last register `@@` " " * To fix tabs, see `retab`. By default, %retab! " " * To paste yanked text in for Command, Ctrl + R then " (double quote) " " * With cursor over work, push K in nmormal mode, opens manpage " }}} " }}} " vim: set foldmethod=marker: