Vim Learning Notes 6---Multi-file operations and labels

Source: Internet
Author: User
Tags uppercase letter

1. Label

(1) Nameless label

": This is two single quotes, meaning to jump back and forth two times before and after the jump.

<c-^>: Jump back and forth between two file, is the "Global version of the command."

<c-o>: Very familiar, jump back, O means older.

<c-i>: Contrary to O.

Note: The jumps of O and I are all global jumps.


(2) Single file label

M x:x represents a-Z lowercase letter, and m represents the position where the current cursor is mark,mark.

' x: Jumps to the X-marked position, ignores the original number of columns, and jumps to the beginning of the line.


(3) Global label

M x:x represents any uppercase letter of a-Z and can jump between arbitrary files, which is global mark

' X: The command to jump to somewhere.


Note: In fact, the core command of the jump is '

It can be paired with letters and can be paired with different symbols.

' last jump to the place

" The position of the cursor at the last time you left (where you last edited)

. Where the last change was made


2. Some commands for multiple documents

: Edit XXX: Do not quit Vim, close the current file, open the xxx file, note that the current file should be write before the line.


Vim x1 X2 X3: Open multiple files at the same time

: args: View open file, and what file you are now, you can abbreviate: AR

: Next: Next, you can abbreviate: n

: Wnext: First Write and Next, you can abbreviate: WN

:p revious: Previous

: First: One

: Last: Final


3. Transfer data between Files

(1) Ordinary Yank and put


(2) Register

"x:" is a double quote, indicating that the register x,x is a-Z letter.

The usage also must cooperate with small change inside operator to use

For example: (register + operator) + motion

For example: visual+ (register + oprerator)

This will save the contents of multiple blocks and put them once


(3) appending

: Write >> target: Append the current file to the target file.

You can append specific content through visual.


4.view and rename

(1) View

Half Read-only:vim-r x or view X

Can be modified by forcing W.


All Read-only:vim-m X

Can't be modified at all


(2) Rename

: SaveAs XXX: Renaming a copy

: File XXX: rename this file to xxx

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.