Configure vim in 3R6Linux Alliance

Source: Internet
Author: User

It is particularly worth mentioning that the 3R6Linux alliance has many points worth learning. Here we will mainly introduce 3R6Linux Alliance, including 3R6Linux alliance. In fact, this combination is very practical and basically comes to the source insight realm without a mouse, the most important platform that can run 3R6Linux in text mode is the Fedora 8 3R6Linux Alliance Vim and Ctags. After F8 is installed, the system already has 3R6Linux Alliance Taglist and you need to download 3R6Linux alliance.

1. Download a zip file of Taglist, decompress it, and copy taglist. vim ~ /. Vim/plugin directory. 3R6Linux Alliance

2. Modify ~ /. Vim/plugin/taglist. vim 3R6Linux in if! Exists ('loaded _ taglist') is added to the 3R6Linux consortium let Tlist_Ctags_Cmd = "/usr/bin/ctags" 3R6Linux consortium.

Result: 3R6Linux Alliance

"Line continuation used herelet s: cpo_save = & cposet cpo & vimlet Tlist_Ctags_Cmd ="/usr/bin/ctags "if! Exists ('loaded _ taglist') "First time loading the taglist plugin" "To speed up the loading of Vim, the taglist plugin uses autoload" mechanic to load the taglist functions. "Only define the configuration variables, user commands and some" auto-commands and finish sourcing the file "The taglist plugin requires the built-in Vim system () function. if this "function is not available, then don't load th E plugin. if! Exists ('* system') echomsg 'taglist: Vim system () built-in function is not available. '. \ 'plugin is not loaded. 'Let loaded_taglist = 'no' let & cpo = s: cpo_savefinishendif

At this time, the Ctags and Taglist have been combined. 3R6Linux Alliance

3. Run ctags-R in the corresponding source code directory to generate the corresponding tags file 3R6Linux Alliance

4. Import the tags file during the vim runtime. Can be modified ~ /. Vimrc will automatically import this tags file 3R6Linux Alliance each time vim is started: set tags =/root/develop/honeyids/tags 3R6Linux alliance and set syntax highlighting 3R6Linux Union syntax enable 3R6Linux Union syntax on 3R6Linux Alliance

5. Run vim and use the TaglistToggle command to activate the Taglist. Use ctrl + 2 w to switch between the tags area on the left and the normal editing area. 3R6Linux Alliance

6. When using ctags, ctrl +] can view the function definition. Ctrl + o returns the source file.

Vim introduction ueYLinux Alliance VimVi Improved) is a text editor similar to vi, which adds many new features and functions based on Vi. With its powerful functions and customization capabilities, Vim has become one of the most important open-source editors in Linux/Unix environments, and another is Emacs. It is favored by many developers. The author uses the latest version 7.1.

Unlike most other editors, after entering Vim, the characters entered by default are not inserted into the edited file. Vim mode, which can be easily understood as "state") is very important. You need to know that Vim has the following modes:

1) normal) mode, the default editing mode. If no special instructions are added below, all the commands mentioned are directly entered in normal mode; you can use the Esc key on the keyboard to return to normal mode in any other mode.

2) command) mode, used to execute long and complex commands; in normal mode, enter ":" General command), "/" Forward search) or "?" To Enter this mode, Enter the Enter key for the command in command mode.

3) insert) mode, used when entering text; in normal mode, type "I" insert) or "a" append) to enter the insert mode. There are other commands, for example, "c" can also enter the insert mode, but these commands have other functions ).

4) visual) mode, used to select text blocks; you can enter "v" in Normal Mode in lower case) to select by character, input "V" in upper case) to select by row, or enter "Ctrl-V" to select by Square.

5) select mode: similar to the normal Windows Editor, select a text block. After selecting a text block in either visual or selection mode, you can use Ctrl-G to switch to another mode. This mode is rarely used in Linux and will not be described in this article.

U sets vim syntax highlighting and automatic indent ueYLinux Alliance

Ii. Set the vim configuration file.

1. Configuration File Location
Under the/etc/directory, there is a file named vimrc, which is a public vim configuration file in the system and is valid for all users. In each user's home directory, you can create a private configuration file named ". vimrc ". For example, A. vimrc file already exists in the/root directory.

2. Set syntax highlighting

1) Open vimrc and add the following statement to highlight the syntax: syntax on

2) If the syntax is still not highlighted, add the following statement to the profile file in the/etc directory: export TERM = xterm-color

3. set Windows C/C ++ auto indent and add the following set statement to vimrc)
1) set the tab width to 4: set tabstop = 4 set softtabstop = 4
2) set the number of spaces for indentation to 4 set shiftwidth = 4
3) set automatic indent: that is, the indent value of each line is equal to that of the previous line; Use noautoindent to cancel the setting: set autoindent
4) set the automatic indent mode in C/C ++ language: set cindent
5) set the specific indentation of C/C ++ language in my windows style as an example): set cinoptions = {s, t0, N-2, p2s, (03 s, =. 5 s,> 1 s, = 1 s,: 1 s
6) to display the line number of the text on the left, use the following statement: set nu
7) in the end, add the following statement if & term = "xterm" set t_Co = 8 set t_Sb = ^ [[4% dmset t_Sf = ^ [3% dmendif

Specific can refer to these two posts http://forum.ubuntu.org.cn/viewtopic.php? F = 68 & t = 138212 & sid = 5d9af5b7f78b62e6b5c05da3f553c0a7
Http://blog.csdn.net/easwy/category/234641.aspx

  1. The attitude of the Wind River system to the Linux platform has changed by 180 degrees.
  2. Linux management is replaced by RHEL server or FC Desktop
  3. The Linux technology platform must first sharpen the tool to do things well.
  4. Linux Chinese customized version installation simpler interface more beautiful and more convenient to use
  5. Linux has successfully fixed many bugs.

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.