I use vundle
to manage my plugins, which makes my .vim
directory clean and tidy. If you are new to vim, the following two posts
will be good for you.
Such as completions for variable names and function names(neocomplcache), expanding snippets(snipMate), auto closing brackets/brace/quote(delimitMate) and fast expand expressions to HTML(ZenCoding).
- snipMate - Plugin for using TextMate-style snippets in Vim.
- ZenCoding - High speed HTML and CSS coding.
- delimitMate - Provides auto-balancing and some expansions for parens, quotes, etc.
In Windows, I use these.
- neocomplcache - Ultimate auto completion system for Vim.
- supertab - Perform all your vim insert mode completions with Tab.
- OmniCppComplete - C/C++ omni-completion with ctags database.
In Unix or Mac, I use these.
- YouCompleteMe - A code-completion engine for Vim .
Tab
-> Rotate across the completion listTab
-> Expand snippets or jump to the next placeholder of snippetCtrl
+j
-> Call zen-coding expansion on html tags
Compile Vim with --enable-pythoninterp
and --enable-rubyinterp
to enable powerful syntax completion supplied by neocomplcache.
brew install macvim --override-system-vim # OS X
yaourt -S gvim # ArchLinux
sudo apt-get install vim-gtk # Ubuntu
:help zencoding
- matchit - Extended % matching for HTML, LaTeX, and many other languages.
- EasyMotion - Vim motions on speed!
:help easymotion
%
-> Jump between brackets and html/xml tags<leader>
+w
-> Beginning of the word.<leader>
+f
+{char}
-> Find {char} to the right.
- surround - Easily delete, change and add such surroundings in pairs.
- nerdcommenter - Easy commenting of code for many filetypes.
- Gundo - visualize your Vim undo tree.
- tabular - Vim script for text filtering and alignment.
- IndentGuides - A Vim plugin for visually displaying indent levels in code.
:help text-objexts
:help surround
:help tabular
%
-> Jump between brackets and html/xml tags<leader>
+c
+<space>
-> Toggle commentF3
-> Toggle Gundo viewerF4
-> Toggle Indent Guides
- nerdtree - A tree explorer plugin for navigating the filesystem.
- tabbar - Add tab bar and quickt tab switch with alt+1~9.
- tagbar - Displays the tags of the current file in a sidebar.
- ack-vim - Front for the Perl module App::Ack.
- ctrlp - Fuzzy file, buffer, mru and tag finder.
- powerline - The ultimate vim statusline utility.
- fugitive - a Git wrapper so awesome, it should be illegal.
- syntastic - Syntax checking hacks for vim.
yaourt -S ack ctags # ArchLinux
sudo apt-get install ack-grep ctags # Ubuntu
brew install ack ctags # OS X
For syntax check tools:
Languages | Lint Tools | Install guide |
---|---|---|
C | gcc | built-in |
CPP | g++ | built-in |
CoffeeScript | coffee | npm install -g coffeelint |
CSS | csslint | npm install -g csslint |
Erlang | escript | built-in |
Go | go | built-in |
Haml | haml | built-in |
Haskell | ghc-mod | cabal install ghc-mod |
HTML | tidy | built-in |
Java | javac | built-in |
Javascript | jshint | npm install -g jshint |
Json | jsonlint | npm install -g jsonlint |
Less | lessc | built-in |
Lisp | clisp | built-in |
Lua | luac | built-in |
Perl | perl | built-in |
PHP | php | built-in |
Puppet | puppet | built-in |
Python | pyflakes | sudo pip install pyflakes |
Ruby | ruby | built-in |
Scala | scala | built-in |
Sass | sass | built-in |
Scss | scss/compass | gem install compass |
XML | xmllint | built-in |
YAML | js-yaml | npm install -g js-yaml |
F5
-> Toggle Nerd-Tree file viewerF6
-> Toggle tagbarCtrl
+p
-> Toggle ctrlpAlt
+1~9
-> Switch between multiple buffersCtrl
+h/j/k/l
-> Moving between spilt windows:Ack
or<leader>
+a
-> Toggle Ack searching
- fcitx-status - automatic change status of fcitx in vim.
- togglemouse - Toggles the mouse focus between Vim and your terminal emulator, allowing terminal emulator mouse commands, like copy/paste.
F12
-> Toggle Mouse
- Server
- php
- go
- rails
- jinja
- jade
- Web
- html5
- haml
- javascript
- jquery
- coffeescript
- less
- stylus
- handlebar
- Markup language
- markdown
- textile
- FPs
- racket
- clojure
- scale
- blackboard - Textmate's Blackboard theme for vim (with iTerm2 theme)
- molokai - A port of the monokai scheme for TextMate
- solarized - precision colorscheme for the vim text editor
- vividchalk - colorscheme based on the Vibrant Ink theme for TextMate
- distinguished - A dark vim color scheme for 256-color terminals.
- tomorrow - Tomorrow Theme for Vim
- fisa - soft color scheme for terminals with 256 colors Clone in Mac
- File encoding auto detection
- Hightlight current line and column
- Automatically jump to the last edited location
:w
/:wq
error correction- Remove trailing white space(run
:FixWhitespace
in vim) - Code folding is disabled, enable it as you wish
w!!
to write if you forget add sudo- Indent style:
- JavaScript - Use soft-tabs with a two space indent(According to this Post).
- HTML/CSS - Use soft-tabs with a two space indent(According to Google and Github's HTML/CSS style guide, just Google it).
- PHP - Use soft-tabs with a two space indent(According to Apache PHP Style Guide).
- Python - Use soft-tabs with a four space indent(PEP8).
-
Backup your old vim configuration files:
mv ~/.vim ~/.vim.orig mv ~/.vimrc ~/.vimrc.orig
-
Clone and install this repo:
git clone git://github.com/neosfung/neo.vim.git ~/.vim ln -s ~/.vim/_vimrc ~/.vimrc
-
Setup
Vundle
:git clone git://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
-
Install bundles. Launch vim(ignore the errors and they will disappear after installing needed plugins)and run:
:BundleInstall
That's it!
You can select use YouCompleteMe for code-completion, And YCM requires Clang. For more information, visit YouCompleteMe.
-
Backup your old vim configuration files:
mv ~/.vim ~/.vim.orig mv ~/.vimrc ~/.vimrc.orig
-
Clone and install this repo:
git clone git://github.com/neosfung/neo.vim.git ~/.vim ln -s ~/.vim/_vimrc ~/.vimrc
-
Setup
Vundle
:git clone git://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
-
Modify the file ~/.vim/_vimrc
let g:install_ycm=1
-
Install bundles. Launch vim(ignore the errors and they will disappear after installing needed plugins)and run:
:BundleInstall
-
Go to ~/.vim/, and update or install the latest version of VIM
./install_vim.sh
-
Go to ~/.vim/, and install the Clang+LLVM.
./install_clang_llvm.sh
-
Compiling YCM with semantic support for C-family languages:
cd ~/.vim/bundle/YouCompleteMe ./install.sh --clang-completer
That's it!
Assuming your gVim installation' path is $VIM.
-
Backup your old vim configuration files:
- Rename the folder $VIM/vimfiles to $VIM/vimfiles.orig
- Rename the file $VIM/_vimrc to $VIM/_vimrc.orig
-
Clone and install this repo:
git clone git://github.com/neosfung/neo.vim.git $VIM/vimfiles
- Copy the file $VIM/vimfiles/_vimrc to $VIM/
-
Setup
Vundle
:git clone git://github.com/gmarik/vundle.git $VIM/vimfiles/bundle/vundle
-
Install bundles. Launch vim(ignore the errors and they will disappear after installing needed plugins)and run:
:BundleInstall
Thst's it!
All plugins are listed in file bundles.vim
with detailed comments, just add plugins as you like.
:BundleClean
to clean up unused plugins:BundleInstall
to install newly added plugins:BundleInstall!
to upgrade all plugins
Other configurations are also well organized in vimrc.
- Completions are not well supported for statically typed languages(c/c++)
- Snippets are not shown in completions popups
- May has some conflicts with GVIM