I would like to view a pdf file in a split window using gVim, does anyone know if this is possible? How?
Some details: I just recently started using vim and use it to make notes, while reading a pdf. I write own notes, but quite often I copy text from pdf, so smooth copying would be nice. Currently I need to alt+tab for pdf viewer, go to mouse or arrow keys, select text, copy, alt+tab back to vim. Of course this is not a huge task, but using vim I feel it could be possible without mouse, keeping hands at “home row”, and not needing external program alt+tab to…
Ideally I would like pdf to be shown as it is supposed to be. If that is not possible, I will try how pdf shows as text representation using some plugin.
Vim is a text editor, so it only edits text. So, yes you can edit the PDF on a binary level, but no you can’t view the contents of the PDF as they are meant to be displayed. You can use the
xpdfpackage to convert the PDF to text first and then view that, but the results aren’t perfect. However, there are some useful autocommands to allow you to open non-text files with their default program when you “open” them in vim. I use these:Instead of
!openyou can use!xdg-openif you’re using a Linux distro. Theany2pdfcommand there is a script I use that converts those files to a PDF before opening them. You can edit this if you just want to open everything with its default program. For example,You might also want to look into window managers like dwm or ratpoison, which come pretty close to what you’re asking for.