Devhints Io Vim
Devhints Io Vim
IO Edit
Vim cheatsheet
Editing
A Append from end of line dd Delete line (Cut) V Enter visual line mode
In visual mode
o Next line p Paste
d / x Delete selection
O Previous line P Paste before
s Replace selection
s Delete char and insert "*p / "+p Paste from system clipboard
y Yank selection (Copy)
S Delete line and insert "*y / "+y Paste to system clipboard
C Delete until end of line and insert See Operators for other things you can do.
Navigating
Operators
d Delete
Operators let you operate in a range of text (defined by Combine operators with motions to use them.
motion). These are performed in normal mode.
y Yank (copy)
dd (repeat the letter) Delete
d w c Change (delete then insert) current line
Text objects
Operator [i]nside or [a]round Text object [ ( { < A [], (), or {} block yap Yank paragraph (including newline)
B A block in [{
See Operators for other things you can do.
Diff
Misc
:tabedit [file] Edit file in a new tab `^ Last position of cursor in insert mode
:tabfind [file] Open file if exists in new tab `. Last change in current buffer
:tabfirst Go to first tab '' Back to line in current buffer where jumped from
:tablast Go to last tab `` Back to position in current buffer where jumped from
Navigation
Misc
% Nearest/matching {[()]}
. Repeat last command
]) Next
:set ff=unix Convert Windows line endings to Unix line endings
Jumping
<C-R>" Paste from “ register
<C-I> Go forward
gf Go to file in cursor
Text alignment
:center [width]
Counters :right [width]
:left
Windows Calculator
z{height}<Cr> Resize pane to {height} lines tall <C-R>=128/2 Shows the result of the division : ‘64’
Tags
<C-T> Go back to last tag Works like :qa, but throws an error. Great for aborting Git commands.
Also see
Devhints home
Vim digraphs Vim Easyalign Vim scripting Vue.js
cheatsheet cheatsheet cheatsheet cheatsheet