Skip to content

Instantly share code, notes, and snippets.

@volkbay
Created March 1, 2025 20:24
Show Gist options
  • Save volkbay/3b094dc650aca07d0434b9d2e95bac72 to your computer and use it in GitHub Desktop.
Save volkbay/3b094dc650aca07d0434b9d2e95bac72 to your computer and use it in GitHub Desktop.
Solution for undetectable cursor due to highlighting in the Gedit text editor.

πŸ‘Ύ Error

In Ubuntu's standard text editor (Gedit), it is hard to spot the cursor on the current line.

πŸ€” Why do I see this error ?

The cursor color and the highlighting match, so it is not possible spot the cursor position. The system probably is in the dark theme mode.

πŸ”Ž How to solve ?

By tweaking 'Preferences', there two options: i-) Disable 'Preferences>View>Highlight current line'. But this method makes the editor to lack of a nice functionality. ii-) Change color themeb by 'Preferences>Font & Color>Color Scheme'. This is the preferable solution. iii-) But if you open your text editor by root (sudo gedit), the former solutions will not work. In fact, changing preferances is not possible in this case. The simplest way is to change hightlight color from configutarion file.

πŸ•ŠοΈ Solution

sudo gedit <your-file>  # Problem: Cursor not detectable
sudo gedit /usr/share/gtksourceview-4/styles/tango.xml

From the popped editor, find the below line.

<color name="aluminium1"                  value="#eeeeec"/>

Then, change it to a non-matching color with the cursor.

<color name="aluminium1"                  value="#99999c"/>

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