On VIM configuration under Linux

Source: Internet
Author: User
Tags set background

Vim is a text editor developed from VI. Code completion, compilation and error jumps and other convenient programming features are particularly rich, is widely used in programmers, and Emacs parallel to become UNIX-like system users favorite text editor. The first knowledge of Linux, for a lot of things are still learning. But as a novice familiar with the VS compiler environment, the face of the Linux interface only spit slot ... To search the internet for some of the vim configuration of the relevant documents, some of their own configuration, of course, can not help but comprehensive, and then continue to configure. The following will share their own configuration to everyone, hope can be helped by a little.

      centos only installs the vim-minimal-7.x by default. So whether the input VI or VIM to view the file, the syntax function is not enabled properly. It is therefore necessary to install the other two components with Yum: vim-common-7.x and vim-enhanced-7.x. We can use Yum to configure, as long as the virtual machine is guaranteed to be networked oh O (∩_∩) o~~

On the command line input:yum-y install vim-enhanced wait just fine ...

It is ready to be configured so that we can use it. Online have a lot of the configuration of Daniel paste out the document, and some reached the hundreds of line of many, Bo master think that actually do not need to configure all, just according to their own needs configuration can be, the following I will be the paste of their own configuration for your reference:

"winpos 5 5          "   Set window position    "set  lines=40 columns=155       Set window size    set nu                  Show Line numbers   set go=                 do not graphic buttons     color  asmanian2        Set Background theme   set guifont=courier_new:h10:cansi     "  Set font    " syntax on             "  Syntax highlighting    autocmd InsertLeave * se nocul  "   Highlight current line with light   autocmd InsertEnter * se cul       Highlight Current line     "set ruler           " with light   Show Ruler   set showcmd          "  Input command display, see clearly some    " set cmdheight=1      the height of the   command line (under the status line), set to 1   "set whichwrap+= <,>,h,l    "  Allow backspace and cursor keys to span line boundaries (not recommended)   " set scrolloff=3       "  Keep 3 lines of distance when cursor moves to top and bottom of buffer   set novisualbell    "   Do not blink (do not understand)   set statusline=%f%m%r%h%w\ [format=%{&ff}]\ [type=%y]\ [pos =%l,%v][%p%%]\ %{strftime (\ "%d/%m/%y\ -\ %h:%m\")}    "status line displays the content   set  laststatus=1       Start Display status line (1), always show status line (2)   set foldenable          Allow folding   set foldmethod=manual      manual Folding     "set background=dark " background using black  set nocompatible   "remove nasty about VI consistency mode To avoid some bugs and limitations of previous versions &NBSP;&NBsp;  "  Show Chinese help IF&NBSP;VERSION&NBSP;&GT;=&NBSP;603&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;SET&NBSP;HELPLANG=CN      set encoding=utf-8 endif "  Set color scheme  " colorscheme murphy   Font    if  (Has ("gui_running"))    "   set guifont=bitstream\  Vera\ Sans\ Mono\ 10   "endif

Of course, there are many online, Bo master only paste out a little oh ... We can explore it again. The above documents can be pasted into the/ETC/VIMRC under the root user.

In addition to the configuration of vim, we also perform ctags and taglist installations. Ctags and taglist Two types can be downloaded directly from the Linux browser to install the package. In addition to installing these two, you also need to download two plugins, which is the Bufexplorer plug-in and the Winmanager plugin. After downloading the installation package, all you have to do is unzip.

The extracted commands are:

Tar zxvf ctags-5.8.tar.gz cd ctags-5.8./configure make do Install

All the compressed packages can be decompressed by these commands. It can be configured after the decompression.

The first thing to do is to after decompression taglist, bufexplorer, winmanager in doc and plugin files copied to/usr/ Share/vim/vim74 Doc and plugin ( Remember that the root user is under ).

After that we can also configure TagList and Ctags. In the same way, paste the command into the/ETC/VIMRC under the root user.

Here are some of my own configuration commands for your reference:

"Default open taglist let tlist_auto_open=1 " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""   (ctags)   "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" ""  let Tlist_Show_One_File = 1  "does not display multiple tags at the same time, only shows the  let tlist_exit_ of the current file onlywindow = 1  "If the TagList window is the last window, exit vim let tlist_use_right_window = 1   "Show TagList window in the right window" general settings for &NBSP;MINIBUFEXPL plug-ins let g:minibufexplmapwindownavvim = 1let g : minibufexplmapwindownavarrows = 1let g:minibufexplmapctabswitchbufs = 1let g: Minibufexplmodseltarget =1 " ctags Settings   " "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" let tlist_sort_type =  ""     Sort by name   let Tlist_Use_Right_Window = 1     Show Windows on the right    let tlist_compart_format = 1     "  Compression mode   let tlist_exist_onlywindow = 1    "  If only one Buffer,kill window is killed buffer  let tlist_file_fold_auto_close =  0   "  Do not close the tags  let tlist_enable_fold_column = 0    of other files     Do not show collapsed trees   autocmd FileType java set tags+=D:\tools\java\tags    "autocmd filetype h,cpp,cc,c set tags+=d:\tools\cpp\tags  " Let Tlist_ show_one_file=1             "does not display the tag of multiple files at the same time, only displays the current file's "Set tags  set tags=tags  " Set autochdir

Well, with all the work done, how do you use these tools?

First-> uses Vim's three important commands for editing: Press I on the keyboard to enter the insertion mode;

Press ESC to exit the insert mode;

Press: Wq to save and exit after editing.

secode-> Press: Tlist bring up TagList window

Press: Wmtoggle Bring up Winmanager window

Next, you can see the following interface. You can do it by yourself oh ...


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/82/3B/wKioL1dO1JXyqC_qAAEhcxNAzBI886.png "title=" capture. PNG "alt=" Wkiol1do1jxyqc_qaaehcxnazbi886.png "/>




This article is from the "July boreas" blog, please be sure to keep this source http://luminous.blog.51cto.com/10797288/1785299

On VIM configuration under Linux

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.