You are on page 1of 1

LEARN ENOUGH TEXT EDITOR TO BE DANGEROUS

===================================================

1 VIM
---------
vim / vim <filename> = launch vim inside shell
i = exit normal mode, enter insertion mode
ESC = exit insert mode, enter normal mode
arrow keys = move around lines
0 = move to end of line
$ = move to start of line
ESC = exit insert mode, enter normal mode
:q! = force-quit vim; without saving changes
:q = quit vim
:w = write file
:wq = write and quit vim
alias <com>='<fullcommand'> = write alias command inside file (.bash_profile)
:q = quit vim
:w = write file
:wq = write and quit vim
ESC+u = undo
source <filename> = tell the shell about the updated file (automatic in new shell
windows)
x = delete character in normal mode
dd = delete entire line in normal mode
<linenumber>dd = delete number of lines
p = paste deleted line back into file (with dd ; like cut and paste)
navigating vim (same as less) = G, 1G, ctrl+f, ctrl+b, /<keyword>, n, N

2 INTRODUCTION TO MODERN TEXT EDITORS


------------------------------------------
ARROW KEYS = MOVE AROUND FILE
CMD + ARROWS = TOP OF FILE, END OF FILE, START OF LINE, END OF LINE
CMD+SHIFT+LEFT/RIGHT ARROW = SELECT LINE
SHIFT + UP/DOWN ARROW = SELECT MULTIPLE LINES
SHIFT + LEFT/RIGHT ARROW = SELECT TEXT
CMD+A = SELECT ALL
CMD+Z/X/C/V = UNDO/CUT/COPY/PASTE
# JUMPCUT - CTRL+CMD+V/ARROW = scroll through copy history
OPTION+DELETE = delete one word at a time
CMD Z/Y = undo/redo
CMD+F = find , CMD+G = next match

3 ADVANCED TEXT EDITING


-------------------------
Tab Completion
CMD+/ = comment out selected text
TAB / SHIFT+TAB = indent/dedent (also CMD+[, CMD+])
CTRL+G = go to line number
kill codes = kill 15 2 1 9 (in order of harshness)
CMD+W = close tab
CMD+P = fuzzy opening
CMD+<tabnumber> = go to tab number
SHIFT+COMMAND+F = global find and replace

You might also like