Komsomolsk
^
|
Huan Ho <--- ---> Los Angeles
(Yellow river) |
v
Java (the island, not the programming language)
31
32 第02章Vim第一步
*02.4* 删除字符
要删除一个字符, 只需要将光标移到该字符上按下"x". (这是在追
忆古老的打字机时代, 在打字机上删除字符就是用xxxx来覆盖它) 把光标
移到上面例子中的第一行, 键入xxxxxxx(7个x) 来删除"A very ". 结
果如下:
Display
+---------------------------------------+
|intelligent turtle |
|Found programming UNIX a hurdle |
|~ |
|~ |
| |
+---------------------------------------+
现在你可以键入其它内容了, 比如:
Display
iA young <Esc>
首先键入的命令是i(进入Insert模式), 接着插入"A young", 然后退出Insert
模式(最后的<Esc>). 结果是:
Display
+---------------------------------------+
|A young intelligent turtle |
|Found programming UNIX a hurdle |
|~ |
|~ |
| |
+---------------------------------------+
删除一行
删除一整行内容使用"dd"命令. 删除后下面的行会移上来填补空缺:
Display
+---------------------------------------+
|Found programming UNIX a hurdle |
|~ |
|~ |
|~ |
| |
+---------------------------------------+
32
33 第02章Vim第一步
删除换行符
在Vim中你可以把两行合并为一行, 也就是说两行之间的换行符被删
除了: 命令是"J". 比如下面的两行:
Display
A young intelligent
turtle
将光标移到第一行上然后按"J":
Display
A young intelligent turtle
如果你误删了过多的内容. 显然你可以再输入一遍, 但是命令"u" 更
简便, 它可以撤消上一次的操作1.. 实际看一下它的效果, 用"dd"命令
来删除前面例子中的第一行内容, "u"命令会把它找回来. 另一个例子:
将光标移到第一行的A上:
Display
A young intelligent turtle
现在用命令xxxxxxx来删除"A young". 结果如下:
Display
intelligent turtle
键入"u"来撤消最后的一次删除. 最后被删除的是字符g, 所以撤消操作恢
复了这个字符:
Display
g intelligent turtle
下一个u命令将恢复倒数第二次被删除的字符:
Display
ng intelligent turtle
再下一次是字符u, 如此如此:
1译: 不要误解为它只能删除最后一次的操作, 它也可以删除上上次, 上上上上...次
的操作
33
34 第02章Vim第一步
Display
ung intelligent turtle
oung intelligent turtle
young intelligent turtle
young intelligent turtle
A young intelligent turtle
备注: 如果你按下"u"两次结果是两次找回了同
样的字符, 那说明你的Vim配置成Vi兼容模式了.
在jnot-compatiblej可以找到这一问题的对策. 这个例子
假设你的Vim使用的是Vim的方法. 如果你更喜欢老的Vi编
辑器的做法, 你就要留心两者在这方面的细微差别.
重做
如果你撤消了多次, 你还可以用CTRL-R(重做)来反转撤消的动作. 换
句话说, 它是对撤消的撤消. 实际
Vim_Command_IT/计算机_专业资料。将一些常见的命令归纳了一下前言Vim 是一个超级牛的编辑器,可以说是专为程序员设计的编辑器,强大的有些不可思议。不 过其...
command 暂时离开 vi 到命令行模式下执行 command 的显 示结果。例如“:!ls/home”即可在 vi 当中查看/home 下面以 ls 输出的文件信息。 Vim 环境的更改 :...
tuXfiles home 批注 [3]: the SIDEBOXES stuff end 批注 [4]: The MIDDLE 2 stuff start < The list of Vim commands > Working with files Vim command :...
vim 常用操作整理 vi 是个可视化的编辑器,可视化编辑器的含义就是在编辑文本时...4. map! maps keys in Vim's command and insert modes. 5. nmap maps ...
i #按一下i键,下端显示 --INSERT-- #插入命令,在vim中可能任意字符都有...ls 会先执行 ls,然后读入内容 :w!command 将当前已编辑文件作为 command 命令...
{command} 执行 shell 命令 :shell 开一个新的 shell 保存 vim 状态(挂起?): :mksession session.vim 保存当前 vim 状态 :source session.vim 回复 vim 状态...
(see command line history) q: ->打开 vim 指令窗口 (open vim command windows) :e ->打开一个文件,vim 可以开启 http/ftp/scp 的文件 (open file. ...
vim_IT/计算机_专业资料。[root@localhost ~]# vim bash: vim: command not found [root@localhost ~]# yum install vim Loaded p...
i #按一下i键,下端显示 --INSERT-- #插入命令,在vim中可能任意字符都有...ls 会先执行 ls,然后读入内容 :w!command 将当前已编辑文件作为 command 命令...
如: shell command env LANG=de_DE.ISO_8859-1 vim Display 对应于一个命令执行完之后的屏幕显示结果, 或操作的某种中间状 态. 如: 5 6 关于6.3.0版 ...
热门文档