Vim of the Linux text Editor (ii)

Source: Internet
Author: User
Tags linux text editor

Edit command

C: Delete command

cc: Directly delete the cursor line, the cursor jumps to the beginning and transitions to the input mode

#cc: Delete the next # line in the row where the cursor is located, and the cursor jumps to the beginning of the line and transitions to input mode

C $: Deletes the contents of the cursor at the end of the line and transitions to the input mode at the cursor position

Vim visualization mode, edit mode

Visual mode

v: Select the character that the cursor is hovering over

V: Select the row where the cursor is hovering, select the entire row

Flip Screen operation

ctrl+f: Turn a screen at the end of the file;

ctrl+b: Turn one screen to the file header;

ctrl+d: Half-screen to the tail of the file;

ctrl+u: Turn half screen to file header;

The same document window is split:

ctrl+w Loosen and press s: Split horizontally

ctrl+w release and press v: Split vertically

Split window Jump:

ctrl+w Release and press the cursor key

Window Property Definition:

(cancel) Auto indent:

: Set number or : Set Nu

: Set Nonumber or : Set Nonu

(cancel) Auto indent:

: Set autoindent or : Set AI

: Set Noai

(cancel) is case sensitive:

: Set ignorecase or : Set IC

: Set Noic

(cancel) to display matching parentheses:

: Set Showmatch or : Set SM

: Set NOSM

(cancel) to display syntax coloring:

: Syntax on

: Syntax off

(cancel) The search results highlighted:

: Set Hlsearch

: Set Nohlsearch

Get help:

: Set

: Help [command]

————————————————————

All of these are temporary and require long-term and effective changes to the Vim configuration file

Vim configuration file:

Global:/ETC/VIMRC

Personal:~/.VIMRC

————————————————————

Find Replacements:

: Address delimitation s/Find content (can use mode)/replace content (cannot use mode)/GI (Global Global) (ignorecase case insensitive) (delimiter / can use other special symbols #,@)

Address delimitation:

%: Full text

1,$: Full text, representing the 1th to the last line;

1,+6: Indicates the 1th line and then down 6 lines;

1,$-2: Represents line 1th to the 3rd line;

., +3: Thecurrent cursor line and then down 3 rows;

Use & to find content before and after adding characters

For example, add # to the beginning of a line that starts with a blank character:

%s/^[[:space:]]/#&/

This article is from the "Arvin Lau" blog, be sure to keep this source http://64314491.blog.51cto.com/2784219/1627462

Vim of the Linux text Editor (ii)

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.