Vim configure the python Development Environment taglist + pydiction + highlight + python_fold + nerd_tree + AutoComplete

Source: Internet
Author: User


Vim configure the python Development Environment taglist + pydiction + hightlight + python_fold + nerd_tree + .....

Luo Weifeng 2011-7-16

1. Complete installationVim

# Apt-Get install vim-gnome

2. InstallationCtags

# Apt-Get install ctags

3. InstallTaglist

# Apt-Get install vim-Scripts

# Apt-Get install vim-addon-Manager

# Vim-Addons install taglist

4. Install the latest version of pydiction # wget http://www.pythonclub.org/_media/python-basic/pydiction-1.2.zip # unzip pydiction-1.2.zip # cp pydiction-1.2/python_pydiction.vim
~ /. Vim/after/ftplugin # cp
Pydiction-1.2/complete-dict ~ /. Vim/tools/pydiction/complete-dict5. Edit the configuration file # Vim ~ /. Vimrc
let Tlist_Auto_Highlight_Tag=1let Tlist_Auto_Open=1let Tlist_Auto_Update=1let Tlist_Display_Tag_Scope=1let Tlist_Exit_OnlyWindow=1let Tlist_Enable_Dold_Column=1let Tlist_File_Fold_Auto_Close=1let Tlist_Show_One_File=1let Tlist_Use_Right_Window=1let Tlist_Use_SingleClick=1nnoremap <silent> <F8> :TlistToggle<CR>filetype plugin onautocmd FileType python set omnifunc=pythoncomplete#Completeautocmd FileType javascrīpt set omnifunc=javascriptcomplete#CompleteJSautocmd FileType html set omnifunc=htmlcomplete#CompleteTagsautocmd FileType css set omnifunc=csscomplete#CompleteCSSautocmd FileType xml set omnifunc=xmlcomplete#CompleteTagsautocmd FileType php set omnifunc=phpcomplete#CompletePHPautocmd FileType c set omnifunc=ccomplete#Completelet g:pydiction_location='~/.vim/tools/pydiction/complete-dict'set tabstop=4set shiftwidth=4set expandtabset number

6. Enjoy it.
Use F8 to open or close the taglist window. C-W switches between taglist and code. Example: define several functions in the code window. Use: W to save. Use C-W to switch to the taglist window and enter U to update the taglist. Use the j k or up down key to locate a specific tag, use t to locate the tag defined in the Code, switch the cursor to this location, and use P to locate the tag defined in the Code, the cursor is not switched back.
Use tab to complete standard libraries, functions, or keywords, use C-N to complete custom variables, etc. The tab is replaced with four spaces.
There is a picture with the truth:

Additional: highlight
Http://www.vim.org/scripts/script.php? Script_id = 1599 Line Mode
<C-h> highlight current line
<C-h> <c-A> advance color for next line highlight
<C-h> <c-r> clear last line highlight

Pattern Mode
<C-h> <c-W> highlight word under cursor (whole word match)
<C-h> <c-l> highlight all lines having word under cursor (whole word match)
<C-h> <c-F> highlight word under cursor (partial word match)
<C-h> <c-k> highlight all lines having word under cursor (partial word match)
<C-h> <c-S> highlight last search pattern
<C-h> <c-j> highlight all lines having last search pattern
<C-h> <c-d> clear last pattern highlight

<C-h> <c-N> clear all highlights

All above commands work in both normal & Insert modes.
<C-h> also works in visual mode. (select desired lines & hit <c-h>)


Python_fold Auto collapse

Http://vim.sourceforge.net/scripts/script.php? Script_id = 1, 515

Zo Expansion

ZC collapse
Expand Zn all
Fold all Zn

Nerd_tree directory tree (strongly recommended)

The installation method is as follows:
1. Download the plug-in file

Http://www.vim.org/scripts/script.php? Script_id = 1, 1658

Decompress the file ~ /. Vim/directory. If the directory does not exist, create it by yourself.

2. Add a configuration file
In ~ Add the following configurations to the/. vimrc or/etc/Vim/vimrc file:
""""""""""""""""""""""""""""""
"F7 nerdtree
""""""""""""""""""""""""""""""
Map <F7>: nerdtreetoggle <CR>
Imap <F7> <ESC>: nerdtreetoggle <CR>

Press F7 in VIM to open and close the directory tree. For specific operation commands, see the Help file under the plug-in doc directory.

Auto complete is domineering

Http://www.vim.org/scripts/script.php? Script_id = 1, 1879

Minibuffer

Http://www.vim.org/scripts/script.php? Script_id = 1, 159

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.