vim

 


 

visual mode :

                     insert :

                                ctrl + v

                                select line

                                shift + i

                                key word

                                Esc


 

跳回上一個位置

ctrl + o


 

跳到下一個位置

ctrl + i


顯示完整的檔案路徑及檔名

1 + ctrl + g

 


 

swtich case

~

 


 

 

Word movement

w : moves to the start of the next word

e : moves to the next end of a word


 

Matching a paren

% : moves to the matching paren

      work for () and [] and {}


 

Moving to a character

fx : searches forward in the line for the single character x.

      Hint: "f" stands for "Find".

 The "F" command searches to the left

tx : works like the "fx" command, except it stops one character  before the searched character.

      Hint: "t" stands for "To".

  The "T  " command searches to the left

 

copy

y0 : copy from start of line to current.

y$ : copy from current to end of line.

p : paste

5p : paste 5 times

2yy : copy 2 lines

 


replace

range is the entire file,

search word1, then replace it by word2, need confirm

:1,$s/word1/word2/gc

 


 

gd 查區域變數
gD查全域變數
     追蹤某個變數宣告時,可以用gd或gD去跳轉

 

 


 

dd 刪一整行
dw 刪一個單字,非刪一個字母
dw 刪掉空白至最一個字出現
      ex
              before
              asss   _          ddddd
 
              after
              asss   ddddd
 
d$ 刪至行尾 (含游標的字元)
d^ 刪至行首 (不含游標的字元)

 

http://wen00072.github.io/blog/2018/02/15/vim-setup-for-trace-c-code/#vtr-set-vdplg-tr 

转载于:https://www.cnblogs.com/youchihwang/p/6204524.html

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值