Vim Tool Use Memo

Source: Internet
Author: User

Intent Act Repeat Reverse
Make a change {edit}. U
Scan line for next character f{char}/T{char}; ,
Scan Line for previous character f{char}/T{char}; ,
Scan document for next match/pattern<cr> n n
Scan document for previous match?pattern<cr> N n
Perform substitution:s/target/replacement & U
Execute a sequence of changes qx{changes}q @x u

* matches the currently selected word
: H key-notation View the use of combination keys

Keystrokes Effect
<Esc> Switch to Normal mode
<C-[> Switch to Normal mode
<C-o> Switch to Insert Normal mode
<c-r> paste content, insert mode
<c-v>code inserting the characters represented by the encoding
GA Displays the encoding of the current character

Command Effect
<Esc> Switch to Normal mode
V Enable character-wise Visual mode
V Enable line-wise Visual mode
<C-v> Switch to block-wise Visual mode
GV reselect the last visual selection
o Go to other end of highlighted text

Symbol Address
1 First line of the file
$ last line of the file
0 Virtual line above first line of the file
. line where the cursor is placed
' m line containing Mark M
' < Start of visual selection
' > End of Visual Selection
% the entire file (shorthand for:1,$)
@: Repeat the ex commands

Command Effect
<c-w>s Split the current window horizontally
<c-w>v Split the current window vertically
: SP {file} Split the current window horizontally
: VSP Split the current window vertically

Command Effect
<c-w>w Cycle between open windows
<c-w>h Focus The window to the left
<c-w>j Focus the window below
<c-w>k Focus the window above
<c-w>l Focus The window to the right

Ex Command Normal command Effect
: Cl[ose] <c-w>c Close the active window
: on[ly] <c-w>o Keep only the active window, closing all others

Keystrokes Buffer Contents
<c-w>= equalize width and height of all windows
<c-w>_ maximize height of the active window
<c-w>| Maximize width of the active window
[N]<c-w>_ Set active window height to [N] rows
[n]<c-w>| Set active window width to [N] columns

Command Effect
<c-w>t Move The current window to its own tab
: Tabc[lose] Close the current tab page and any of its windows
: Tabo[nly] Keep the active tab page, closing all others
: Tabe[dit] {file} Open {filename} in a new tab

Ex Command Normal command Effect
: Tabn[ext] {n} {n}gt Switch to tab page number {n}
: Tabn[ext] GT Switch to the next tab page
: tabp[revious] GT Switch to the previous tab page

Command Move Cursor
H one column left
L One column right
J One line down
K One line up

Keystrokes Buffer Contents
IW current Word
AW current word plus one space
IW Current WORD
AW current WORD plus one space
is current sentence
As current sentence plus one space
IP Current Paragraph
AP Current paragraph plus one blank line

Command Effect
[Count] G Jump To line number
% jump to matching parenthesis
(/) Jump to start of previous/next sentence
{/} Jump to start of previous/next paragraph
H/M/L jump to Top/middle/bottom of screens
GF Jump to file name under the cursor
<C-]> jump to Definition of keyword under the cursor
' {mark}/' {mark} jump to a mark
Pattern <CR>/?pattern <CR>/n/n jump to next/previous occurrence of pattern

Register Contents
"_ Black Hole Register
"+ system Clipboard
"* Selection Registers
"% Name of the current file
"# Name of the alternate file
". Last inserted text
": Last Ex command
"/Last Search pattern

Vim Tool Use Memo

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.