Software⏱️ 3 min read📅 2026-06-11

How to Fix: Error highlight in Vim makes text unreadable

Fix error highlighting issue in NeoVim with Solarized terminal theme

Quick Answer: Adjust the highlight color by modifying the URxvt.termName setting to use a different terminal emulator or adjust the highlight colors defined in ~/.Xresources

Error highlight in Vim makes text unreadable

This issue affects NeoVim users who have configured Solarized terminal theme but not matched Vim theme, leading to compiler warnings being highlighted in the same color as the text, causing frustration when viewing C code.

💡 Why You Are Getting This Error

  • The primary cause of this error is that the Vim highlight group for compiler warnings is not properly set up. The Solarized terminal theme provides a range of colors, but none of them are assigned to the highlight group.
  • Another possible reason is that the Xresources file is not correctly configured or is missing the necessary settings.

✅ Best Solutions to Fix It

Editing the Vim theme

  1. Step 1: Open your .vimrc or init.vim file in a text editor and add the following line to set the highlight group for compiler warnings: `highlight Warning ctermbg=238`
  2. Step 2: Replace 238 with the desired color code from the Solarized theme definitions. You can refer to the provided Xresources file for available colors.
  3. Step 3: Save the changes and restart NeoVim or reload the configuration by running `:so %`

Editing the Xresources file

  1. Step 1: Open your .Xresources file in a text editor and add the following lines to configure the highlight group for compiler warnings: `highlight Warning *ctermbg=238`
  2. Step 2: Replace 238 with the desired color code from the Solarized theme definitions. You can refer to the provided Xresources file for available colors.
  3. Step 3: Save the changes and apply them by running `xrdb -merge %`

✨ Wrapping Up

To resolve this issue, you have two primary fix methods: editing your Vim theme or editing your Xresources file. By following these steps, you should be able to set up the correct highlight group for compiler warnings and improve your text readability.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions