0

I have a path name with page number in vim buffer and I want to open it using Sumatra PDF.

d:\drivers\instruction.pdf -page 40

Instruction above works fine using command line - cmd.exe and it opens file properly at the page 40. When I open it with gx command from GVim, file is opened, but page is not correct. (It is last opened page) How to open PDF file so it will go to proper page?

My conf: Windows 10. GVim 8.1, SumatraPDF

2

You have to create your own mapping. Perhaps like this:

nnoremap gX :!SumatraPdf <C-r><C-l><CR>

The <C-r><C-l> copies the current line as parameters for SumatraPDF.

Important: The line must only contain the parameters for SumatraPDF.

See :h c_CTRL-R_CTRL-L

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.