7

I'm using Ubuntu 14.10-gnome3.14. Here is the question. when I check the "highlight current line" check-box on the gedit, it highlight the current line, but the color is pure white I can barely see the code. So, how can I change this.

I don't mean to change the syntax highlight style, just change the "highlight current line" color.

Issouf
  • 3
  • 2
Seth Lee
  • 241
  • 2
  • 3
  • 8

2 Answers2

11

I have 14.04, but gedit over there has an option to change color scheme --- the preferences menu is quite hidden (at least in gnome-shell), you have to go on the panel menu to find it:

finding the preference menu entry

(will be different in Unity), and then:

change color scheme in gedit

and all your color scheme will change. In the shot above, I choose "kate".

If you want to change just the color of the highlight line (for example), you should edit the style; in principle that should be easily done by changing the file

/usr/share/gtksourceview-3.0/styles/kate.xml 

(reference here) and change the line

<style name="current-line"                background="#EEF6FF"/>

to your liking. Unfortunately, it doesn't work --- if anyone know why please chime in.

Rmano
  • 31,947
  • My XFCE had styles in /usr/share/gtksourceview-3.0/styles/ and also /usr/share/gtksourceview-2.0/styles/, for whatever reason it was using the 2.0 ones as the "defaults", and it wouldn't change them unless I added the just-edited kate.xml file (it wouldn't make a new Kate entry, but put the new one "on top of" the old one). And deleting the "new" Kate worked too, so it would re-read the old file & "reset" kate... kind of finicky. – Xen2050 Jan 19 '15 at 14:00
  • Hi,Thx all above. Im using gedit3.14,so I don't have the GUI to change the color scheme from the gedit Preferences. But Rmano, u inspired me, so I changed the color scheme from the dconf-editor. But, when I wrote my own xml scheme file and put it into /usr/share/gtksourceview-3.0/styles/, it didn't work,even when I deleted the system default scheme xmls in /usr/share/gtksourceview-3.0/styles/, I still can use the kate oblivion...scheme etc. And not like Xen2050, I don't have the/usr/share/gtksourceview-2.0/styles/ folder,so my gedit is must using the scheme xml from somewhere else, Please Help – Seth Lee Jan 19 '15 at 15:37
  • @SethLee, I too have just the 3.0 version and gedit ignores me completely. Finding the preferences was complex --- I use gnome and you can only find them under the panel menu (will add a shot). But if this another configurability that gnome decided to take away, my only solution is to change to another editor, as I did (using vim/gvim now, but kate or geany are quite good too). – Rmano Jan 19 '15 at 17:51
  • @Rmano, Thx, last time I replied u, the first picture u sent is broken, it finally appeared this time, so I ve found the preference option. But the new question is I change the xml file in the /usr/share/gtksourceview-3.0/styles/ but it didn't work, and when I want to add my own scheme through the Preference Font&Color and it replied that "The selected color scheme cannot be installed". what's wrong with it? could u help my ^_^. – Seth Lee Jan 21 '15 at 02:06
  • @SethLee, as I said in the answer, it neither works for me --- I don't know why. It really smell as a bug to me; feel free to report it – Rmano Jan 21 '15 at 10:07
  • @Rmano Hi, I still don't know to add my own scheme by edit xml file, but I find another way to add and use ur own scheme.
    1.open Ubuntu Software Center, search gedit
    2.add optional add-ons "A Set of gedit plugins for developers"&"set of plugins for gedit"
    3.enable the add-ons from gedit preference, especially "Color Scheme Editor"
    4.edit ur own color scheme for gedit and save.
    all done.
    

    So, if u want use your own scheme, try this.^_^

    – Seth Lee Jan 22 '15 at 06:46
1

I've already find a way to solve this problem.

1.open Ubuntu Software Center, search gedit
2.add optional add-ons "A Set of gedit plugins for developers"&"set of plugins for gedit"
3.enable the add-ons from gedit preference, especially "Color Scheme Editor"
4.edit ur own color scheme for gedit and save.
all done.

but there is still a question: I search the /usr/share/gtksourceview-3.0/styles/ folder, can not find my own scheme file that I just create. Where did the system store the scheme file for gedit???

Seth Lee
  • 241
  • 2
  • 3
  • 8
  • You can try do a full search of the file system with find / -name "yourschemename*" -print... it should print something. – Rmano Jan 22 '15 at 10:56