Skip to content

Commit

Permalink
vim
Browse files Browse the repository at this point in the history
  • Loading branch information
greathongtu committed Dec 5, 2023
1 parent 7baa39d commit fe29f64
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions content/posts/vim.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ The Ideal:


## Misc
* 如何在每行的最后加上分号? 先A; 然后就可以重复j. j. j.
* 查找:光标在单词上的时候输入*也可以
* 查找并替换: cwxxx<Esc> 然后重复 n. n. n. 也可以用 :%s/content/copy/g 命令
* 更改大小写:g~、gu 和 gU
* w: word, s: sentence, p: paragraph, 一般来说,d{motion} 命令和 aw、as 和 ap 配合使用比较好,而 c{motion} 和 iw is ip一起用效果会更好
* :!ls exec shell command inside vim, % means current file
* use * to **search**, cw\<something\>\<Esc\> toChange**.
* 1. modify column data: visual select then c, finally \<Esc\>
2. 非方形区域也行,如在行尾添加分号:选中block,go to end using $
* :w !sudo tee % > /dev/null 以超级用户权限保存文件
* :%s/Practical/Pragmatic/ 每行内的第一个“Practical”替换为“Pragmatic”
* gu{motion} to make all lowercase
* in visual mode: o: Goto other end of highlighted text.
* in visual mode: r-: change them all to -----
* in insert mode: \<C-o\>zz to get into insert normal mode.(move curr line to center and continue insert)
Expand Down

0 comments on commit fe29f64

Please sign in to comment.