Vim sets the tab width

Source: Internet
Author: User

Http://blog.chinaunix.net/uid-346158-id-2131115.html

In the work, it is suspected that the width of a tab in VIM is too large. In the Debian system, the width is 8 characters before it is changed. to change it to 4, see the following:

Cd ~

Vim. vimrc

Add the following lines: (no in the brackets, I added them)

Set shiftwidth = 4 (length of each level of indentation)

Set softtabstop = 4 (indicates that the length of the indent is returned when you press the return key in editing mode)

Set nu (display row number) set autoindent (Auto indent)
: WQ
Save and exit.
Source. vimrc (make the configuration file take effect)

Close the job.
==================
When securecrt Vim is edited today, it is uncomfortable to find that the line breaks automatically when one line reaches 72 characters.

: Set textwidth = 200 or:
: Set Tw = 200

Edit the file.

Vim garbled solution:

Add the following to vimrc (/etc/Vim/vimrc:

Let
& Amp; termencoding = & amp; Encoding
Set
Fileencodings = UTF-8, GBK, ucs-bom, cp936

Vim indent:

Vim sets automatic indent:

Set
Autoindent

Set
Cindent

Vim Tab key width

Set
Tabstop = 4

Set to indent to 4

Set
Softtabstop = 4

Set
Shiftwidth = 4

Do not replace spaces with space keys

Set
Noexpandtab

Show row number:

Set
Number

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.