Vim window operation

Source: Internet
Author: User

Windows operations 1. Introduction to Windows operation

Vim can open multiple windows in one interface for editing, which are called Vim windows. There are many ways to open a method, for example, you can use the command line mode input to :new open a new Vim window, and enter the window to edit a new file (Normal mode Ctrl+w can also be entered, but Ctrl+w in Chrome will be closed tab page with Chrome shortcut keys conflict, So with this shortcut you can practice in IE or other browsers, in addition to the :new command, the following list of methods can also be used in command mode or Normal mode to open a new window:

    • Command-line mode enter :sp 1.txt open new Landscape window to edit 1.txt
    • Command-line mode :vsp 2.txt to open a new vertical window to edit 1.txt
    • Ctrl-w ssplit the current window into two horizontal windows in normal mode
    • Ctrl-w vsplit the current window into two vertical windows in normal mode
    • In normal mode Ctrl-w q , it is: Q ends the split window. If you have input in a new window, you need to use the mandatory character! namely: q!
    • Ctrl-w oOpen a window in normal mode and hide all previous windows
    • Ctrl-w jmove to the following window in normal mode
    • Ctrl-w kmove to the upper window in normal mode
    • Ctrl-w hmove to the left window in normal mode
    • Ctrl-w lmove to the right window in normal mode
    • Ctrl-w Jmove the current window below in normal mode
    • Ctrl-w Kmove the current window to the top in normal mode
    • Ctrl-w Hmove the current window to the left in normal mode
    • Ctrl-w Lmove the current window to the right in normal mode
    • Ctrl-w -reduce the height of the window in normal mode
    • Ctrl-w +increase the height of the window in normal mode
2. Windows Operation exercises

Open the practice file

$ vim 1.txt
    • command-line mode input :new open a new vim window
    • Command-line mode enter :vsp 2.txt open new Landscape window to edit 2.txt
    • Command-line mode enter :vsp 3.txt open new Landscape window to edit 3.txt
    • If you use a non-Chrome browser, you can use Ctrl+w the jump between windows
    • Enter :q! exit multi-window editing in command-line mode of different windows

Vim window operation

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.