Closed ychin closed 1 year ago
Thanks, guys.
I had worked around the printing issue on Ventura by adding
se printexpr=system('ps2pdf\ '.v:fname_in.'\ '.v:fname_in.'.pdf\ &&\ open\ '.v:fname_in.'.pdf')\ +\ v:shell_error
to my .vimrc file. I'll update my copy of MacVim when prompted, and test after commenting out the "se printexpr..." line.
Michael
There should be a pre-release version (176.1) coming out soon. If you want that version you can go to Advanced settings to enable the pre-release update channel. Otherwise though if it's been working for you (ps2pdf
is more powerful than the OS bundled pstopdf
anyway) and you prefer just having something stable you could just wait for a proper release (177) later.
Thanks, I think I'll just sit tight until 177 is released, I'm having a few problems with unstable software (not MacVim) at the moment...
I'm on Vim 9.0.1276 (MacVim r176)
, and :hardcopy
all alone goes nowhere (MacOS Ventura 13.3
).
That means I need to wait for version-177 ? Thanks.
EDIT1: My current workaround for printing (not viewing) is to grab the file path, go to iTerm2
, open vim path/to/file
, then use :hardcopy
from there.
EDIT2: Just tried @MichaelHendry 's workaround and it indeed does work to create/open a PDF in MacOS Preview:
:hardcopy > 0.ps | !ps2pdf 0.ps && open -a preview 0.pdf
@jubilatious1 you need r177 (which is not released yet) or you can get the pre-release version r176.1. Otherwise if the workaround works for you that works too.
MacVim's
:hardcopy
implementation just uses Preview to show the generated PostScript file and lets the user decide what to do with it. macOS 13 Ventura removed PostScript support from Preview, so we now have to manually convert it to PDF first usingpstopdf
(which is thankfully bundled with macOS).While we are at it, update the script so that we actually delete the file after sending it to Preview. Previously MacVim never did that and therefore leaks the file in a temp folder until Vim closes, which isn't ideal for privacy. Now, just set a 10 sec timer to delete the file after it's opened (we just need enough time to allow Preview to open and load the file, which doesn't take much time. The 10 sec timer is to account for slow computers).
Fix #1347