vim配置工具分享

非常好用的vim配置工具,大家可以体验一下:点击打开链接,在github上面,下面是链接网页的内容:

Maple's Vim config

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.

Most of the time we are writing code so we need:

Code Completions

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).

  • neocomplcache - Ultimate auto completion system for Vim.
  • snipMate - Plugin for using TextMate-style snippets in Vim.
  • supertab - Perform all your vim insert mode completions with Tab.
  • ZenCoding - High speed HTML and CSS coding.
  • delimitMate - Provides auto-balancing and some expansions for parens, quotes, etc.

Shortcuts

  • Tab -> Rotate across the completion list
  • Tab -> Expand snippets or jump to the next placeholder of snippet
  • Ctrl + j -> Call zen-coding expansion on html tags

Dependencies

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 

Tutorial

:help zencoding

Movie teaching zencoding.vim

Screenshots


不知怎么了,这里gif图片上传有问题,大家可以到我给的连接上去看
Sometimes we need to jump to previous positions to copy/paste or do some fixes:

Fast navigation

  • matchit - Extended % matching for HTML, LaTeX, and many other languages.
  • EasyMotion - Vim motions on speed!

Tutorial

:help easymotion

Shortcuts

  • % -> Jump between brackets and html/xml tags
  • <leader> + w -> Beginning of the word.
  • <leader> + f + {char} -> Find {char} to the right.
Doing fixes should be as fast as possible!

Fast editing

  • 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.

Tutorial

:help text-objexts :help surround :help tabular

Shortcuts

  • % -> Jump between brackets and html/xml tags
  • <leader> + c + <space> -> Toggle comment
  • F3 -> Toggle Gundo viewer
  • F4 -> Toggle Indent Guides

IDE features

  • 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.

Dependencie

yaourt -S ack ctags # ArchLinux sudo apt-get install ack-grep ctags # Ubuntu brew install ack ctags # OS X 

For syntax check tools:

LanguagesLint ToolsInstall guide
Cgccbuilt-in
CPPg++built-in
CoffeeScriptcoffeenpm install -g coffeelint
CSScsslintnpm install -g csslint
Erlangescriptbuilt-in
Gogobuilt-in
Hamlhamlbuilt-in
Haskellghc-modcabal install ghc-mod
HTMLtidybuilt-in
Javajavacbuilt-in
Javascriptjshintnpm install -g jshint
Jsonjsonlintnpm install -g jsonlint
Lesslesscbuilt-in
Lispclispbuilt-in
Lualuacbuilt-in
Perlperlbuilt-in
PHPphpbuilt-in
Puppetpuppetbuilt-in
Pythonpyflakessudo pip install pyflakes
Rubyrubybuilt-in
Scalascalabuilt-in
Sasssassbuilt-in
Scssscss/compassgem install compass
XMLxmllintbuilt-in
YAMLjs-yamlnpm install -g js-yaml

Shortcuts

  • F5 -> Toggle Nerd-Tree file viewer
  • F6 -> Toggle tagbar
  • Ctrl + p -> Toggle ctrlp
  • Alt + 1~9 -> Switch between multiple buffers
  • Ctrl + h/j/k/l -> Moving between spilt windows
  • :Ack or <leader> + a -> Toggle Ack searching

Screenshots



Other Utils

  • 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.

Shortcuts

  • F12 -> Toggle Mouse

Better syntax/indent for language enhancement

  • Server
    • php
    • go
    • rails
    • jinja
    • jade
    • Web
      • html5
      • haml
      • javascript
      • jquery
      • coffeescript
      • less
      • stylus
      • handlebar
      • Markup language
        • markdown
        • textile
        • FPs
          • racket
          • clojure
          • scale

          Themes

          • 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

          Additional functions

          1. File encoding auto detection
          2. Hightlight current line and column
          3. Automatically jump to the last edited location
          4. :w/:wq error correction
          5. Remove trailing white space(run :FixWhitespace in vim)
          6. Code folding is disabled, enable it as you wish
          7. w!! to write if you forget add sudo
          8. 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).

            Installation

            1. Backup your old vim configuration files:

              mv ~/.vim ~/.vim.orig
              mv ~/.vimrc ~/.vimrc.orig 
            2. Clone and install this repo:

              git clone git://github.com/humiaozuzu/dot-vimrc.git ~/.vim
              ln -s ~/.vim/vimrc ~/.vimrc 
            3. Setup Vundle:

              git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle 
            4. 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)

            How to manage this vimrc?

            All plugins are listed in file bundles.vim with detailed comments, just add plugins as you like.

            1. :BundleClean to clean up unused plugins
            2. :BundleInstall to install newly added plugins
            3. :BundleInstall! to upgrade all plugins

            Other configurations are also well organized in vimrc.

            Known issues

            • Compeletions are not well supported for statically typed languages(c/c++)
            • Snippets are not shown in completions popups
            • May has some conflicts with GVIM


            评论
            添加红包

            请填写红包祝福语或标题

            红包个数最小为10个

            红包金额最低5元

            当前余额3.43前往充值 >
            需支付:10.00
            成就一亿技术人!
            领取后你会自动成为博主和红包主的粉丝 规则
            hope_wisdom
            发出的红包
            实付
            使用余额支付
            点击重新获取
            扫码支付
            钱包余额 0

            抵扣说明:

            1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
            2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

            余额充值