Сайт о горячих клавишах.
Горячие клавиши VIM
VIM - это радактор которому более 30 лет, он расчитан на то то бы управлять текстами лишь с буквенной клавиатуры. В VIM нет так называемых горячих клавишь, есть лишь команды.
Вот лишь небольшой список основных команд.
VIM аццки расширяется, поэтому в нем ВСЕ, буквально все делается проще, однако порог входя в VIM крайне высок, и пользуются им большелобые очкоглазы с рыжей бородой.
Ну может быть и вы станете таким когда-нибудь ?
Я уже стал
How to Exit
:q[uit]
|
Quit Vim. This fails when changes have been made.
|
:q[uit]!
|
Quit without writing.
|
:cq[uit]
|
Quit always, without writing.
|
:wq
|
Write the current file and exit.
|
:wq!
|
Write the current file and exit always.
|
:wq
|
Write to . Exit if not editing the last
|
:wq!
|
Write to and exit always.
|
:[range]wq[!]
|
[file] Same as above, but only write the lines in [range].
|
ZZ
|
Write current file, if modified, and exit.
|
ZQ
|
Quit current file and exit (same as ":q!")
|
Editing a File
:e[dit]
|
Edit the current file. This is useful to re-edit the current file, when it has been changed outside of Vim.
|
:e[dit]!
|
Edit the current file always. Discard any changes to the current buffer. This is useful if you want to start all over again.
|
:e[dit]
|
Edit .
|
:e[dit]!
|
Edit always. Discard any changes to the current buffer.
|
gf
|
Edit the file whose name is under or after the cursor. Mnemonic: "goto file".
|
Inserting Text
a
|
Append text after the cursor [count] times.
|
A
|
Append text at the end of the line [count] times.
|
i
|
Insert text before the cursor [count] times.
|
I
|
Insert text before the first non-blank in the line [count] times.
|
gI
|
Insert text in column 1 [count] times.
|
o
|
Begin a new line below the cursor and insert text, repeat [count] times.
|
O
|
Begin a new line above the cursor and insert text, repeat [count] times.
|
Inserting a file
:r[ead] [name]
|
Insert the file [name] below the cursor.
|
:r[ead] !
|
Execute and insert its standard output below the cursor.
|
Deleting Text
x
|
Delete [count] characters under and after the cursor
|
X
|
Delete [count] characters before the cursor
|
d
|
Delete text that moves over
|
dd
|
Delete [count] lines
|
D
|
Delete the characters under the cursor until the end of the line
|
x or
d
|
Delete the highlighted text (for see Selecting Text).
|
CTRL-H or
|
When in Select mode: Delete the highlighted text
|
X or
D
|
Delete the highlighted lines
|
:[range]d[elete]
|
Delete [range] lines (default: current line)
|
:[range]d[elete]
|
Delete lines, starting with [range]
|
Changing (or Replacing) Text
r
|
replace the character under the cursor with .
|
R
|
Enter Insert mode, replacing characters rather than inserting
|
~
|
Switch case of the character under the cursor and move the cursor to the right. If a [count] is given, do that many characters.
|
~
|
switch case of text.
|
~
|
Switch case of highlighted text
|
Substituting
:[range]s[ubstitute]///[c][e][g][p][r][i][I] [count]
|
For each line in [range] replace a match of with .
|
:[range]s[ubstitute] [c][e][g][r][i][I] [count] :[range]&[c][e][g][r][i][I] [count]
|
Repeat last :substitute with same search pattern and substitute string, but without the same flags. You may add extra flags
|
The arguments that you can use for the substitute commands:
[c] Confirm each substitution. Vim positions the cursor on the matching
string. You can type:
'y' to substitute this match
'n' to skip this match
to skip this match
'a' to substitute this and all remaining matches
'q' to quit substituting
CTRL-E to scroll the screen up
CTRL-Y to scroll the screen down .
[e] When the search pattern fails, do not issue an error message and, in
particular, continue in maps as if no error occurred.
[g] Replace all occurrences in the line. Without this argument,
replacement occurs only for the first occurrence in each line.
[i] Ignore case for the pattern.
[I] Don't ignore case for the pattern. [p] Print the line containing the last substitute.
Copying and Moving Text
"
|
Use register for next delete, yank or put (use uppercase character to append with delete and yank) ( only work with put).
|
:reg[isters]
|
Display the contents of all numbered and named registers.
|
:reg[isters]
|
Display the contents of the numbered and named registers that are mentioned in .
|
:di[splay] [arg]
|
Same as :registers.
|
["x]y
|
Yank text [into register x].
|
["x]yy
|
Yank [count] lines [into register x]
|
["x]Y
|
yank [count] lines [into register x] (synonym for yy).
|
["x]y
|
Yank the highlighted text [into register x] (for see Selecting Text).
|
["x]Y
|
Yank the highlighted lines [into register x]
|
:[range]y[ank] [x]
|
Yank [range] lines [into register x].
|
:[range]y[ank] [x]
|
Yank lines, starting with last line number in [range] (default: current line), [into register x].
|
["x]p
|
Put the text [from register x] after the cursor [count] times.
|
["x]P
|
Put the text [from register x] before the cursor [count] times.
|
["x]gp
|
Just like "p", but leave the cursor just after the new text.
|
["x]gP
|
Just like "P", but leave the cursor just after the new text.
|
:[line]pu[t] [x]
|
Put the text [from register x] after [line] (default current line).
|
:[line]pu[t]! [x]
|
Put the text [from register x] before [line] (default current line).
|
Undo/Redo/Repeat
u
|
Undo [count] changes.
|
:u[ndo]
|
Undo one change.
|
CTRL-R
|
Redo [count] changes which were undone.
|
:red[o]
|
Redo one change which was undone.
|
U
|
Undo all latest changes on one line.
|
.
|
Repeat last change, with count replaced with [count].
|
|