VIM 其他

以二进制方式编辑这个文件:vim -b file

跳转到某行:vim +n file  //n为行号

停留在行尾:vim + file


:e filename    = 打开其他文档

:enew filename = 新建文档

:e# 或 ctrl+ˆ  = 两个文档相互切换编辑

:f  或 ctrl+g  = 显示当前正在编辑的文档名称

:f 文档名      = 改变编辑中的文档名

:!shell        = 执行shell命令

:scriptnames   = 查看所有加载的插件


:%!xxd    = 文件转换成十六进制

:%!xxd -r = 转换回来

set cin   = 打开 C/C++ 风格自动缩进

gg=G   = 格式化全文

= 等号键用于调整缩进格式


u, ctrl-r = 撤销与重做

ctrl-r "  = 粘贴VIM剪切板中的内容

ctrl-o    = 在插入模式下暂时返回到通常模式

ctrl-p, ctrl-n    = 自动完成

ctrl-r {register} = 在插入模式或者搜索输入时粘贴寄存器中的内容


:read foo.txt    = Insert the file foo.txt below the cursor.

:0read foo.txt   = Insert the file foo.txt before the first line.

:read !ls        = Insert a directory listing below the cursor.

:$read !pwd      = Insert the current working directory below the last line.


转载于:https://my.oschina.net/u/174780/blog/472200

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值