Skip to content

Latest commit

 

History

History
114 lines (108 loc) · 7.41 KB

vim.org

File metadata and controls

114 lines (108 loc) · 7.41 KB

Vim

Presentation

Slides for a Vim presentation are available here.

Keybindings

CommandDescription
ysw"add surrounding word with "
cst<change surround tag
<V> :sortsort selected lines
ztcurrent line goes to top
zbcurrent line goes to bottom
^escroll but preserve cursor position
^yscroll top but preserve cursor position
^zpause vim and play in the terminal
fgreturn to vim
>i{one indent inside curly brackets (or > i B)
=i{indent inside curly brackets
^vIenter visual block then add a prefix ‘#’
%matches equal pairs
@@execute last macro
:reglists all registers (macros included)
gvresume the previous visual mode selection
gJjoin without whitespace
g_jump to the last non-blank char of the line
Ysame as yy
"0contents of the latest yank
~~~change case
ZZsave and quit
ZQsave without quitting
:xsame as :wq
[)next close parens
[}next close curly braces
''move to last cursor position
'.jump to last modification
`.jump to exact last modification
".last inserted text
":last executed command
@:execute last command
<C-O>retrace (backwards) your movements in a file (:jumps)
<C-I>retrace (forward) your movements in a file (:jumps)
g;cycle through changes (backwards)
g,cycle through changes (forward)
<I> ^r =execute an expression and paste it into the buffer
:markslist of marks
eaappend at the end of a word (better than eli)
:tabnewcreates a new tab
:tabclosecloses the current tab
:r! {cmd}pastes the content of cmd into the buffer
^w <vertically shrinks the window
^w >vertically enlarges the window
<C-a>increment number
<C-x>decrement number
]mnext method
[mprevious method
(move to beginning of current sentence
)move to beginning of next sentence
[\[move to beginning of current section
]]move to beginning of next section
gdgo to definition (TAGS)
gfedit file at current position
gFedit file at line N at current position (file.py:N)
:g/pattern/d/delete all lines matching a pattern (g! negates)
:g/^\s*$/ddelete blank lines
:e .directory explorer
<I> ^nnext keyword completion
<I> ^pprevious keyword completion
:windo difftdiff on all open windows
+move to first char of next line
-move to first char of previous line
:20vs .create visual split with the file structure of a dir
d?textdelete until search (?/)
"1p."increments the buffer number of the register
"qppaste contents of register q
"qYyank the contents of the current line into register q
:=print all lines
1,10w filewrite line 1 through 10 to a new file
1,10w >>fileappend line 1 through 10 to an existing file
:r fileread file and paste contents on current line
S(same as cc) erase line and enter insert mode
nHmove n lines below top line
nLmove n lines above last line
#match previous word under cursor
g#match previous word under cursor <unlisted>
*match next word under cursor
g*match next word under cursor <unlisted>
:grepstarts the grep command
<V> ogo to the other end of the highlightext text
C-jnewline
giback to previous insert mode
gashow character encoding info
gq<Enter>format paragraphs
C-r <macro>show contents of macro recording

Neovim

COC

CommandDescription
]gdiagnostic next
[gdiagnostic prev
gdgo to definition
giimplementation
grreferences
gytype definition