How to change the default text editor ?

Gary W. Swearingen garys at opusnet.com
Thu Apr 6 16:42:37 UTC 2006


Adam Funk <a24061 at yahoo.com> writes:

> On 2006-04-06, Chris Peterman <kyral at ubuntu.com> wrote:
>
>> EDITOR =3D <command for editor>
>> export EDITOR
>>
>> to have it set everytime put those in your ~/.bashrc or
>> ~/bash_profile
>
> I do this with one line in ~/.bashrc
> export EDITOR='emacs -nw'
>
> Doesn't that have the same effect as the two-line version?

It doesn't work with some shells, but does with any POSIX shell, AFAIK.

Worse, it moves the variable name away from the left margin, tending
to hide it (unless you always manage to colorize it).

This is a long-standing pet peeve of mine about language syntax.
What's the most important thing about almost every programming
statement?  The name of some thing, which, for good readability,
should be at the left margin. When I'm scanning code, I seldom look
for "export" or not export or for some variable type like "integer" --
I'm looking for a name, and it would be nice to have it at the left
margin.  All declaration and assignment statements, at least, should
begin with the name of a thing being declared or changed.  A lot of C
code really hides declarations.


Somefun = function
   Some_Value = integer ( 43 * 100 )
   Otherfun = integer function ( Input_Arg )
       return ( Input_Arg * 100 )
   return ( Otherfun ( Some_Value ) )

So I sometimes use the form

EDITOR=xemacs; export EDITOR

or

   export \
EDITOR=xemacs




More information about the ubuntu-users mailing list