vim_学习笔记

vi commond

  • commonds of vi all can be used in vim
three modes of vi
  • common mode : defaut; return by [esc]
    • [10(n) + space] : move 10 char to right
    • [+ / -] move down / move up
    • [0/$] = [home/end] = move to row start / move to row end
    • [H/M/L/G] = move to row1 of screen / rowMiddle of screen / rowEnd of screen / rowEnd of file
    • 10G(ng) : move to row10 of this file
    • gg : move to row1 of this file
    • 10 + enter : move down 10 row
    • /cyy : search down ‘cyy’
      • n :next down one
      • N : next up one
    • ?cyy : search up ‘cyy’
      • n :next down one
      • N : next up one
    • u : 撤销 上一步操作 ; ctrl + r : 恢复上一步撤销
    • [:100,200s/cyc/cyy/g] search from row100 to row200 replace 'cyc' to 'cyy'
    • [:1,$s/cyc/cyy/g] search from rowOne to rowEnd replace 'cyc' to 'cyy'
    • [:1,$s/cyc/cyy/gc] search from rowOne to rowEnd replace 'cyc' to 'cyy' by confirm
    • x/X : delete to tail / delete to heand
    • 10x : delete char10 to tail
    • dd : delete hole of one row
    • 20dd : delete row20 of down
    • d$ : delete here to tail of one row
    • d0 : delete here to head of one row
    • yy : copy hole of one row
    • 10yy : copy row10 of down
    • y$ : copy here to tail of one row
    • y0 : copy here to head of one row
    • p / P : paste to down of here / paste to up of here
    • J : join next down row to here row
      • 8J : join next down row8(contains here row ) to here row
    • ctrl + r : 重复做上一次动作
    • . : 重复前一个动作
  • edit mode : [i/o/a/r] will come in this mode
    • [home/end] = move to row start / move to row end
  • commond mode : [ : / ? ] will come in this mode
    • [:w] save without quit
    • [:w filename] save to another file of new filename
    • [:wq] save and quit
    • [:q!] quit force
    • [:r filename] import text of filename to this file
    • [:set nu] set the row number visiable
    • [:set nonu] set the row nuber not visiable
    • [:set hlsearch] set high light view
    • [:set nohlsearch] set no hig light view
    • [:set autoindent] set 自动缩排
    • [:set noautoindent] set no 自动缩排

commond of vim only

  • text select
    • v : char select
    • V : row select
    • ctrl + v : rectangle select
    • y : copy ; p : past
    • d : delete
  • files vim
    • :n ] vim next down one file
    • :N ] vim next up one file
    • :files ] all files in this vim
    • :sp ] multi window
    • ctrl + w + up/down ] exchange window
    • [ctrl + w + q]/ [:q] quit window
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值