Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

EDIT I thought of a better way to phrase the question.

How can I find the alias that Ubuntu is using for a different text editor? Rather than using nano by typing nano file.txt, i'd like to be able to type sublime file.txt to open sublime editor. I don't know where to look to find these aliases.

sudo update-alternatives --config editor does not show it as a choice, I only see the 'default' editors, like Nano and vim.tiny.

share|improve this question

If your file is identifiable as a text file then passing it to xdg-open will open it in your text editor. If it identifies as some other type though, it will open the file in the appropriate application instead.

EDIT:

xdg-mime query default <mimetype> will give you the .desktop file for the application associated with a MIME type. From there you need to parse the file to get the executable name from it.

share|improve this answer

you can use

export EDITOR=vim or nano or any editor name

or copy this line and write in .bashrc or .profile file

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .