vim tips

vim diff 

1.   已经打开的vim  中,diff 新的文件

:diffsplit  file

        简写(diffs)  

       默认为  hor 模式

       : vert  diffs   file   --》 垂直模式


  2. dp 和 do 后,重新diff一下

diffupdate    

        (diffu)


 3.   下一个/上一个 diff 

[c

]c  


4. 设置 diffopt

set diffopt=filler,vertical

设置后,diffs 出来的内容,默认使用垂直模式

     

5. ctrl-w,r   交换窗口位置


设置文件的格式

:set fileformats=unix,dos    设置vim 可以支持的格式,优先unix,后dos

:set fileformat?  查询当前文件格式

:set fileformat=unix 转换当前文件格式为unix

设置文件的编码格式

:set fileencoding=utf-8

:set fileencoding 查询文件格式



Other

附带几个命令

e   -- end of the word

{   }   start or end of block 

H  M  L       jump to  high  middle low pos of the screen

a    insert after the current cursor

J    merge the next line with current line

#  --> *  

.   repeat  command 



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值