Vim常用编辑命令:移动、跳转到文档中某位置

vi编辑器是Linux和Unix上最基本的文本编辑器,是visual editor的简称,工作在字符模式下。由于不需要图形界面,vi是效率很高的文本编辑器。它在Linux上的地位就像Edit程序在DOS上一样。它可以执行输出、删除、查找、替换、块操作等众多文本操作,而且用户可以根据自己的需要对其进行定制。Vim是vi的加强版,比vi更容易使用。vi的命令几乎全部都可以在vim上使用。常用基本命令如下有:

  • gg:命令将光标移动到文档开头
  • G:命令将光标移动到文档末尾
  • vi编辑器中在命令行模式下输入G可以直接跳转到页面的底部在命令行模式下输入1G可以跳转到页面的头部位置
  • h Move left
  • j Move down
  • k Move up
  • l Move right
  • w Move to next word
  • W Move to next blank delimited word
  • b Move to the beginning of the word
  • B Move to the beginning of blank delimted word
  • e Move to the end of the word
  • E Move to the end of Blank delimited word
  • ( Move a sentence back
  • ) Move a sentence forward
  • { Move a paragraph back
  • } Move a paragraph forward
  • 0 Move to the begining of the line
  • $ Move to the end of the line
  • 1G Move to the first line of the file
  • G Move to the last line of the file
  • nG Move to nth line of the file
  • :n Move to nth line of the file
  • fc Move forward to c
  • Fc Move back to c
  • H Move to top of screen
  • M Move to middle of screen
  • L Move to botton of screen
  • % Move to associated ( ), { }, [ ]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值