Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.