vim技巧一则
Sunday, December 6th, 2009vim的用户应该都比较喜欢gf这个命令,直接编辑当前光标所在文件,方便快捷。其实还有另外两个类似的,只不过会在新窗口或者新标签中编辑。
- gf open in the same window (”goto file”)
- <c-w>f open in a new window (Ctrl-w f)
- <c-w>gf open in a new tab (Ctrl-w gf)
比如,我用find/grep把一个匹配列表重定向到文件foo,然后在文件 foo 中用 <C-w> f 还是相当惬意的。