Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined color nord0 #9

Open
cimm opened this issue Feb 5, 2020 · 2 comments
Open

Undefined color nord0 #9

cimm opened this issue Feb 5, 2020 · 2 comments

Comments

@cimm
Copy link

cimm commented Feb 5, 2020

I am seeing the following error when I launch Vim via the terminal (well, I see it when I close Vim but I guess it's loaded when opening it). I am using Gnome Terminal with the .Xresources file from nord-xresources.

Warning: Color name "nord0" is not defined

It's related to line 27 line in the .Xresources file: *.background: nord0 but I can't tell what's wrong with that, the color is correctly defined higher up in the same file.

Any ideas?

@arcticicestudio
Copy link
Contributor

Hi @cimm, this sounds like a weird bug and also includes three possible sources that might cause the problem. I did a quick research and found some other bug reports in different projects as well as the Ubuntu ticket system. The problem described in w0ng/vim-hybrid#3 comes very close to your description. It looks like this might be caused by a change in one of the newer Ubuntu releases where the GNOME Display Manager /etc/gdm/Xsession (package gdm3) is configured to load the ~/.Xresources files using the -nocpp flag which disables the loading of #define statements. So it reads the first line (which is actually nord0) and fails due to the this parser configuration. Looks like a tricky root cause where someone spend a lot of time debugging the data flow 😮

Anyway, the solution for your problem is relatively simple:

  1. There is absolute no need for you to use or even create the ~/.Xresources file when using GNOME terminal. It won't even look after this file since it stores it configuration via Gsettings. The .Xresources is more a kind of relic from older terminals like xterm that, like the name states, is part of the X Window System. To use Nord with GNOME terminal you can simply install the official Nord GNOME Terminal theme instead and you're ready to go with all the colors.
  2. To prevent the warning message to show up you can simply delete, rename or move the ~/.Xresources file provided you're not using it for other X apps or terminals for sure.
  3. To use Nord for Vim you can again install the official Nord Vim port project and it'll automatically use the colors provided by the Nord GNOME Terminal theme you've installed in step 2.

I hope this helps to understand the root cause and fixes the problem on your side. Let me know if there are other problems or when its working for you.

@jonassvedas
Copy link

A hack to get this working for those who use xterm: you can preprocess the resources file yourself with a C compiler. Source: https://bbs.archlinux.org/viewtopic.php?id=230696

cpp -P .Xresources > /tmp/xres
xrdb -merge /tmp/xres

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants