Vim settings in Ubuntu

Source: Internet
Author: User

 

 

1

Install vimlupa open-source community 0i; mendf

Sudo apt-Get install vim-full
P h'u-] + y ^ 151392



2

, Configuration file location


In the Directory


/Etc/Vim


Below, there is


Vimrc

File, which is public in the system
Vim
Configuration file, which is valid for all users.

3




Set syntax highlighting


1)


Open


Vimrc


To highlight the Syntax:

Syntax on

2)


If the syntax is still not highlighted


/Etc


Directory


Profile


Add the following statement to the file:

Export term = xterm-color



4




, Settings

Windows

Style

C/C ++

Auto indent (Add the following

Set

Statement

Vimrc

Medium)


1


)


Set the (soft) tab width


4


:

Set tabstop = 4


Set softtabstop = 4

2


)


Set the number of spaces for indentation.


4

Set shiftwidth = 4


3


)


Set automatic indent


: The indentation value of each line is equal to that of the previous line.



Noautoindent


Unset:

Set autoindent

4


)


Set


Use


C/C ++


Automatic language indentation:

Set cindent


5


) Settings


C/C ++


Specific language indentation


:

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


) Finally, if the following statements are not available, add them:

If & term = "xterm"

Set t_co = 8

Set t_sb = ^ [4% DM

Set t_sf = ^ [3% DM
Endif


 

The above content is found on the internet, but there are some inconsistencies with Ubuntu, for example, the original search said vimrc is under the/etc directory, however, in Ubuntu (at least in Ubuntu 9.04), it is in/etc/vim. So I changed it.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.