若是你和我同样,但愿拥有众多工具,发挥工具最大执行效率,让工做事半功倍的话,我推荐你来使用下 Vim。html
刚接触Vim 会以为它的学习曲线很是陡峭,要记住不少命令,操做太复杂。因此这个系列的分享,不会教你怎么web
配置它,而是教你怎么快速的掌握它。less
学不会就不要继续学了,直接拿来用就行了。ide
接下来咱们要实现这种效果,快速的删除括号中的内容。工具
操做步骤:学习
1. 按 ESC 进入 Normal 模式,经过 h 左、j 下、k 上、l 右 来控制光标,把光标移动到括spa
号中。code
2. 连续按 di( 就能够把括号中的内容删除了。orm
刚才连续按下的快捷键,表明的意思是 delete all content inside ( 因此结果字符串为 ()htm
更多案例:
好比说有这么个字符串 "testdfat",假设光标停留在第一个 t 位置。
di":delete all content inside ",结果字符串为""
dta:delete all content to a,结果字符串为"at"
dfa:delete all content from current location, until a is found,结果字符串为"t"
高手进阶:
i 表示 inside,打开 Vim 后,执行 :help object-select 能够看详细介绍。
This is a series of commands that can only be used while in Visual mode or
after an operator. The commands that start with "a" select "a"n object
including white space, the commands starting with "i" select an "inner" object
without white space, or just the white space. Thus the "inner" commands
always select less text than the "a" commands.
These commands are {not in Vi}.
These commands are not available when the +textobjects feature has been
disabled at compile time.
Also see gn and gN, operating on the last search pattern.
相关学习:
Vim 模式:http://www.cnblogs.com/zeushuang/archive/2012/11/16/2772830.html