Simply transform vim into an IDE

Source: Internet
Author: User

The company server vim with the abnormal pain, write a few small scripts and do not want to use the IDE, so the simple transformation of vim, after trying to find the company's machine is vim6x, many plug-ins do not support, so simply reload into 7.x

1. Install Vim

First to download the Vim installation package, and then unzip, execute the installation command, generally have

./Configure--prefix=/usr/local/ installation directory --enable-perlinterp perl integration --enable-  Pythoninter Ppython Integrated --enable-cscope csope support --enable-multibyte Double byte support, support Chinese to choose this --enable- Fontset                                             --with-features=huge Maximum characteristics

Then, complete the installation

Makemake Install

2. Customize the vim configuration for your individual

Not customized before using a global configuration, now customize its own vim configuration, mainly in the user directory. Vim directory and. VIMRC configuration file

Running in vim

Set Runtimepath?

View VIM's catalogue, which I show here as

runtimepath=~/.vim,/usr/share/vim/current/vimfiles,/usr/share/vim/current,/usr/share/vim/current/vimfiles/ After,~/.vim/after

The general global file is placed under/usr/share/vim/current/vimfiles and copies the contents below this folder to. Vim below

See if the python.vim below syntax is present, and then configure the syntax

3.Ctags and plugin tasklist The ability to implement project views in Vim with ctags and plug-in tasklist download Ctags, then install
TAR-XZVF ctags-5.6. TAR.GZCD ctags-5.6makemake Install   //Require root permission
execution Ctags-r can see if the installation and whether there are tags file generation, and then run a similar command in Vim, fill in the corresponding tags path to bind the corresponding tags, and then you can use functions such as jump function: 
  : Set Tags=/xx/xxx/xx

install targlist easier, extract it Out is a plugin directory, and then put it into the plugin directory, Last use command: Tlisttoggle open taglist window
CP Taglist.vim ~/.vim/plugin/
    4. Auto-complete Pydiction  pydiction is mainly used for code completion, press TAB can be automatically complete, but still feel weaker than the IDEDownload the installation package and include three files after decompression:

Python_pydiction.vim #vim插件

Complete-dict #python关键字和模块列表,

pydiction.py #python脚本, you can add more modules

Create a directory, and then move the corresponding file to the corresponding directory ·,

mkdir-  P  ~/.vim/after/ftplugin/pydiction
Copy the Python_pydiction.vim file to the VIM installation path  
Cp-p Python_pydiction.vim  ~/.vim/after/ftplugin/

Copy the Complete-dict and pydiction.py to the ~/.vim/after/ftplugin/pydiction directory. (These two files can be placed in any directory, corresponding to the pydiction_location variable)

Modify the ~/.VIMRC file, and if not, add the following two lines to the file:

 

filetype plugin onlet g:pydiction_location='~/.vim/after/ftplugin/pydiction/complete-dict  '

5. File Browser Nerdtree

old version Nerdtree:extract a plugin directory and put it in the plugin directory
CP Taglist.vim ~/.vim/plugin/

Run in vim: Nerdtreetoggle can open

 New Nerdtree
  1. Unzip the doc, Nerdtree_plugin, plugin three directories in the ZIP package into the $vim/vimfiles directory.
  2. Copy the files in the doc, plugin directory to the corresponding directory under ~/.vim/, Nerdtree_plugin copy to ~/.vim/plugin
  3. Add below the VIMRC
    " Nerdtree plugin   "  Right " " where NERD tree window is placed   on the screen "  "size of the NERD tree  

  6.VIMRC File transform several plugins into shortcuts open/close, tab and grammar routines optimized, mainly used to write Python scripts
"Set character setsSet Encoding=utf-8Set Fencs=utf-8, GBK"Set python formatSet filetype=Pythonau Bufnewfile,bufread*.py,*. pyw setf python"Detecting file Typesfiletype on"load file type plug-infiletype plugin on"loading related indentation files for a specific file typeLet g:pydiction_location='~/.vim/after/ftplugin/pydiction/complete-dict'Let g:pydiction_menu_height= 20filetype indent on"Set IndentSet Autoindent"Same Level indentSet Smartindent"Next Level indentSet Expandtabset tabstop=4Set Shiftwidth=4Set Softtabstop=4"Syntax Highlightingsyntax on set nu"Highlight matching parenthesesSet Showmatch"matches the time of the parentheses highlighting (in a very second)Set matchtime=5"Set CtagsLet Tlist_show_menu = 1"tlistupdate can update tagsMap <F2>:!ctags-r * <CR>"Create tagsMap <F3>: silent! Tlist<cr>"you can call out TagList by pressing F3 .Let tlist_ctags_cmd='Ctags' "because we put it in the environment variable, we can do it directly.Let tlist_ctags_cmd='/usr/local/bin/ctags'Let Tlist_use_right_window=0"let the window appear on the right, and 0 is displayed on the left .Let tlist_show_one_file=1"A list of functions that allow taglist to display multiple files at the same time, if you want only 1, set to 1Let tlist_file_fold_auto_close=1"non-current file, function list collapse hiddenLet Tlist_exit_onlywindow=1"automatically exits vim when TagList is the last split windowLet Tlist_process_file_always=0"have you been dealing with tags.1: handling; 0: not processing"Nerdtree PluginLet Nerdtreewinpos =" Right" "where NERD tree window is placed on the screen"Let nerdtreewinsize ="size of the NERD tree map<F4>:nerdtreemirror<cr>Map<F4>:nerdtreetoggle<cr>"Run PythonNmap <F5>:!python%

  

Simply transform vim into an IDE

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.