Re: make bbedit default edit

67 views
Skip to first unread message

Herbert Schulz

unread,
Jun 13, 2012, 6:46:45 PM6/13/12
to bbe...@googlegroups.com

On Jun 13, 2012, at 5:35 PM, bobPCL wrote:

> I had the command export EDITOR="/usr/bin/edit" in a .profile. I changed
> this to both /usr/bin/bbedit and just bbedit, and got the error -bash:
> edit: command not found
>
> I removed the line from .profile and made a .bashrc and put in the command
> both ways. Same error.
>
> I can run bbedit as "bbedit file.name" from the command line and it works.
>
> Can someone please explain how to make bbedit the system default editor as
> opposed to vi or vim or whatever it is trying to use?

Howdy,

Run

which bbedit

and use that. It's /usr/local/bin/bbedit on my system.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)



bobPCL

unread,
Jun 13, 2012, 8:01:22 PM6/13/12
to bbe...@googlegroups.com
tried that, doesn't work, which give /usr/bin/bbedit

Steve Kalkwarf

unread,
Jun 14, 2012, 8:30:55 AM6/14/12
to bbe...@googlegroups.com
On Jun 13, 2012, at 6:35 PM, bobPCL wrote:

> I had the command export EDITOR="/usr/bin/edit" in a .profile. I changed this to both /usr/bin/bbedit and just bbedit, and got the error -bash: edit: command not found

After adding the line

export EDITOR="bbedit -w --resume"

to .profile, you need to open a new terminal window before it takes effect. Did you do that?

Steve

Robert Sica

unread,
Jun 14, 2012, 9:00:18 AM6/14/12
to bbe...@googlegroups.com
Yes I did. I got it working in .bash_profile.

Did not use -w --resume. Should I? Why?


Maarten Sneep

unread,
Jun 14, 2012, 9:14:07 AM6/14/12
to bbe...@googlegroups.com
Robert Sica schreef op 2012-06-14 15:00:
> Yes I did. I got it working in .bash_profile.
>
> Did not use -w --resume. Should I? Why?

vi will not return until the file is saved and you quit the editor.
Some other tools will rely on this behaviour, notably many revision
control systems (mercurial for sure). If you call bbedit without --wait
--resume the tool will return immediately, and the commit will not take
place, as the comment has not been written at that stage.

Some tools don't work with the arguments in the command (i.e. the
spaces will trip them). In that case a simple shell wrapper script might
do the trick (or even a shell function, but I never tried that).

Best,

Maarten

Alex Satrapa

unread,
Jun 14, 2012, 7:21:22 PM6/14/12
to bbe...@googlegroups.com
I have the following in my .zshrc:

EDITOR="/user/bin/bbedit -w --resume"
VISUAL="/user/bin/bbedit -w --resume"

This works fine for Subversion and git. I do not know that this will work for bash, but I expect that it will. Some shells will prefer that you use single quotes (') rather than double quotes (").

HTH

On 14/06/2012, at 23:14, Maarten Sneep <maarte...@xs4all.nl> wrote:

> Some tools don't work with the arguments in the command (i.e. the spaces will trip them). In that case a simple shell wrapper script might do the trick (or even a shell function, but I never tried that).

Alex Satrapa | web.mac.com/alexsatrapa | Ph: 0407 705 332
Reply all
Reply to author
Forward
0 new messages