"Linux" vim modifier tab is 4 spaces

Source: Internet
Author: User
Tags modifier

Modify Configuration

If you want to modify the configuration of the global vim

vim /etc/vim/vimrc
    • 1

However, this is not recommended and can only be modified by the current user's vim configuration

vim ~/.vimrc
    • 1

Add the following parameters to the configuration file

    1. First configuration parameter

      set ts=4set sw=4
      • 1
      • 2
    2. Second configuration parameter

      set ts=4set expandtabset autoindent
      • 1
      • 2
      • 3

The second type is recommended, with compatibility

Modify a saved File tab to replace with a space
:set ts=4:set expandtab:%retab!
    • 1
    • 2
    • 3
Space is replaced by tab
:set ts=4:set noexpandtab:%retab!
    • 1
    • 2
    • 3

The plus exclamation mark ! is the tab after handling non-whitespace characters, that is, all tab

If the exclamation mark is not added ! , only the tab at the beginning of the line is processed

"Linux" vim modifier tab is 4 spaces

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.