Professional Documents
Culture Documents
Learn Enough Text Editor To Be Dangerous
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