• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved Setting default editor in zsh

geekosupremo

New Member


Messages: 1

#1
To start with I installed editors/micro from pkg. I run micro [my_file_name] and it responds as expected. Since I find `micro` to be a bit of an upgrade from `ee` I want to set it as my default.

The results of my searching were to add the following line to my `~/.zshrc`
Code:
[DEL]export EDITOR=/usr/local/bin/{editor_of_choice}[/DEL]
# Spotted the flaw in the above line too it should be like below

export EDITOR="/usr/local/bin/micro"  #subtle difference but the quotes matter.
I log out of my session, start it again and give it the `edit my_file`, and instead of my prefered editor I am in ee.

I am on 11.1-RELEASE-p6 and pkg is up to date.

Also apologies if this should be in a different grouping.

-- Edit --

When I run chsh it does drop me into micro for the edits. But the edit short cut still goes to ee.

Ah! I did man edit and it turns out that's a command to call ee! :faceplam:

So I set my own alias to make edit point to micro.