Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

5300cs

macrumors 68000
Original poster
Nov 24, 2002
1,862
0
japan
To everyone who loves vi, sorry.

I want to change my default editor to something else, like pico or emacs. Does anyone know how to do this?
 
Re: Re: Default editor, switching from vi

Originally posted by Westside guy
You mean other than by typing "emacs" at the command line intead of "vi"? :D

I mean like when I type 'chfn' it opens the file in vi, which I don't like. I want to change my default editor.
 
Simply type "setenv EDITOR <editor>", replacing <editor> with emacs, for example.

edit: my reply was incorrect, as the changes woold only affect the current terminal window. In order for the changes to be permanent, create a file in your home directory named .tschrc , and enter the line mentioned above. Any commands you enter in this file will be automatically executed every time you open a new terminal session.
 
colocolo

Well, it depends on which shell he's using, doesn't it? You're correct for tsch. For bash you'd edit .bash_profile in your home directory and add the following line:

export EDITOR=<full_path_of_editor>
 
Originally posted by colocolo
You are right, I just assumed he was using the Terminal.
Using Terminal doesn't == tsch. In fact, bash is the default shell when you use Terminal under Panther, and you could always change Terminal to start a bash shell under Jaguar.
 
Originally posted by daveL
Using Terminal doesn't == tsch. In fact, bash is the default shell when you use Terminal under Panther, and you could always change Terminal to start a bash shell under Jaguar.

hmmm... under Jaguar I was able to switch to bash no problem. Panther for some reason, has made it more difficult.
 

Attachments

  • shell.jpg
    shell.jpg
    29.3 KB · Views: 2,990
Originally posted by 5300cs
hmmm... under Jaguar I was able to switch to bash no problem. Panther for some reason, has made it more difficult.
Are you looking to change your default shell or just on an as needed basis? If you want to change your default shell, go to Utilities and start up Netinfo Manager, select "users", then your login name, unlock the panel, then scroll down to the "shell" property and change it to the shell you want. After you apply the change, all your Terminal sessions will use the selected shell.

If you just want a temporary shell change, I use "exec bash" (substitute your desired shell for "bash"). When you exit that shell, you'll normally exit the Terminal.

HTH
 
Originally posted by daveL
...go to Utilities and start up Netinfo Manager, select "users", then your login name, unlock the panel, then scroll down to the "shell" property and change it to the shell you want...

Well, that answered my next question :) Thanks! ( I knew how to do it in Server...)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.