vim E365: Failed to print Postscript File - vim

I don't print from vim often, so I am not sure when this happened.
I cannot print (ha[rdcopy] from vim or gVim.
I get the error
E365: Failed to print Postscript File
I am running on Ubuntu 10.04.
I am looking for ideas on things to configure as well as anyone who has had experience with this problem and might have an answer.

Not a lot of clues there...
Starting Vim with verbose turned on gvim -V
and doing :hardcopy might produce some clues.
Also, this might also be useful :set printexpr?
You can also check if the regular command lps is working, and whether you have the default printer set up correctly. Another useful command is set pdev=printer_name

I had the same error when my system had two printers configured with no default. Setting a default resolved the problem.

Excellent answer above. A few other pointers I'd like to share after just printing from Vim for the first time:
You can find your printer name in Ubuntu by checking the CUPS interface at http://localhost:631/printers/
To print without the file name header use:
set popt=paper:letter,header:0
Finally, you can print using:
hardcopy

In addition to set a default printer I fixed it installing gtklp:
$ sudo apt install gtklp

Related

gvim8.1 :term CreateProcess failed

Recently I run into a problem with my gVim's 8.1 :terminal command that I can't figure out.
When I type :term or :terminal in gVim 8.1 I keep getting this message saying
CreateProcess failed
I looked it up on the internet but I couldn't find anything specific. Also, FZF stopped opening the files on pressing Enter, and I was thinking that these things may be related.
I should mention that prior to this errors happening I was trying to install ZSH and OH-MY-ZSH, without any success though :), I was trying to make them work with CygWin and then I deleted everything(CygWin, ZSH, OH-MY-ZSH) since I wasn't getting anywhere.
Anywho, I just mentioned this cause maybe they're related.
https://i.stack.imgur.com/dbZNG.png
Thank you.
I have just found the answer to the question I posted about 20 min ago. :)).
I just had to remove SHELL - /bin/zsh environment variable from the System Environment.

Why vim is changing first letter to g after opening a file

When I open a file, eg vim .bashrc, vim opens the file and change the first letter to g. What I see is the following:
g To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
...
I change g back to #, but after loading the file its again changed. Happens with multiple files.
Last things I have done was: installig gcc and make.
Why is this happening?
EDIT:
My .vimrc file:
set nocompatible
set backspace=indent,eol,start
set number
set tabstop=4
syntax on
I had the exact same problem
I found out it was a bug in my ssh client (mobaXterm).
Updating (to mobaXterm 'personal edition v9.1') resolved the issue.
I am using vim on Ubuntu Linux 16.04 via MobaXterm version 7.7. This is an older version of MobaXterm that supports command-line-settable terminal background colors.
The following change to my .bash_profile solved this problem for me:
# Fix for Vim 8.0 bug that stomps on line 1 char 1:
export TERM=linux
Strange enough, but it works for me. I created a ~/.vimrc file:
syntax on
set background=dark
The 2nd option disable the bug.
So it appers to be a vim issue. So far I gathered only two solutions:
Reinstall to older version of vim. i reinstalled to 7.4.752-1 and bug is gone.
Change cygwin terminal to anyone but "xterm*" (right-click on title bar -> Options... -> Terminal -> Type)
For me, I traced the issue down to the following line:
set nocompatible
It is found in /usr/share/vim/vim74/debian.vim, which is included from /etc/vim/vimrc with the line runtime! debian.vim
make sure you dont set the visual bell in your .vimrc
set visualbell
in case you have it then just delete it :)
The exact same thing was happening to me! It wasn't occurring in gvim, so I thought maybe something was going on in my .vimrc. I zeroed-out my .vimrc but it was still happening. Only when I completely deleted my .vimrc did this behavior stop. As suggested,I rolled back to an older version (7.3.1152-1) with cygwin setup and that fixed it. I did not have to change any terminal settings, however. It makes sense because I updated cygwin yesterday, when I started seeing the errant g's.
I am on ArchLinux. vim 8.0.0987-1 always decreases a number upon opening a file (as if xtrl+x pressed). Downgrade to 8.0.0722-1 fixed the issue.

Backspace in zsh fails to work in quite the strange way

