2009-12-07

vim技巧一则

vim的用户应该都比较喜欢gf这个命令,直接编辑当前光标所在文件,方便快捷。其实还有另外两个类似的,只不过会在新窗口或者新标签中编辑。


    1. gf open in the same window ("goto file")

    2. <c-w>f open in a new window (Ctrl-w f)

    3. <c-w>gf open in a new tab (Ctrl-w gf)



      比如,我用find/grep把一个匹配列表重定向到文件foo,然后在文件 foo 中用 <C-w> f 还是相当惬意的。

      标签:

      5 Comments:

      At 07:50, Anonymous yechun said...

      咋又回到vim了?

       
      At 07:57, Anonymous little.W said...

      如果vim是武士,emacs是海盗 -- 我上了船是海盗,下了船就是武士。呵呵。
      编辑C我喜欢用vim,其它解释型的喜欢用emacs,因为可以编写便看到结果。

       
      At 12:51, Anonymous yechun said...

      很好的比喻,就像“你不是一个认真的人,你认真起来不是人”,哈哈哈

       
      At 16:15, Anonymous kk said...

      打个酱油~
      记下了
      我老是上不去船

       
      At 16:48, Anonymous little.W said...

      没买票吧?:-p

       

      发表评论

      << Home