0%

vim手册

模式

  1. normal

  2. insert

    1. i insert 前插
    2. a append 后插
    3. o open a line below
    4. I 开头
    5. A 末尾
    6. O open a line up
  3. command

    1. 替换 :% s/java/python/g
    2. set nu 设置行号
    3. sp 横分屏 vs 竖分屏
  4. visual

    1. v
    2. V 整行
    3. ctrl + v 块状

vim 手册

vimtutor

插入模式下

ctrl+h 删除上一个字符

ctrl+w 删除上一个单词

​ctrl+u 删除当前行光标之前的内容jj

motions

  1. hjkl
  2. w/b move word by word
  3. W/B move WORD by WORD
  4. e/ge move to the end of a word
  5. E/gE
  6. f(character) find character in line
  7. F(character)
  8. t(character) until character in line
  9. T(character)
  10. ; / , 继续搜索
  11. 0 first character of a line
  12. ^ first non-blank character of a line
  13. $ end character of a line
  14. g_ end non-blank character of a line
  15. { / } move entire paragraphs
  16. ctrl + d / ctrl + u
  17. /{pattern} search forward
  18. ?{pattern} search backward
  19. n / N next/previous
  20. ctrl + o go back
  21. ? without a pattern change the direction
  22. gg top of a file
  23. {line}gg
  24. G end of a file

operators

  1. u to undo
  2. ctrl + r to redo
  3. d delete
    1. d2w delete two words
    2. dt; delete until ;
    3. df; delete until ;(include ;)
    4. d/hello delete until hello
    5. diw
    6. di”/‘/`
  4. dd delete line
  5. D delete from the cursor until the end of the line
  6. c change (combine d and i)
  7. cc change a complete line
  8. C change from the cursor until the end of the line
  9. . repeat change

text-object

  1. w word
  2. s sentence
  3. p paragraph
  4. “ quotes special
  5. ‘ single quote special
  6. ` backtick special
  7. () b
  8. {} B
  9. []
坚持原创技术分享,您的支持将鼓励我继续创作!

欢迎关注我的其它发布渠道