What is this gVim warning and how to eliminate it? - vim

In Ubuntu 10.04 (as a Virtual Machine), I open gVim from command line but every time I switch from terminal to vim and back I see the following warning:
** (gvim:13790): CRITICAL **: murrine_style_draw_box: assertion 'height >= -1' failed
Why do I get this warning and how do I get rid of it?
The installation (via software center) is pretty much unmodified, except the addition of ~/.vimrc:
source $VIMRUNTIME/mswin.vim
behave mswin
set hls

It's a bug in the theme package(s). Resolution here: https://bugs.launchpad.net/ubuntu/+source/light-themes/+bug/538499/comments/24
Modify the entry in /usr/share/themes/YOUR THEME IN USE/gtk-2.0/gtkrc from GtkRange::trough-under-steppers = 0 to GtkRange::trough-under-steppers = 1
HTH

Related

Changes to Gedit through gsettings seem to be ignored

I'm trying to use gsettings to change some of my Gedit settings (Ubuntu 20.04), but my changes seem to be ignored by Gedit. For example, when I change the tab width through
gsettings set org.gnome.gedit.preferences.editor tabs-size 4
my new tab width does show up in
gsettings list-recursively | grep gedit
but when I open anything in Gedit, it's still using the default tab width of 8.
In this example case this isn't much of a problem, as I can change the tab width from the Gedit GUI as well, but other settings, such as right margin position, don't seem to be in the Gedit Preferences menu.
When I tried to sudo the gsettings command I got this error:
(process:4742): dconf-WARNING **: 08:03:40.804: failed to commit changes to dconf: Error spawning command line “dbus-launch --autolaunch=0d66e8250a634e9d8ee4675ca3d977fa --binary-syntax --close-stderr”: Child process exited with code 1
So what would be the correct way to use gsettings here?
Alright, after a good bit of additional searching I found this:
https://askubuntu.com/questions/491217/how-change-gedit-preferences-in-xfce-xubuntu#491296
So apparently (at least part of) my problem is that I'm using the Xfce desktop (I'm usually working over a VNC connection). I'm not sure exactly why/how this causes Gedit to ignore settings changed through gsettings, but installing dconf-editor and changing Gedit's settings there did the trick for me.

Moved to 64-bit Cygwin/X11 after 4 years, getting xterm & gvim errors

