5.高级编辑命令

来源:互联网 发布:淘宝卖土特产的代价 编辑:程序博客网 时间:2024/06/07 22:47

1. set 命令

打开某个命令:set option关闭某个命令:set nooption
忽略大小写:set ic  (ignore char)不忽略大小写:set noic
查看正在使用的选项:set all

2.执行 unix 命令

!command
!date 显示日期
!sh 执行 shellCtrl + D 退出
:r !date把日期读到文本中:r !sort filename  将文本排序后读入
单词缩写:ab hehe  oooooooooo    将oooooooooo 缩写为hehe  插入模式时,输入hehe自动替换为 oooooooooo:unab hehe  取消别名:ab 列出所有别名
与ab 相同,不同的是 map 在命令模式时生效:map x sequence :unmap :map 

安装 spell 程序

sudo apt-get install spell
找出文件中单词拼写错误:spell finename

缩排控制

:set autoindent
tab 默认8个空格,下面命令可以改变:set shiftwidth=4
现实 tab:set list
0 0