This is my setup I've been using for the last 6 month or so. This configuration wasn't meant to be used on remote hosts where you edit your configs over ssh, because nobody does it. Likely, this config can be used for day-to-day development if you are brave enough to use someone's config on your Vim (I am not). However, it can act as a good learning material to someone.
- Syntax highlighting for common things in webdev
- Unite.vim with awesome fuzzy search features
<C-N>to open a file in the current directory<leader><C-N>to open a file in some subdirectory recursively using an external program for speed. (usesfindby default, installagfor speed, will be used if available).<C-P>to open a buffer<leader>Dto change the current directory:VimShellto open a shell written in vimscript. It is not the best shell ever but is good enough to run tests quickly- You will probably need to change the default vim command from
mvimto what you want (gvimorvim)
- You will probably need to change the default vim command from
<leader>pto paste a segment from yank history<leader>jto open a list of other menu items (editable in vimrc)
- Gundo.vim to jump between file's edit versions
- Surround.vim - to surround text with tags, brackets, parentheses or quotes
- Fugitive.vim - git wrapper
- Tern.js plugin with Meteor support - like IntelliSense for JavaScript
Weird visual things you might want to change
- vim-airline - status bar
- needs a customized font for MacVim (XXX add this to install script)
- Tomorrow Night Theme - specifically, a fork extended for JS
- vim-signature - to visually see marks
- new splits are added on the bottom, not on the top;
- new visual splits appear on the right, not on the left.
Weird bindings you might want to change
<leader>is mapped to comma,<C-hjkl>mapped to movement between splits<leader>/to kill current search<leader>sto enable/disable the spellchecker<leader>lto highlight non-printing characters<leader>mand<leader>nto switch between tabs<leader>wsaves the file (maps to:w<enter>)<leader>jto open a list of menu items;in the normal mode enters the command mode (just like:). The original action of;(repeat the lastt) is not preserved.- quick
jkin insert mode is mapped toESCto avoid pressingESC
I will be honest, the following things suck and I didn't fix them yet:
- formatting is broken for a lot of things
- plugins are written in JavaScript, Python and VimScript - 3 different languages
- everything is
<C-n>and<C-p>centric. Because I mapped them to my thumb on Kinesis doesn't mean it is great for everyone
- Fixed identation for JS, Handlebars and CSS
- no dependency on fonts
- install script should take into consideration the existing
.vimrcand.vimfolders not to override someone's setup accidentally
Latest MacVim works well as of 7.4 patch around August 2013
- Vim built with
+pythonforternjsandgundo - Vim built with
+luaforneocomplete.vim - npm and node.js for
ternjs - C compiler for
unite.vim makeforvimprocgitto fetch dependencies (this sucks, I know)ag(optional) for the speedy subdirectory search (see the repo)
First of all be sure to have a compatible version of Vim. The easiest way to
install a full-featured Vim on Mac OS X with homebrew is to run
brew install macvim -v --override-system-vim --with-lua --with-luajit in your
terminal. (Instructions for other platforms satisfying the
dependencies are welcome)
After you can run the bash script from this repo which will take care of
everything but will do something terrible if you already have any of .vim or
.vimrc. But it works great on a clean set up:
$ curl https://raw.github.com/Slava/vimrc/master/install-script.sh > install-script.sh
$ bash ./install-script.sh
Download .vimrc file.
$ curl https://raw.github.com/Slava/vimrc/master/.vimrc > ~/.vimrc
Install neobundle
$ mkdir -p ~/.vim/bundle
$ git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
Open vim, install all the packages, quit vim:
$ vim -c "NeoBundleInstall" -c "q"
Finish installation by installing tern-meteor:
$ cd ~/.vim/bundle/tern_for_vim/
$ npm install
$ curl https://raw.github.com/Slava/tern-meteor/master/meteor.js > node_modules/tern/plugin/meteor.js