Вы находитесь на странице: 1из 1

Vim Cheat Sheet - English https://vim.rtorr.

com/
Vim Cheat Sheet
Global Editing Cut and paste Working with multiple files Tabs
- open help for keyword - replace a single character - yank (copy) a line - edit a file in a new buffer or - open a file in
a new tab
- save file as - join line below to the current one with one - yank (copy) 2 lines or - go to the next buffer
space in between + - move the current split window
- close current pane - yank (copy) the characters of the word or - go to the previous buffer into its own tab
- join line below to the current one from the cursor position to the start of the
- open man page for word under the cursor without space in between next word - delete a buffer (close a file) or or - move to the
next tab
Cursor movement - reflow paragraph - yank (copy) to end of line - list all open buffers
or or - move to the
- move cursor left - change (replace) entire line - put (paste) the clipboard after cursor - open a file in a new buffer and previous tab
split window
- move cursor down - change (replace) to the end of the line - put (paste) before cursor - move to tab number #
- open a file in a new buffer and
- move cursor up - change (replace) to the end of the line - delete (cut) a line vertically split window - move current tab to the #th
position (indexed from 0)
- move cursor right - change (replace) entire word - delete (cut) 2 lines + - split window
or - close the current tab
- move to top of screen - change (replace) to the end of the word - delete (cut) the characters of the word + - switch windows and all its windows
from the cursor position to the start of the
- move to middle of screen - delete character and substitute text next word + - quit a window or - close all tabs except
for the current one
- move to bottom of screen - delete line and substitute text (same as cc) - delete (cut) to the end of the line + - split window vertically
command - run the command on all
- jump forwards to the start of a word - transpose two letters (delete and paste) - delete (cut) to the end of the line + - move cursor to the left window tabs (e.g. :tabdo q - closes all opened tabs)
(vertical split)
- jump forwards to the start of a word - undo - delete (cut) character
(words can contain punctuation) + - move cursor to the right window
+ - redo Exiting (vertical split)
- jump forwards to the end of a word
- repeat last command - write (save) the file, but don't exit + - move cursor to the window
- jump forwards to the end of a word below (horizontal split)
(words can contain punctuation) - write out the current file
Marking text (visual mode)
using sudo + - move cursor to the window
- jump backwards to the start of a word - start visual mode, mark lines, then do a above (horizontal split)
command (like y-yank) or or - write (save) and quit
- jump backwards to the start of a word
(words can contain punctuation) - start linewise visual mode - quit (fails if there are unsaved changes)

- move to matching character (default - move to other end of marked area or - quit and throw away unsaved
supported pairs: '()', '{}', '[]' - use :h changes
matchpairs in vim for more info) + - start visual block mode
- write (save) and quit on all tabs
- jump to the start of the line - move to other corner of block
Search and replace
- jump to the first non-blank character of - mark a word
- search for pattern
the line
- a block with ()
- search backward for pattern
- jump to the end of the line
- a block with {}
- 'very magic' pattern: non-
- jump to the last non-blank character of
- inner block with () alphanumeric characters are interpreted as
the line
special regex symbols (no escaping needed)
- go to the first line of the document - inner block with {}
- repeat search in same direction
- go to the last line of the document - exit visual mode
- repeat search in opposite direction
- go to line 5 Visual commands - replace all old with new
- jump to next occurrence of character x - shift text right throughout file

- shift text left - replace all old with new


- jump to before next occurrence of
throughout file with confirmations
character x
- yank (copy) marked text
- remove highlighting of search
- jump to previous occurence of character
- delete marked text matches
x

- jump to after previous occurence of - switch case Search in multiple files


character x - search for
Registers pattern in multiple files
- repeat previous f, t, F or T movement - show registers content
- repeat previous f, t, F or T movement, - yank into register x - jump to the next match
backwards
- paste contents of register x - jump to the previous match
- jump to next paragraph (or
function/block, when editing code) - open a window containing the list
Marks
of matches
- jump to previous paragraph (or - list of marks
function/block, when editing code)
- set current position for mark A
- center cursor on screen
- jump to position of mark A
+ - move screen down one line
(without moving cursor) - yank text to position of mark A

+ - move screen up one line (without


Macros
moving cursor)
- record macro a
+ - move back one full screen
- stop recording macro
+ - move forward one full screen
- run macro a
+ - move forward 1/2 a screen
- rerun last run macro
+ - move back 1/2 a screen

Insert mode - inserting/appending text


- insert before the cursor

- insert at the beginning of the line

- insert (append) after the cursor

- insert (append) at the end of the line

- append (open) a new line below the


current line

- append (open) a new line above the


current line

- insert (append) at the end of the word

- exit insert mode

1 de 1 18/01/2019 17:40

Вам также может понравиться