主要内容来自 vimtutor
.
## vimtutorx d - del - dd - del whole linei a - addA = $aw - to next word - space 分割 - 连续标点看做一个单词, 包括汉字标点 - 汉字看做一个单词 - exclusivee - to end of word - inclusiveu c-r - undo/redop - paste - insert after cursor - = a c-v/A c-v(whole line)y - copyr - replace one charR - replace modec = d&i - ce = dei/a (a when reach end of line) - caw = dwi/a (not to use cw)G - jump to line - G - end of file - gg - first line of file/ ? - search forward/backward - n/N - next/prevc-o c-i - back/reback ---- % - go to {}()[] matched - or go to next ]}):s - replace - #,# / % range - g - all - c - ask:! - outside commandv - visual - inclusiveo = AO = kA :set ic (ignore case) hls (hlsearch) is (incsearch):r file - o && append file :r file - o && append file :help tab - 补全 jump among windows## Inserti I a A o O## Copy/Pastey yyp s-pv V ## Deletex d dd## File:o file## Multiple Windows:[n]sp file = vim -o files:[n]vs file = vim -O files ^ lines h/j/k/l - move + - = < > q## Multiple Tabs:tabe tabc tabo ## cmdset xx/noxx/invxxset list "show invisible characters"hex:%!xxd "show hex:%!xxd -r "convert backu "alternative:redir (([>] / >>) filename) / (@xx ([>] / >>)) "redirect to file/register:redir END "end:| "execute multiple commands; not pipe:expand(expr) "expand wildcards and keywords to string:let @"=expand("% [:p] ") "copy file name/path## register1. The unnamed register "" - `"` = ``; which means `p` = `""p` 2. 10 numbered registers "0 to "9 - `y` -> `0` - `d`/`c`/`s`/`x` -> '1' ~ '9' - only when deling whole line - otherwise, -> `-`3. The small delete register "-4. 26 named registers "a to "z or "A to "Z - when `p`: 'a' = 'A' - when `y` and so on: 'a': overwrite, 'A': append5. three read-only registers ":, "., "% - `.`: str in the insert mode - `%`: file name6. alternate buffer register "#7. the expression register "=8. The selection and drop registers "*, "+ and "~ 9. The black hole register "_10. Last search pattern register "/@xx : string in the registerc-r + register: paste## 宏录制q + register q[n + ]@ + register## Code foldingset fdm=manualzc zozC zOzf + sw. - foldzd zD - del## variablesdisplay: echo $xxx - environment variable echo &xxx - option value echo @xxx - register echo xxx - other variablesset + [no]optionlet var = value## encodingset encoding=xxxset fileencoding=xxx "change the encoding of fileset fileencodings=xxx,xxx:e ++enc=xxx "reload"about encoding : http://www.fmddlmyy.cn/text6.html## linebreakunix: \n dos: \r\n mac: \r:e ++ff=xx "dos/unix/mac:set ff=xx "convert
参考
- Vim 的 help 文档
- vimtutor