【发布时间】:2011-10-18 16:50:10
【问题描述】:
当前的 gf 命令将 *.pdf 文件作为 ascii 文本打开。我希望使用外部工具(如 okular、foxitreader 等)打开 pdf 文件。我尝试使用 autocmd 来实现它:
au BufReadCmd *.pdf silent !FoxitReader % & "open file under cursor with FoxitReader
au BufEnter *.pdf <Ctrl-O> "since we do not really open the file, go back to the previous buffer
但是,第二个 autocmd 未能按预期工作。我想不出以autocmd 方式执行<Ctrl-o> 命令的方法。
谁能给我一个关于如何在autocmd 中<Ctrl-O> 的提示,或者直接建议一种更好的方法来使用 gf 打开 pdf 文件?
谢谢。
【问题讨论】: