Vim config based on bling.vim - "A highly tuned vim distribution that will blow your socks off!"
this is my personal vim distribution that i have tweaked over time and evolved from a simple vanilla vimrc configuration to a full-blown distribution that it is today.
while it is very easy to install this and get up and running on a brand new machine (a use case i have), i recommend that you do not install this unless you fully understand everything that's going on inside. scan it for tips and tricks, or fork and customize it for your needs.
- clone this repository into your
~/.vimdirectory git submodule init && git submodule updatemv ~/.vimrc ~/.vimrc.backup- create the following shim and save it as
~/.vimrc:
let g:dotvim_settings = {}
let g:dotvim_settings.version = 1
source ~/.vim/vimrc
- startup vim and neobundle will detect and ask you install any missing plugins. you can also manually initiate this with
:NeoBundleInstall - done!
the g:dotvim_settings.version is a simple version number which is manually edited. it is used to detect whether significant breaking changes have been introduced so that users of the distribution can be notified accordingly.
- since the distribution is just one file, customization is straightforward. any customizations can be added to the
g:dotvim_settingsvariable, which will be used whilst sourcing the distribution'svimrcfile. here is an example:
" this is the bare minimum
let g:dotvim_settings = {}
let g:dotvim_settings.version = 1
" here are some basic customizations, please refer to the top of the vimrc file for all possible options
let g:dotvim_settings.default_indent = 3
let g:dotvim_settings.max_column = 80
let g:dotvim_settings.colorscheme = 'my_awesome_colorscheme'
" by default, language specific plugins are not loaded. this can be changed with the following:
let g:dotvim_settings.plugin_groups_exclude = ['ruby','python']
" if there are groups you want always loaded, you can use this:
let g:dotvim_settings.plugin_groups_include = ['go']
" alternatively, you can set this variable to load exactly what you want
let g:dotvim_settings.plugin_groups = ['core','web']
" if there is a particular plugin you don't like, you can define this variable to disable them entirely
let g:dotvim_settings.disabled_plugins=['vim-foo','vim-bar']
" finally, load the distribution
source ~/.vim/vimrc
" anything defined here are simply overrides
set wildignore+=\*/node_modules/\*
set guifont=Wingdings:h10
this distribution will pick one of three combinations, in the following priority:
- neocomplete + neosnippet if you have
luaenabled. - youcompleteme + ultisnips if you have compiled YCM.
- neocomplcache + neosnippet if you only have vimscript available
this can be overridden with g:dotvim_settings.autocomplete_method
- if you have either ack or ag installed, they will be used for
grepprg - all temporary files are stored in
~/.vim/.cache, such as backup files and persistent undo
<C-h>move the cursor left<C-l>move the cursor rightjk,kjremapped for "smash escape"
<leader>fefformat entire file<leader>f$strip current line of trailing white space- window shortcuts
<leader>vvertical split<leader>shorizontal split<leader>vsavertically split all buffers<C-h><C-j><C-k><C-l>move to window in the direction of hkjl- window killer
Qremapped to close windows and delete the buffer (if it is the last buffer window)- searching
<leader>fwfind the word under cursor into the quickfix list<leader>fffind the last search into the quickfix list/replaced with/\vfor sane regex searching<cr>toggles hlsearch
<Down><Up>maps to:bprevand:bnextrespectively<Left><Right>maps to:tabprevand:tabnextrespectivelygpremapped to visually reselect the last pastegbfor quick going to buffer<leader>ltoggleslistandnolist- profiling shortcuts
<leader>DDstarts profiling all functions and files into a fileprofile.log<leader>DPpauses profiling<leader>DCcontinues profiling<leader>DQfinishes profiling and exits vim
<leader>ssort selection>and<automatically reselects the visual selection
- neobundle Vim plugin manager
- vimproc A dependency for plugins by Shougo (neobundle, unite, neocomplcache)
- airline Lean & mean status/tabline for vim that's light as air.
- surround makes for quick work of surrounds
- repeat repeat plugin commands
- dispatch asynchronous build and test dispatcher
- eunuch Vim sugar for the UNIX shell commands
-
- many additional bracket
[]maps <C-up>to move lines up<C-down>to move lines down
- many additional bracket
- vim-less less syntax support
- scss-syntax scss syntax support
- vim-css3-syntax css3 syntax support
- vim-css-color highlight colors in css files
- html5 html5 syntax support
- vim-stylus stylus syntax support
- vim-jade jade syntax support
- vim-mustache-handlebars mustache and handlebars syntax support
- MatchTag highlights the matching html tag on cursor position
- emmet
- makes for writing html/css extremely fast
- for supported most filetypes,
<tab>will be mapped to automatically expand the line (you can use<C-v><Tab>to insert a tab character if needed) - for other features, default plugin mappings are available, which means
<C-y>is the prefix, followed by a variety of options (see:help zencoding)
- tern_for_vim In JavaScript files, the package will hook into omni completion to handle autocompletion, and provide the following commands:
- TernDef: Jump to the definition of the thing under the cursor.
- TernDoc: Look up the documentation of something.
- TernType: Find the type of the thing under the cursor.
- TernRefs: Show all references to the variable or property under the cursor.
- TernRename: Rename the variable under the cursor.
- vim-javascript js syntax and indent support
- vim-jsbeautify allows to quickly format js, html and css files. fjs will call JsBeautify()
- typescript-vim typscript syntax support
- vim-coffee-script coffee-script syntax support
- vim-node.js ft detect plugin which detects node.js shebang
- vim-json JSON syntax support
- javascript-libraries-syntax syntax support for various JS libraries like jQuery, underscore, angularjs, requirejs, jasmine, etc
- vim-rails toolbox for Rails. See help.
- vim-bundler support for Bundler
- python-mode toolbox for Python. Includes pylint, rope, pydoc, pyflakes, pep8 and mccabe
- jedi-vim a vim binding to the autocompletion library Jedi
- vim-golang plugin bundle for Go
- gocode autocompletion for Go
- signify adds + and - to the signs column when changes are detected to source control files (supports git/hg/svn)
- fugitive git wrapper
<leader>gsstatus<leader>gddiff<leader>gccommit<leader>gbblame<leader>gllog<leader>gppush<leader>gwstage<leader>grrm- in addition to all the standard bindings when in the git status window, you can also use
Uto perform agit checkout --on the current file
- vim-lawrencium a mercurial wrapper for vim
- gitv
- nice log history viewer for git
<leader>gv
-
vim-snippets snippets for autocompletion
-
- amazingly fast fuzzy autocomplete engine combined with an excellent snippets library
- use
<C-n>and<C-p>to go back/forward between selections, and<tab>to expand snippets
-
- autocomplete/snippet support as a fallback choice when YCM and/or python is unavailable
<Tab>to select the next match, or expand if the keyword is a snippet- if you have lua installed, it will use neocomplete instead
- editorconfig-vim EditorConfig support
- vim-endwise wisely adds "end" in ruby, endfunction/endif/more in vim script, etc
- speeddating
Ctrl+AandCtrl+Xfor dates - vim-visualstar search your selection text in visual mode
- tcomment very versatile commenting plugin that can do motions
gccto toggle orgc{motion}
- vim-expand-region allows you to visually select increasingly larger regions of text using the same key combination.
- Use + to expand, _ to shrink.
- vim-multiple-cursors
- mapped to
<C-N>, this will select all matching words and lets you concurrently change all matches at the same time
- mapped to
- nrrwrgn
<leader>nrputs the current visual selection into a new scratch buffer, allowing you to perform global commands and merge changes to the original file automatically
- tabular easily aligns code
<leader>a&,<leader>a=,<leader>a:,<leader>a,,<leader>a|
- auto-pairs allows to insert and delete brackets, parens or quotes in pairs
- vim-sneak allows to move to any location specified by two characters.
- Works accross multiple lines, with operators (including repeat .)
- Move to the next or previous match via ; or , (or by pressing s again immediately)
- Move to the nth match by prefixing ; or , with a count
- ack
- undotree visualize the undo tree
<F5>to toggle
- EasyGrep makes search/replacing in your project a lot easier without relying on
findandsed- the loading time of this plugin is relatively heavy, so it is not loaded at startup. to load it on-demand, use
<leader>vo, which opens the options window. <leader>vvfind word under the cursor<leader>vVfind whole word under the cursor<leader>vrperform global search replace of word under cursor, with confirmation<leader>vRsame as vr, but matches whole word
- the loading time of this plugin is relatively heavy, so it is not loaded at startup. to load it on-demand, use
- ctrlp fuzzy file searching
<C-p>to bring up the search\tsearch the current buffer tags\Tsearch global tags\lsearch all lines of all buffers\bsearch open buffers\oparses the current file for functions with funky
- nerdtree file browser
<F2>toggle browser<F3>open tree to path of the current file
- tagbar file tag browser
<F9>toggle tagbar
- unite.vim this is an extremely powerful plugin that lets you build up lists from arbitrary sources
- mappings
<space><space>go to anything (files, buffers, MRU, bookmarks)<space>yselect from previous yanks<space>lselect line from current buffer<space>bselect from current buffers<space>oselect from outline of current file<space>squick switch buffer<space>/recursively search all files for matching text (usesagorackif found)
- unite-airline_themes
- unite-tag a plugin for selecting tags or files including tags
- unite-outline provides vims buffer with the outline view
- unite-help
- junkfile create a temporary file for testing etc
- vim-indent-guides vertical highlights for indents
- vim-textobj-user text object helper
- vim-textobj-indent text objects for indented blocks of lines
- vim-textobj-entire text objects for entire buffer
- vim-textobj-underscore
- provides two new text-objects which are triggered by a_ and i_ respectively
- ou can use them when you have to deal with the following type of words:
Foo_bar_baz
- Now, suppose you have to change bar to qux (* for cursor position). You can do the following:
- foo_bar_bar and type
ci_to get foo__bar. - Or you can type
da_to get foobar
- foo_bar_bar and type
- vim-tmux-navigator navigation between tmux panes and vim splits
- vim-vspec testing framework for vimscript
- vim-scriptease as tpope puts it - amalgamation of crap he uses for editing runtime files
- vim-markdown support for markdown
- vim-instant-markdown realtime markdown preview in browser
- xterm-color-table xterm colors in vim
- Provides command :XtermColorTable, as well as variants for different splits
- Xterm numbers on the left, equivalent RGB values on the right
- Press # to yank current color (shortcut for yiw)
- Press t to toggle RGB text visibility
- Press f to set RGB text to current color
- Buffer behavior similar to Scratch.vim
- vim_faq
- vimwiki Vimwiki is a personal wiki for Vim -- a number of linked text files that have their own syntax highlighting.
- With vimwiki you can:
- organize notes and ideas;
- manage todo-lists;
- write documentation.
- To do a quick start press ww (this is usually \ww) to go to your index wiki file. By default it is located in: ~/vimwiki/index.wiki
- With vimwiki you can:
- bufkill.vim Unload/delete/wipe a buffer, keep its window(s), display last accessed buffer(s)
<leader>bdor:BDwill kill a buffer without changing the window layout
- vim-startify a better start screen for vim
- syntastic syntax checking for variety of languages
- gist automatically get or push changes for gists with
:Gist - vimshell shell in vim
<leader>csplits a new window with an embedded shell
- GoldenView automatically resizes your active window
<C-L>automatically split to tiled windows<F8>/<S-F8switch current window with the main pane and toggle back<C-N>, <C-P>jump to next/previous window
- Rewrite settings
- Colorizer color hex codes and color names, replace vim-css3-color from web group?
- vim-jedi seems to conflict with python-mode, make sure it is true and disable on if needed. Also jedi-vim requires Jedi, which can be installed via pip install jedi or with git submodule update --init. Make sure this config installs it?
- Check out how multiple cursors work, get used to them
- Check out sneak, try it.
- Try out easygrep
- For instant markdown - [sudo] gem install pygments.rb [sudo] gem install redcarpet -v 2.3.0 [sudo] npm -g install instant-markdown-d If you're on Linux, the xdg-utils package needs to be installed
- Install xolox plugins - easytags and session
- Check for plugins in next section
- Get rid of plugins like the vimwiki, but first try it out, maybe it catches, also change the bloody font to something
- http://www.slant.co/topics/67/~what-are-the-best-programming-fonts add way to install Source Code Pro at least
- signature shows marks beside line numbers
- bufferline simple plugin which prints all your open buffers in the command bar
- delimitmate automagically adds closing quotes and braces
I wanted to give special thanks to all of the people who worked on the following projects, or people simply posted their vim distributions, because i learned a lot and took many ideas and incorporated them into my configuration.
- v1
- requires
g:dotvim_settings.versionto be defined - disable all langauge-specific plugins by default
- add support for
g:dotvim_settings.plugin_groups_include