I'm on a fresh Virtualbox install of CentOS 6.4.
After installing zsh 5.0.2 from source using ./configure --prefix=/usr && make && make install and setting it as the shell with chsh -s /usr/bin/zsh, everything is good.
Then some time after, after installing python it seems, it starts acting strange.
Happens with PuTTY and iTerm2 over SSH, does not happen on the raw terminal through Virtualbox.
typing something, then erasing it: rather than removing the char and moving the cursor back, the cursor moves forward.
Typing Ctrl+V then Backspace repeatedly prints out this repeating pattern '^#?'
Running cat from zsh works fine. Prints out '^H' if I type that, backspaces like normal if I type normal backspace.
Surely someone's seen this before and knows exactly what the hell it is.
I'm not positive yet, but it seems that installing oh-my-zsh can fix this. But I really want to know what the specific issue is here.
OK , I suggest you try
export TERM=xterm
in your .zshrc configuration
the Changing into Zsh caused the bug.
sigh I knew I solved this before.
It's too damn easy to forget things.
The solution is to compile and apply the proper terminfo data with tic, as I have a custom config with my terminal clients, xterm-256color-italic, that confuses zsh.
There appear to be other ways to configure this stuff too; I basically just need it to be properly set up so italics work everywhere (including in tmux) so hopefully I can figure out how to do this more portably than I am currently.
I encounter the same problem when I manually install ZSH without root, when the backspace turns to blankspace but still functions as Backspace. Finally, I find it is because "ncurses" is not installed well.
tic: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory
? tic could not build /home/user/ceph-data/soft/ncurses-6.1/share/terminfo
After I reinstall the "ncurses", the problem of ZSH backspace is solved. Just for your information.
my $TERM is xterm-256color, by the way.

CYGWIN=nodosfilewarning doesn't help cygwin warning

When I try to use ediff-revision under Emacs 23.2.1 for a CVS-managed file, I receive the following error in the *ediff-errors* frame, instead of commencing directly to the ediff results:
cygwin warning:
MS-DOS style path detected: c:/Users/BILL/AppData/Local/Temp/misc.cpp.~1.10~
Preferred POSIX equivalent is: /cygdrive/c/Users/BILL/AppData/Local/Temp/misc.cpp.~1.10~
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
My problem is that I have already set that CYGWIN environment variable option "nodosfilewarning", so I have no idea why I am receiving this error.
In fact, I can verify this right from an inferior shell under the same Emacs instance:
> set | grep -i nodos
CYGWIN=nodosfilewarning
I am running Cygwin 1.7.9-1 under Windows 7, in case this may be relevant (and I never had this problem before upgrading from Cygwin 1.5 to 1.7).
Any idea how to get rid of this error?
P.S. A subsequent call to ediff-revision succeeds without triggering this warning.
The CYGWIN variable is parsed when the first process in a Cygwin process tree is invoked. Hence, setting it in .bashrc or something like that is too late. A good place to set it is in the global Windows environment, under Control Panel->System->Advanced->Environment Variables.
I added (setenv "CYGWIN" "nodosfilewarning") to setup-cygwin.el. That seems to take care of the problem without, AFAICT, creating other problems. I also filed Emacs bug #14541 for this.
From within emacs, you may also:
M-x setenv
CYGWIN
nodosfilewarning
as an immediate alternative to altering setup-cygwin.el.

ANSI color support using Groovy on Windows XP

Trying out the examples found on pleac.sf.net, I'm not able to get an example of ANSI colors to work on my WinXP box (Works fine on MacOS). What I've found is that on my WinXP machine, in both cygwin & DOS prompts, groovysh --color (and 'groovysh --terminal=unix') shows escape codes rather than the expected colored prompt. grep --color works just fine in the cygwin terminal. I can't find anything obvious that I'm doing wrong. Any ideas?
Note: I'm using Groovy 1.6.0
Update: I've tried adding ANSI.sys to my config.nt mentioned here Groovy-dev Mailing List but it didn't fix the problem (tried rebooting too).
I have the same problem, my solution is ugly but simple: Pipe groovy output to cygwin cat.exe
Suppose your script red.groovy is:
println "\u001B[31mI'm Red\u001B[0m Now not"
Then from command shell
groovy.bat red.groovy | cat
will display the right colors.
Of course you can write your own native code that handle the ANSI codes.
The thing is, you'd have to add DOSONLY to your CONFIG.NT as well to make the ANSI.SYS driver work, and then it would only work for COMMAND.COM which emulates DOS 5.0. Regular Command Prompts (CMD.EXE) do not support ANSI colors at all, afaict.
I don't know much about how cygwin handles it.
The Groovy site says to do this for cygwin:
groovysh --terminal=unix
For the winxp command shell, as far as I know, there is no ANSI support at all, not even with ansi.sys. Colors are supported through some MS API only.
A workaround in cygwin is to launch xterm or rxvt and run it there.

Resources