Action | Notepad++ shortcut | Vim shortcut |
---|---|---|
Duplicate line | Ctrl+D |
yyp |
Cut line | Ctrl+L |
dd |
Move line up/down | Ctrl+Shift+<up/down> |
dd<k/j>p |
Compare files | File compare plugin wizard | :vsplit <filename> or vimdiff file1 file2 (from command line) |
Select all (from here to top/bottom of file) | Ctrl+Shift+<home/end> |
v<gg/G> |
Select all (from here up/down one page) | Ctrl+Shift+<PgUp/PgDn> |
v Ctrl+<U/D> |
Code align on | Ctrl+Shift+= (opens plugin wizard) |
|
Repeat code align on | Ctrl+= then shortcut key |
|
Column edit mode | Alt+Shift+<up/down> |
Ctrl+V then Shift+I |
Find/Replace (+extended) | Ctrl+H (opens GUI wizard) |
Regular expressions: e.g. :s/oldtext/newtext/gC |
Find/Replace in selection | [select text, Ctrl+H ] |
here |
Sort lines | Access wizard from GUI | Shift+V then :sort |
Trim trailing/leading spaces | Access wizard from GUI | :%s/\s\+$//e (trailing) :%s/^\s\+//e (leading) [source] |
TextFX Characters | Access wizard from GUI | gU[motion] (for UPPER), gu[motion] (for lower) |
Merge lines | Ctrl+J |
J |
Save | Ctrl+S |
:wq |
Find | Ctrl+F |
/ |
Action | Vim shortcut |
---|---|
undo | u |
home | ^ |
end | $ |
superhome | 0 |
page up/down | Ctrl+<U/D> |
delete | x |
backspace | X |
back one word/WORD | b/B |
forward one word/WORD | w/W |
insert | i |
append | a |
copy | y [plus motion] |
paste | p |
open (i.e. insert new line) | o |
change | c |
delete/cut | d |
replace | R |
Action | Vim shortcut |
---|---|
change next word | cw |
copy next word | yw |
copy from here to end of line | y$ |
switch two letters | xp |
delete til | dt<char> |
Action | Vim shortcut |
---|---|
search forward | / |
search backward | ? |
find next | f |
next occurrence | * or ; or n |
previous occurrence | # or , or N |
find/replace in whole document | %s/oldtext/newtext/g |
Action | Vim shortcut |
---|---|
Reload file (discarding changes) | :e! |
Quit vim (discarding changes) | :q! |
Save file | :w |
Save & quit | :wq |
previous occurrence | # or , |
find/replace in whole document | %s/oldtext/newtext/g |
execute shell command | :!<command> |