Vim split screen function

Source: Internet
Author: User
ArticleDirectory
    • Split screen

This article mainly teaches you how to use the vim split screen function

 

Split screen to start Vim
    1. Use uppercase o ParametersUp/downSplit the screen.
      Vim-on file1 file2...
    2. Use the lower-case o ParameterLeft and rightSplit the screen.
      Vim-on file1 file2...

Note:N is a number, which indicates several screens.

Disable Split screen
    1. Close the current window.
      CTRL + W C
    2. Close the current window. If only the last one is left, exit vim.
      CTRL + w Q
Split screen
    1. Splits open files up and down.
      CTRL + W S
    2. Split up and down, and open a new file.
      : SP filename
    3. Split the currently opened files left and right.
      CTRL + W v
    4. Split left and right, and open a new file.
      : VSP filename
Move cursor

The cursor keys in VI are H, J, K, and L. to switch between screens, just press Ctrl + W.

    1. Move the cursorRight side.
      CTRL + W L
    2. Move the cursorLeft.
      CTRL + W H
    3. Move the cursorAbove.
      CTRL + W K
    4. Move the cursorBottom.
      CTRL + w j
    5. Move the cursorNext..
      CTRL + W
Mobile split screen

This function still uses the vim optical key, which is only in uppercase. Of course, if your split screen is messy and complicated, this function may have some very strange symptoms.

    1. Move to the right.
      CTRL + W L
    2. Move to left
      CTRL + W H
    3. Move up
      CTRL + W K
    4. Move down
      CTRL + w j
Screen Size

The following are some operations to change the size, mainly the height. You can use Ctrl + W <or> for the width, but this may be supported by the latest version.

    1. Make all screens have the same height.
      CTRL + W =
    2. Increase the height.
      CTRL + W +
    3. Reduce height.
      CTRL + w-

Maybe there are other things I don't know. Please add them.

 

 

Recommendation reference:

Summary of common Vim commands

Vim editingCodeTips

 

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.