Let vim better use for Mac OS X

Source: Internet
Author: User
Tags autoload git clone
Http://hessian.cn/p/1026.html

Reference article: Who says VIM is not the IDE. (i) Who says VIM is not the IDE. (b) Who says VIM is not the IDE. Three

In fact @ Chi Jianqiang in his "who said Vim is not the IDE." has already been made clear in the words. This blog post is equivalent to a note and a memo, and you can quickly configure a good vim environment when you need it later.

First two Zhang the master's own configuration screenshot


Basic VIM Settings

SYN on "syntax support
set laststatus=2" always displays the status bar
set tabstop=2 "a tab length
set softtabstop=2" a tab length (can be greater than tabstop)
set shiftwidth=2 "an indented length
set Expandtab" uses spaces instead of tab
set smarttab "Smart tab
set Autoindent" Automatically indent
set Smartindent set
ruler show position indicator
set BACKUPDIR=/TMP sets the backup file directory set
directory=/"only indent set number". TMP "Set temporary file directory set
ignorecase" Retrieval ignores case
set HLS "highlight matches on retrieve set
HELPLANG=CN" Help system set to Chinese
set Foldmethod=syntax "Code Folding

Common key binding Settings

My settings are basically based on my previous in the NetBeans key set, most of the shortcut keys are invoked plug-ins function, so before you need to use the following plug-ins need to install the only line.

"Switch file browser
map <D-1>: Nerdtreetoggle <CR>
" Locate current file in file browser
map <D-!>: Nerdtreefind <CR > Close File
browser while closing files let
nerdtreequitonopen = 1

"Open file positioning window
nnoremap <slient> <D-R>: Commandt<cr>
Open recently opened file list
nnoremap <slient> <D-E>:commandtbuffer<cr>

plugins Manager: Pathogen

Project Address:

Https://github.com/tpope/vim-pathogen

Installation method: Create the AutoLoad and bundle directories under the. Vim folder to obtain the Pathogen.vim file from the download address, and copy it to the AutoLoad directory to add the following code to the. vimrc file:

Call Pathogen#infect ()

file Browser: Nerdtree

Project Address:

Https://github.com/scrooloose/nerdtree

Installation method: Enter the. Vim/bundle directory to perform git clone git://github.com/scrooloose/nerdtree.git download is complete, a Nerdtree folder will be added under bundle All related plug-ins run in Vim under this folder: Helptags to generate Nerdtree's online Help tags quick location file: command-t

Project Address:

Https://wincent.com/products/command-t

Installation method: Download the latest version of the VBA file from the download address, the current version is 1.4, so the installation file is command-t-1.4.vba in the ~/.vim/bundle directory to create a folder Command-t Use VIM to open command-t-1.4.vba execution: Usevimball ~/.vim/bundle/command-t into ruby directory to compile C extensions

CD ~/.vim/bundle/command-t/ruby/command-t
 Ruby extconf.rb
 make

status bar beautification: Powerline

Project Address:

Https://github.com/Lokaltog/vim-powerline

Installation method: Enter the. Vim/bundle directory execute git clone git://github.com/lokaltog/vim-powerline.git set the status bar theme in. vimrc

"Powerline{
 set guifont=powerlinesymbols\ for\ powerline
 set nocompatible
 set t_co=256 let
 g: Powerline_symbols = ' Fancy '
 }

Note: Use powerline to set the delimiter in the set laststatus=2 powerline in VIMRC is actually a special font, if the error is displayed please download the modified font: https://gist.github.com/1595572

Code navigation: TagList

Project Address:

http://vim.sourceforge.net/scripts/script.php?script_id=273

Installation method: Enter the. vim/bundle Directory download compression package wget http://vim.sourceforge.net/scripts/download_script.php?src_id=7701 decompression Compression Package unzip Taglist_45.zip MV taglist_45 TagList running in vim: helptags to generate online Help tags

Related settings:

"TagList let
 Tlist_use_right_window = 1 let
 Tlist_exit_onlywindow = 1 let
 tlist_show_one_file = 1
 " Sort Type ' name ' or ' order ' let
 tlist_sort_type = ' name ' let
 tlist_compact_format = 1 let
 g:tlist_php_settings = ' Php;c:class;f:function '
 map <D-7>: Tlisttoggle <CR>

Automatic code completion: Neocomplcache

"Enable Omni completion.
" Autocmd FileType css setlocal omnifunc=csscomplete#completecss autocmd FileType html,markdown setlocal omnifunc=
Htmlcomplete#completetags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#completejs
Autocmd FileType python setlocal omnifunc=pythoncomplete#complete
autocmd FileType XML setlocal Xmlcomplete#completetags
autocmd FileType php setlocal omnifunc=xmlcomplete#completephp

read:3654 This entry is posted in Mac on 2012/11/08. 4 reviews

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.