How to open pdf file from Vim using default pdf application?

I want to open pdf files using their links to files from Vim in the default pdf viewer application, which is Preview on my osx.

There is a gf normal command open file link inside Vim. But PDF files must be open in an external application.

+5
source share
1 answer

As KKen said in a comment, you should use 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 

More information can be found in :help gx .

+1
source

Source: https://habr.com/ru/post/1234632/


All Articles