Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Where does eselect editor pick up its options?
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message

Joined: 03 Jun 2012
Posts: 735
Location: Tokyo, Japan

PostPosted: Sat Jun 21, 2014 6:53 am    Post subject: Where does eselect editor pick up its options? Reply with quote

I wasn't sure if this question should have gone in Desktop Environments or Portage/Programming sub-forum. Moderators please feel free to move if this is the wrong place.

I would think it would be something easy to accomplish but I've been having a devil of a time setting my default text editor. To date I have been using nano in my terminal emulator which I am quite happy with but have been recently playing with sublime 3 which so far I like quite a bit so would like to make it my default.

I run two Desktop Environments. KDE and XFCE4. In both DE's system setting I am not given any options in the appropriate drop-down menu to select another text editor.

I see it can be done in
eselect editor
but I am only given the options
/bin/nano, /bin/ed, and "freeform"
. Freeform does not give a select number so I am not sure how it is used exactly.

I have a number of text editors on my system so I am hazarding a guess that eselect only picks up editors that are in /bin?

Based on this wiki I added sublime to
and can now see it in eselect list but the wiki states that eselect writes to that config file. Does this mean eselect will overwrite my manual edits? If so how do I add additional selections to eselect editor?

Also when I set it as sublime it doesn't seem to take. Any document I try to open prompts me to use notepad which I find odd given nano is the default now.

How do I set my default editor system wide?
Back to top
View user's profile Send private message

Joined: 02 May 2003
Posts: 7368

PostPosted: Sat Jun 21, 2014 1:37 pm    Post subject: Reply with quote

There's not really default editor as you think. The choice to pickup an editor as default editor is limit to what editor portage tools should use if they need one (because i don't even have real example to backup this! maybe some tools like etc-update can made use of that)
So if you set nano as default editor, maybe some portage tools will use nano, but DE default editor is influence by DE default editor selection ; not the one eselect provide you.
You seems shock clicking on file open notepad, but not shock notepad isn't list in your eselect editor list :)
I don't use XFCE4 or KDE but did you try to right click a file and display options, i think editing/viewing file options should be there and so you can change what program to use when user double-click on that mime type. Some DE have also "default program" options to set that.

If you really insist on providing choice of editors with eselect, i think the list should be taken from the virtual/editor.
So add your custom program to package.provide as virtual/editor and eselect should list it. Once done, select it, and "eselect editor update" should create/update the env.d file for you.
But at end, using X or Y as default editor set in eselect, user will need to type X or Y to run it ; and even X is default, if user type Y, Y will be run.
To sum-up : eselect editor is useless or at best of poor usage.
Back to top
View user's profile Send private message

Joined: 07 Sep 2004
Posts: 158
Location: Italy

PostPosted: Sat Jun 21, 2014 2:16 pm    Post subject: Reply with quote

My understanding (please correct me if I'm wrong) is that 'eselect editor' is used to set the EDITOR environment variable, which is used by some command line programs to know which external editor to use when text editing is needed (some use the VISUAL variable, too).
I think that setting this variable to a GUI IDE is not a good idea. At least you should leave the system wide EDITOR to something basic like nano and set the variable to whatever you want in your user's ~/.profile, if you really need it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum