我希望能够在我的osx系统上,使用默认的pdf阅读器Preview,通过文件链接从Vim中打开pdf文件。
Vim中有一个名为gf
的普通命令,可以打开一个文件链接。但pdf文件应该在外部应用程序中打开。
正如@Ken在评论中所说,你应该使用gx
:
Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
best seen with a special handler (ie. a tool provided with your computer).
Netrw allows one to invoke such special handlers by:
* when Exploring, hit the "x" key
* when editing, hit gx with the cursor atop the special filename
更多信息可以在:help gx
中找到。
netrw
来使用指定的外部程序,这些程序根据文件扩展名打开!请查看我的回答。 - 71GA