The usage of VIM in Linux explains _linux shell

Source: Internet
Author: User
Tags prev first row

Vim is the most famous text/code Editor on Linux systems, and the enhanced version of the Vi editor in the early years, and GVim is its Windows version. Its biggest feature is the full use of keyboard commands for editing, while leaving the mouse to make it difficult to get started, but the keyboard flow after the various clever combination of operation can bring a very large efficiency improvement.

Some forms of VIM's commands

1:vim xxx

Open a vim file named XXX directly, if not, create a new one directly. The default cursor is defined to the first row

2:vim + XXX

Open the cursor and define to the last line

3:vim +num XXX

Open cursor definition to num line

4:vim +/name XXX

The open cursor cursor appears in the XXX text for the first time that the name line appears, and the letter N can be toggled back and forth between the lines that appear in name

5:vim XXX yyy zzz

Open three vim files at a time, open XXX by default, and enter in the bottom row mode: N to switch back and forth between these several files, enter: Prev or: N to switch to the previous

Vim in the bottom row mode common instructions

: W Save

: Q exit

:! Mandatory execution

: LS lists all open files

: n switch to the last file

: N or: prev Switch to previous file

: Digital cursor quickly positioned to Num line

/XXX cursor Backward search for the top one XXX string

? The XXX cursor searches forward to the first xxx string

Common Instructions for Command mode writing in VIM

H J k L Cursor left down up right move

CTRL + F PAGE Down

CTRL + B PAGE UP

CTRL + D turn down half page

CTRL + U turn up half page

DD Delete when forward

YY copy when moving forward

P Paste to the next line of the current line

P station on the previous line in the current row

o Open a new line on the next line in the current row and switch to input mode

The above is a small set to introduce the Linux in the usage of vim, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.