LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do I get vim to print? (https://www.linuxquestions.org/questions/linux-software-2/how-do-i-get-vim-to-print-757903/)

blastradius 09-26-2009 07:44 AM

How do I get vim to print?
 
I'm running Ubuntu Jaunty and I've had a look at Emacs and Vim to start my C++ coding attempt with, (looks like Vim is the one for me). Problem is that it won't print although all other programs are fine.

Vim gives me 'E365 failed to print postscript file'

Please help, is there a simple fix?

Disillusionist 09-26-2009 08:07 AM

Can you print from the command line?
Code:

lp file.c

blastradius 09-26-2009 09:03 AM

No I can't, I just get:-

lp: Error - no default destination available

I take it I need to set the printer, I would have thought that because it works for everything else that it would work from the shell, clearly not, how do I set the printer?

Wim Sturkenboom 09-26-2009 10:01 AM

Below allows you to print from command line
Code:

lp -d HP_LaserJet_P1005 main.c
or
lpr -P HP_LaserJet_P1005 main.c

Replace the printername (italic) by your printer name

Below sets the default printer (not sure if it's persistent between reboots, not tested)
Code:

lpoptions -d HP_LaserJet_P1005
and now you can use lpr (or lp) without additional parameters.
Code:

lpr main.c

blastradius 09-27-2009 11:50 AM

Success
 
Thanks very much, printer now working from Vim :)

Wim Sturkenboom 09-27-2009 12:32 PM

Great. Please mark your thread as 'solved' using the tread tools just above the first post.


All times are GMT -5. The time now is 06:45 PM.