VI Command Speed look-up table

Source: Internet
Author: User
Tags goto

VI command how commonly used, put in this for reference.

% VI File

:

Last line mode----> Command mode----> Insert mode

<----<----

(Auto) Esc

Last line mode:

/exp go forward to Exp

? exp Go backward to Exp

: w Write Buffer to disk

: w newfile Write buffer to NewFile

: w! File Write Absolutely

: Q Quit Editor

: q! Quit,discarding Buffer

: Wq Write Buffer and quit

: x Write if needed & quit

: F Edit & File Status

: R Read file into buffer

: R file Read named file in

: E (Re) Edit file

: e! (Re) Edit,discard file in

: E file Edit nameed file

: 3,8d Delete Lines 3-8

: 4,9m lines 4-9 to 12

: 2,5t Copy lines 2-5 to 13

: 5,9w file Write lines 5-9 to File

: S/old/new/current line,sub the "old" w/"new"

: s/old/new/g current Line,sub the "old" w/"new"

: 3,9s/old/new Lines 3-9,sub the "old" w/"new"

:%s/old/new all lines,sub the "old" w/"new"

:%s/old/new/g all lines,sub the "old" w/"new"

: S/pat./new A. Matches any charcter

: s/pat*/new A * matches 0 or more "T" s

: S/pa[0-9aeioa-z]/new selection Set or range

: s/pa[^aeiou]/new Match any Non-vowel

: S/^pat/new anchor "par" to beginning of line

: S/pats/new anchor "par" to end of line

:s/old/& and New/restoe matched pattern on sub

:%s/./&/indenta Whoie file

: Set Nu Display Line numbers

: Set Nonu Turn off option

: Set all Show all settings

: Set list Try to display invisible chars

: Set wm=5 Wrap lines 5 sp from R margin

Command Mode: This article is from http://bianceng.cn (learn computer)

<-| ->

HLJK Cursor Movement

G Goto last file line

3G Goto Line 3

0 Goto Line Start

$ Goto Line End

% Goto Matching Brace/paren

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.