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.
- clone this repository into your
~/.vim
directory git submodule init && git submodule update
mv ~/.vimrc ~/.vimrc.backup
echo "source ~/.vim/vimrc" > ~/.vimrc
- startup vim and neobundle will detect and ask you install any missing plugins. you can also manually initiate this with
:NeoBundleInstall
- done!
- since the distribution is just one file, customization is straightforward. simply add settings before or after sourcing the distribution to customize. for example:
let g:dotvim_settings = {}
let g:dotvim_settings.default_indent = 3
let g:dotvim_settings.max_column = 80
" this will overwrite the plugin_groups defined in the distribution
let g:dotvim_settings.plugin_groups = ['core','web']
" alternatively, you can specify excludes
let g:dotvim_settings.plugin_groups_exclude = ['ruby','python']
source ~/.vim/vimrc
" anything defined here simply overwrites
set wildignore+=\*/node_modules/\*
colorscheme my_awesome_colorscheme
- the
g:dotvim_settings
is a dictionary that contains overrides for all possible settings. refer to the top of thevimrc
file directly to determine what options are available.
this distribution will pick one of three combinations, in the following priority:
- neocomplete + neosnippet if you have
lua
enabled and a new enough version of vim - youcompleteme + ultisnips if you have
python
enabled and a new enough version of vim - 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 right
<leader>fef
format entire file<leader>f$
strip current line of trailing white space- window shortcuts
<leader>v
vertical split<leader>s
horizontal split<leader>vsa
vertically split all buffers<C-h>
<C-j>
<C-k>
<C-l>
move to window in the direction of hkjl- window killer
Q
remapped to close windows and delete the buffer (if it is the last buffer window)- searching
<leader>fw
find the word under cursor into the quickfix list<leader>ff
find the last search into the quickfix list/
replaced with/\v
for sane regex searching<cr>
toggles hlsearch
<Down>
<Up>
maps to:bprev
and:bnext
respectively<Left>
<Right>
maps to:tabprev
and:tabnext
respectivelygp
remapped to visually reselect the last pastegb
for quick going to buffer<leader>l
toggleslist
andnolist
- profiling shortcuts
<leader>DD
starts profiling all functions and files into a fileprofile.log
<leader>DP
pauses profiling<leader>DC
continues profiling<leader>DQ
finishes profiling and exits vim
<leader>s
sort selection>
and<
automatically reselects the visual selection
- 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>y
select from previous yanks<space>l
select line from current buffer<space>b
select from current buffers<space>o
select from outline of current file<space>s
quick switch buffer<space>/
recursively search all files for matching text (usesag
orack
if found)
<leader>bd
or:BD
will kill a buffer without changing the window layout
- easily jumps to any character on the screen
<leader><leader>w
or<leader><leader>e
will do the trick, along with any of the other default bindings that plugin has mapped under<leader><leader>
- this is a forked version of lokaltog's version which uses vimperator style double keystrokes
- makes search/replacing in your project a lot easier without relying on
find
andsed
- 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>vv
find word under the cursor<leader>vV
find whole word under the cursor<leader>vr
perform global search replace of word under cursor, with confirmation<leader>vR
same as vr, but matches whole word
- git wrapper
<leader>gs
status<leader>gd
diff<leader>gc
commit<leader>gb
blame<leader>gl
log<leader>gp
push<leader>gw
stage<leader>gr
rm- in addition to all the standard bindings when in the git status window, you can also use
U
to perform agit checkout --
on the current file
- many additional bracket
[]
maps <C-up>
to move lines up<C-down>
to move lines down
- file browser
<F2>
toggle browser<F3>
open tree to path of the current file
- very versatile commenting plugin that can do motions
gcc
to toggle orgc{motion}
- fuzzy file searching
<C-p>
to bring up the search\t
search the current buffer tags\T
search global tags\l
search all lines of all buffers\b
search open buffers\o
parses the current file for functions with funky
<leader>nr
puts the current visual selection into a new scratch buffer, allowing you to perform global commands and merge changes to the original file automatically
- easily aligns code
<leader>a&
,<leader>a=
,<leader>a:
,<leader>a,
,<leader>a|
- a plugin which automatically resizes all your splits to give the current one the optimal amount of viewing real estate
- this plugin will interfere with other plugins which rely on windows, so it is disabled by default and can be toggled on/off with
<F4>
- automatically get or push changes for gists with
:Gist
- 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
)
- visualize the undo tree
<F5>
to toggle
- 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
<leader>c
splits a new window with an embedded shell
- mapped to
<C-N>
, this will select all matching words and lets you concurrently change all matches at the same time
- surround makes for quick work of surrounds
- repeat repeat plugin commands
- speeddating
Ctrl+A
andCtrl+X
for dates - gist awesome plugin for your gist needs
- signature shows marks beside line numbers
- matchit makes your
%
more awesome - syntastic awesome syntax checking for a variety of languages
- bufferline simple plugin which prints all your open buffers in the command bar
- indent-guides vertical lines
- signify adds + and - to the signs column when changes are detected to source control files (supports git/hg/svn)
- delimitmate automagically adds closing quotes and braces
- startify gives you a better start screen
- i think i've listed about half of the plugins contained in this distribution, so please have a look at the vimrc directly to see all plugins in use
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.