I just upgraded to the current 64-bit Cygwin and X11 from old 32-bit versions from 2015. I'm getting some X-windows errors. The shortcut that starts X11 runs the following:
C:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; /usr/bin/startxwin"
My ~/.startxwinrc is:
xrdb -load $HOME/.Xresources
xterm
I much prefer this over the default starting of X-windows in the absence of ~/.startxwinrc, which requires mousing down to the XDG icon in the system tray to popup a nested menu tree (especially since I'm always using a touchpad rather than a mouse).
xterm error messages
The above works fine, but if I issue the xterm command from an mintty terminal or xterm, I get the following message when the x-terminal appears:
xterm: cannot load font "-Misc-Fixed-bold-R-*-*-13-120-75-75-C-120-ISO10646-1"
The funny thing is, there is no such font in my Xresources file or the system Xresources file.
Very old ~/.Xresources:
xterm*font: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
xterm*font1: -*-lucidatypewriter-medium-r-*-*-11-*-*-*-*-*-*-*
xterm*font2: -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
xterm*font3: -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1
xterm*font4: -*-lucidatypewriter-medium-r-*-*-14-*-*-*-*-*-*-*
xterm*font5: -b&h-lucidatypewriter-bold-r-normal-sans-14-*-*-*-m-*-*-*
xterm*font6: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
xterm*toolBar: false
! XTerm.toolBar: false
xterm*toolBar: false
!xterm*background: DarkBlue
xterm*background: rgb:00/00/66
xterm*foreground: White
Grepping the system Xresources file(s) yield nothing:
grep -i 13-120-75-75-C-120-ISO10646-1 /etc/X11/app-defaults/XTerm
grep -i 13-120-75-75-C-120-ISO10646-1 /etc/X11/app-defaults/*
gvim error messages
In addition to the mysterious xterm font problem, I get the following error starting gvim:
$gvim ~/tmp/tmp.txt
Can't resolve "wglCreateContextAttribsARB"
libGL error: required WGL extension WGL_ARB_multisample is missing
libGL error: required WGL extension WGL_ARB_multisample is missing
** (gvim:2058): WARNING **: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
The initial 3 lines only appear on the first invocation of gvim, while the last line (gvim WARNING) appears every time gvim is invoked, though with a different 4-digit number each time. These errors do not occur if I simply run vim. The errors do show up regardless of whether I have a custom /etc/vimrc or not (my vimrc runs slightly different code depending on whether it is called from vim or gvim). The closest thing I could find online to the gvim error is at this page, though it has to do with another app (and the cause is not tracked down).
Commonalities, and my 2 questions
The xterm font error and the gvim errors seem to be independent of whether I rely on default startxwin behaviour or on my ~/.startxwinrc. Depending on whether I launch xterm or gvim from the command line or the XDG menu, the error messages show up as bash shell command output or in ~/.xsession-errors.
Has anyone else observed this behaviour?
Can anyone suggest what else I can do to toubleshoot?
(I am not that familiar with X-11, as I am a a data analyst rather than a software developer.)
Addendum: I reinstalled all of the cygwin packages. The problem remains.
Addendum: Here are the font-like packages that I have installed:
$ cygcheck -c | grep -i font
adobe-source-code-pro-fonts 1.017-2 OK
dejavu-fonts 2.37-1 OK
fontconfig 2.12.6-1 OK
ghostscript-fonts-other 6.0-1 OK
inconsolata-fonts 1.010-1 OK
libfontconfig-common 2.12.6-1 OK
libfontconfig1 2.12.6-1 OK
libfontenc1 1.1.3-1 OK
libXfont2_2 2.0.3-1 OK
terminus-fonts 4.40-1 OK
texlive-collection-fontsextra 20180414-1 OK
texlive-collection-fontsrecommended 20180414-1 OK
urw-base35-fonts 20170801-5 OK
xfontsel 1.0.5-1 OK
xorg-x11-fonts-cyrillic 7.5-3 OK
xorg-x11-fonts-dpi100 7.5-3 OK
xorg-x11-fonts-dpi75 7.5-3 OK
xorg-x11-fonts-ethiopic 7.5-3 OK
xorg-x11-fonts-misc 7.5-3 OK
xorg-x11-fonts-Type1 7.5-3 OK
The six packages starting with "xorg-x11-fonts-" are the only six shown by the Cygwin setup executable.

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.

Cannot load CoqIDE plugin for vim

I'm trying to use the CoqIDE for vim plugin I found on this page.
I put the coq_IDE.vim file in ~/.vim/ftplugin folder. My current .vimrc file is:
set showcmd
set number
imap hl <Esc>
filetype plugin on
But when I start vim CoqIDE doesn't load automatically (I see no change whatsoever compared to normal vim, so I don't think it did). And when I try to load it manually by the command :source coq_IDE.vim, I get the following error message:
E484: Can't open file coq_IDE.vim
What could be the source of this error?
Here are some additional information that might be relevant:
1) I am running Ubuntu 14.04.
2) I checked that :version in vim shows +perl.
2) I am running vim from terminal, not gvim.
3) I tried removing and reinstalling different versions of vim (vim, vim-gtk, vim-gnome)
4) The CoqIDE installation guide says that coqtop.opt should be accessible via the PATH variable. Since I'm not even sure what this means, this might be the problem here, but that seems unlikely. From what I understand vim is getting errors when trying to read coq_IDE.vim, so it's not even getting to the part where it's looking for coqtop.opt.
5) I have CoqIDE installed from Ubuntu Software Center.
6) With :echo &runtimepath I get: ~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after
The instructions are bad.
Put the file in ~/.vim/plugin not ~/.vim/ftplugin
The file layout should look exactly like the file layout found in this mirror for the plugin. https://github.com/vim-scripts/CoqIDE. (Maybe take a look at pathogen or vundle,).
The reason the :source coq_IDE.vim fails is vim is looking for the file coq_IDE.vim in the current directory and it isn't there. Use the full path to file if you are going to source it manually. (You shouldn't need to though.)

Why is vim syntax highlighting on different terminals?

I am running a standard installation of OpenSuse 42.3. I ssh to the Opensuse machine via my MacOS computer. When I use vim to view files in the terminal window the syntax highlighting is pleasant to look at. I also have a Docker image of a stock installation of OpenSuse 42.3 installed on my OpenSuse machine. If I boot up the container and open a python file with vim within the container, the syntax highlighting looks different. I did a diff on the contents of the /usr/share/vim/vim74/syntax/python.vim, and there were no differences between the syntax file that is being used on the OpenSuse host and the OpenSuse container.
Below on the left is what I see when I ssh from my Mac to the OpenSuse machine and open a python file. On the right is what I see when I start the docker container ( still in the same terminal window that I started for the image on the left).
Shouldn't the display on the terminal window of the syntax highlighted file be the same if the vim syntax files are the same?
The highlighting in the terminal can depend on the number of available colors. Some colorschemes have separate branches of color definitions depending on how many are available. You can check for yourself via
:set t_Co?
You probably get 256 for TERM=xterm-256color and only 16 for TERM=xterm.
Though you can just force :set t_Co=256 and reload your colorscheme, it's better to fix the root cause, i.e. the wrong TERM value.

Resources