Dotvim
An attempt at The Ultimate Vim Configuration™ with focus on Rails development. DEPRECATED, SEE https://github.com/vitaly/dotvim2
Install / Use
/learn @astrails/DotvimREADME
Dotvim
NOTE: this project is no longer supported. The development moved to the Dotvim v2. Beta testers and contributions are welcome.
An attempt at The Ultimate Vim Configuration™ ;)
All the right plugins are in. Nerdtree, CtrlP, you name it.
The focus is on supporting Rails, but there is a lot of generic stuff too, so it will surely serve you well with any language of your choice.
The config is using NeoBundle for easy
upgrading. The list of installed bundles is in the bundles.vim
IMPORTANT:
- Vundle was replaced with Neobundle. See Neobundle upgrade instructions if you have an older Vundle based install.
- vim-powerline was replaced with vim-airline. Please see installation instructions
Some help tips are provided for some of the plugins. please check out the plugin's docs for more info.
Follow @vkushner and @astrails on Twitter to receive announcements of new versions, tips, etc.
<a name=top> #### Contents- Installation
- Neobundle upgrade
- General Configuration
- Local configuration
- Backups
- Persistent Undo
- Macros
- Interesting Plugins
- nerdtree
- nerdtree-tabs
- nerdcommenter
- Command-T
- CtrlP
- AutoComplPop
- taglist.vim
- YankRing.vim
- vim-fugitive
- syntastic
- snipmate
- vim-surround
- vim-align
- ack.vim
- vim-indentobject
- greplace.vim
- vim-airline
- splice.vim
- vim-endwise
- delimitMate
- Gundo
- vim-dispatch
- unite.vim
- vim-gitgutter
- vim-i18n
- switch
- emmet-vim
- editorconfig
- Ruby/Rails Support
- Org mode and support plugins
- Color themes
- Syntax plugins
- "Support" and "minor" plugins
- Misc Bindings
- Russian Translit Layout support
From your homedirectory (on Linux/Mac OSX):
-
git clone https://github.com/astrails/dotvim.git # or git@github.com:astrails/dotvim.git for ssh -
ln -sfn dotvim .vim -
ln -sfn dotvim/vimrc .vimrc -
cd .vim; make installNote: if you already have
~/.vim~/.vimrcREMOVE THEM (you might want to backup them first :) -
create
~/.vimrc.beforeor~/.vimrc.afterif you want to have some local/personal settings you don't want to commit into the repo. see "Local Configuration"
Dotvim was updated to use Neobundle instead of Vundle. NeoBundle is mostly similar but supports more ways to install bundles, better install, locked revisions and more.
To upgrade from an older Vundle based setup simply pull the latest version and
run make.
<a name=general> #### General configurationNote: if you modified your
bundles.vimyou will need to replace all instances ofBundlewithNeoBundlein it. Until you do your vim might print error messages during startup. ignore them and fix thebundles.vim, then runmake.
, is used as mapleader
backslash is used as localleader
,emapped to:e **/. essentially you do,efoo<tab>to get a list of all files starting with foo,s- toggle invisible characters display,n- nextquicklistresult (like :Ggrep etc),N- previousquicklistresult (like :Ggrep etc)Ctrl-E- switch between 2 last buffers (its just a:b#<cr>:)Ctrl-Nto cancel current search highlighing,fglobal Ggrep for word under the cursor or for selection+,-- easily inc/decrement integers,W- remove trailing spacesCtrl-h/j/k/l- simplified split panes navigation,d-:diffupdate,dp-:diffput,dg-:diffget%%- in control mode, i.e. after you typed:it will expand to the directory name of the currently opened file.
Check out the 'plugins.vim' and 'after/plugin/bindings.vim' files for more...
<a name=local> #### Local configurationFor easy upgrades its preferable not to change the dotvim configuration files. Instead you can add your own local configuration into one of the local override files. There are several override files supported by dotvim.
They are loaded in the following order:
-
base dotvim configuration (global, plugin configurations, bindings, macros)
-
~/.vimrc.bundlesLoads additional bundles inside the
neobundle#begin/endblock. Should contain lines likeNeoBundle 'my-custom/bundle' -
~/.local-before.vim[deprecated] -
~/.vimrc.beforeLoaded before the plugins
This is where you should pre-set various plugin flags, enable/disable options etc. This is for things you would normally put into your vimrc file.
-
~/.gvimrc.before[when GUI running] -
vim plugins
-
dotvim bindings and overrides (loaded from
~/.vim/after.vim) -
.local-after.vim[deprecated] -
.vimrc.afterLoaded after the plugins
This is where you can override settings set by plugins that have no customization options.
-
.gvimrc.after[when GUI running]
Backups and swapfiles are disabled. I really hate them both.
You can re-enable backups by adding the following to your ~/.local.vim:
set backup
and swapfiles by
set swapfile
backup dir is set to ~/.backup/
The directory is created if it doesn't exist.
<a name=undo> #### Persistent UndoPersistent undos are enabled by default.
You can disable by adding the following to your ~/.local.vim:
set noundo
<a name=macros>
#### Macros
I included a couple of macros that I frequently use in macros.vim which is loaded from after.vim:
@q(re)format paragraph forward@senclose selection with double *. e.g. **foo**.
You really should start writing your own macros. The life will never be the same ;).
I recommend editing your macros in a vim buffer.
To load a macro into a register you can 'yank' it.
For example if you have a line with a macro and cursor is at the beginning of
it "ay$ will load the macro into register a, so that you will be able to
execute it with @a.
-
<a name=nerdtree>nerdtree (top)
hax0r vim script to give you a tree explorer
Ctrl-P- open directory browser (Note: this is now handled by nerdtree-tabs (see below)),p- to find and highlight the currently open file in the tree
-
<a name=nerdtreetabs>nerdtree-tabs (top)
NERDTree and tabs together in Vim, painlessly
Ctrl-P- open directory browser
-
<a name=nerdcommenter>nerdcommenter (top)
Vim plugin for intensely orgasmic commenting
,/- toggle comment,cc- add commenting,cu- Uncomment- check docs for more
-
<a name=Command-T>Command-T (top)
TextMate Command-T like file finder for vim
Note: This plugin is currently DISABLED. See CtrlP plugin that is used instead
,,-CommandT- find file,.-CommandTFlush- refresh the file list and then find a file- while at the finder prompt:
Ctrl-Enter- open file in a new splitCtrl-s- open file in a new splitCtrl-v- open file in a new vertical splitCtrl-U- clear current partial pathEsc- cancelCtrl-c- cancel
-
Fuzzy file, buffer, mru, tag, etc finder.
This is the new fuzzy finder used by dotvim. It replaced Command-T that was used before.
The default mapping is still the same:
,,-CtrlP- fuzzy find.,.-CtrlPClearCachefollowed byCtrlP- clears the cache and searches the files (not including MRU and buffers),m-CtrlPBufTag- search tags in the current buffer- `,M
