Vim Fast Indent

Source: Internet
Author: User

Fast indent 1. Use commands to quickly adjust indent operations

This section learns how to indent quickly in vim and indent operations are effective in normal mode

Open a file for editing

$ vim protocols
    • Normal mode input 15G , jump to 15 lines
    • Input entire line in normal mode >> indent right (used to format code super cool)
    • Enter the entire line in normal mode to the << left fallback
    • Normal mode enter : command line mode to shiftwidth set values to control the number of characters for indentation and fallback
2.shiftwidth command

shiftwidthThe command refers >> to the indentation generated by the previous command (which can be abbreviated sw ). Enter : command line mode to set values in normal mode to control the number of characters in shiftwidth indentation and fallback get current setpoint

:set shiftwidth?

Set indent to 10 characters

:set shiftwidth=10

Enter ESC back into normal mode and try again to >> see if the indent changes

3. Adjust the text position

Command line mode enter :ce (center) command to center the contents of the bank

:ce

Command line mode enter :ri (right) command to make our text

:ri

Command line Mode enter: le (left) command to leave the contents of the bank

:le

Vim Fast Indent

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.