非常好用的vim配置工具,大家可以体验一下:点击打开链接,在github上面,下面是链接网页的内容:
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).
Tab
-> Rotate across the completion listTab
-> Expand snippets or jump to the next placeholder of snippetCtrl
+ j
-> Call zen-coding expansion on html tagsCompile 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
Movie teaching zencoding.vim
:help easymotion
%
-> Jump between brackets and html/xml tags<leader>
+ w
-> Beginning of the word.<leader>
+ f
+ {char}
-> Find {char} to the right.:help text-objexts :help surround :help tabular
%
-> Jump between brackets and html/xml tags<leader>
+ c
+ <space>
-> Toggle commentF3
-> Toggle Gundo viewerF4
-> Toggle Indent Guidesyaourt -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 searchingF12
-> Toggle Mouse:w
/:wq
error correction:FixWhitespace
in vim)w!!
to write if you forget add sudoBackup your old vim configuration files:
mv ~/.vim ~/.vim.orig
mv ~/.vimrc ~/.vimrc.orig
Clone and install this repo:
git clone git://github.com/humiaozuzu/dot-vimrc.git ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
Setup Vundle
:
git clone https://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
Thst's it!
For installation on Windows, please refer to this post: http://yoxyue.com/2012/10/17/gVIM-on-win7/ (Thanks to yoxyue)
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 pluginsOther configurations are also well organized in vimrc.