Vim Configuration under CentOS 6.5

Source: Internet
Author: User
Tags set background

1. Log in and go to your favorite user name to view its home directory

Command:

# su XXX

$ cd XXX

$ ls-a

2. View and create directories and files

    • First look at whether you have a. vimrc file under your home directory ~/, no input instructions $ touch. VIMRC New File
    • Create a new directory in the home directory. Vim, and enter the. Vim directory to create plugin, doc, syntax three directories

Command: $ mkdir. Vim

$ CD. Vim

$ mkdir Plugin doc syntax

3. Simply write to the. vimrc file and set the VIM display format

Input command: $ wget http://files.cnblogs.com/ma6174/vimrc.zip

$ unzip vimrc.zip-d ~/

Opening the. C or. cpp file again will be a lot different, for example: line number, highlighting ...

Here are some excerpts:

"Show related syntax onset cul" highlight cursor in row set Cucset Shortmess=ati "Do not show that aid to Ugandan children at startup set go=" Do not graphic button "color desert" Set Background theme color Ron "Set background theme" Color Torte "Set background theme
Set Cursorline "highlight when moving forward
Set Cursorcolumn "Highlight the forefront set Ruler" display ruler set showcmd "The input command is displayed, look at the set scrolloff=3" the cursor moves to the top and bottom of the buffer to maintain 3 lines distance set Statusli ne=%f%m%r%h%w\ [format=%{&ff}]\ [type=%y]\ [pos=%l,%v][%p%%]\%{strftime (\ "%d/%m/%y\-\%H:%M\")} "status line display content set laststatus=2 "Start Display status line (1), always show status line (2)" Set Foldenable "Allow collapse set nocompatible" Remove nasty about VI consistency mode, avoid some bugs and limitations of previous version "Auto indent set Autoindentset cindent "Tab key width set tabstop=4" Uniform indent to 4set softtabstop=4set shiftwidth=4 "Use space instead of tab set Expandtab" Use tab set Smarttab "Show line Numbers set number" history set history=1000 "search verbatim Fugauliang set Hlsearchset incsearch" Language settings set Langmenu=zh_ at the beginning of rows and segments CN. Utf-8set HELPLANG=CN "Always show status line set cmdheight=2" reconnaissance file type filetype on "load file type plug-in filetype plugin on" Loading the relevant indentation file for a specific file type filetype Indent on "Save global variable set viminfo+=!" word with the following symbol do not be wrapped split set iskeyword+=_,$,@,%,#,-"Replace tab with space Nmap TT:%s/\t//g<cr>" Auto-complete : Inoremap (() <esc>i:inoremap) <c-r>=closepair (') ') <cr>:inoremap {{<cr>}<esc>o: Inoremap} <c-r>=closepair ('} ') <cr>:inoremap [[]<esc> I:inoremap] <c-r>=closepair ('] ') <cr>:inoremap "" <esc>i:inoremap "<esc>ifunction! Closepair (char) if getline ('. ') [Col ('. ')-1] = = A:char return "\<right>" else return A:char Endifendfunctionfiletype plugin in Dent on "Open file type detection, add this sentence to use the smart complement set Completeopt=longest,menu

  

4. Download and install the TagList plugin

Click the download plugin: http://www.vim.org/scripts/script.php?script_id=273Download the newer version of the TagList compression package, after the decompression is complete, the extracted doc content into the ~/.vim/doc, the extracted plugin content copied to the ~/.vim/plugin. When you are finished, open the. VIMRC and add the following three instructions:
Let Tlist_show_one_file=1let tlist_exit_onlywindow=1let tlist_use_right_window=1

When you open a. C or. cpp file into Vim, enter the bottom row mode and enter the command "Tlist" to open (or close) the TagList window

5. File Browser and window Manager-plugin: WinmanagerClick Download Plugin: http://www.vim.org/scripts/script.php?script_id=95 recommended to download a newer version of the installation package, unzip. The extracted doc content to ~/.vim/doc, the extracted plugin under the contents of the copy to ~/.vim/plugin after the completion of the. VIMRC add the following two lines of instruction:
Let g:winmanagerwindowlayout= ' fileexplorer| TagList ' Nmap Wm:wmtoggle

Open a. C or. cpp file, type wm in the normal state:

6. Create source index--plugin: Ctags

Click the Download plugin: http://ctags.sourceforge.net

After downloading, unzip and install:

Command:

TAR-XZVF ctags-5.6.tar.gzcd ctags-5.6  ./configuremakesu rootmake Install   

After completion, you can set up the source index, enter the USR directory under the main directory and inject the command into the terminal: Ctags-r

Open a. vimrc file, and add the following command:


When you open a. C or. cpp file, the cursor selects the function name, directly type CTRL + W +] to jump to the definition of the library function, and then directly type CTRL + O to exit the call view

Vim configuration plug-in also use a lot, but also need to find more information to continue to configure, a lot of practice and familiar with the shortcut keys, good vim configuration and skilled application can make us more efficient ~

    

Vim Configuration under CentOS 6.5

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.