Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
change default editor to bbedit
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  14 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Rich Siegel  
View profile  
 More options Jun 13 2012, 7:05 pm
From: Rich Siegel <sie...@barebones.com>
Date: Wed, 13 Jun 2012 19:05:51 -0400
Local: Wed, Jun 13 2012 7:05 pm
Subject: Re: change default editor to bbedit

On Wednesday, June 13, 2012, bobPCL <b...@purplecrowlidar.ca> wrote:
>"-bash: edit: command not found".

"edit" is not a bash command. You can invoke BBEdit using
"bbedit"; but the EDITOR variable is used by other programs to
invoke your preferred editor, and has no bearing on what you can
(or can't) do at the command line.

R.
--
Rich Siegel                                 Bare Bones Software, Inc.
<sie...@barebones.com>                      <http://www.barebones.com/>

Someday I'll look back on all this and laugh... until they
sedate me.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bobPCL  
View profile  
 More options Jun 13 2012, 8:04 pm
From: bobPCL <b...@purplecrowlidar.ca>
Date: Wed, 13 Jun 2012 17:04:07 -0700 (PDT)
Local: Wed, Jun 13 2012 8:04 pm
Subject: Re: change default editor to bbedit

Thanks for the response, sorry I wasn't clear. What I'm trying to do is use
a command line window (e.g. terminal) and type the word "edit" and get
bbedit to open. I have another script I want to run that using the
default environment editor, which is currently not bbedit.

So do you (or anyone) know how to make bbedit the "preferred" editor?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
François Schiettecatte  
View profile  
 More options Jun 13 2012, 8:08 pm
From: François Schiettecatte <fschietteca...@gmail.com>
Date: Wed, 13 Jun 2012 20:08:38 -0400
Local: Wed, Jun 13 2012 8:08 pm
Subject: Re: change default editor to bbedit
Bob

Works for me:

macpro: ~ > which bbedit
/usr/bin/bbedit

in .bash_profile :

#export EDITOR='vi'
export EDITOR='/usr/bin/bbedit'

macpro: ~ > source .bash_profile
macpro: ~ > echo $EDITOR
/usr/bin/bbedit
macpro: ~ > crontab -e                                       (opens crontab in bbedit)
crontab: no changes made to crontab
macpro: ~ >

François

On Jun 13, 2012, at 8:04 PM, bobPCL wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
bobPCL  
View profile  
 More options Jun 13 2012, 8:25 pm
From: bobPCL <b...@purplecrowlidar.ca>
Date: Wed, 13 Jun 2012 17:25:20 -0700 (PDT)
Local: Wed, Jun 13 2012 8:25 pm
Subject: Re: change default editor to bbedit

thanks. That does work for crontab. Unfortunately it does work if you say
"edit file.name", you can say bbedit but not edit.

I guess it only works in some contexts. On my old unix systems I used to
have emacs come up instead of vi, I just can't remember how I used to do it.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
François Schiettecatte  
View profile  
 More options Jun 13 2012, 8:30 pm
From: François Schiettecatte <fschietteca...@gmail.com>
Date: Wed, 13 Jun 2012 20:30:25 -0400
Local: Wed, Jun 13 2012 8:30 pm
Subject: Re: change default editor to bbedit
Bob

again in .bash_profile

alias edit='/usr/local/bbedit'

macpro: ~ > source .bash_profile
macpro: ~ > alias edit
alias edit='/usr/bin/bbedit'
macpro: ~ > edit .bash_profile

Cheers

François

On Jun 13, 2012, at 8:25 PM, bobPCL wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
François Schiettecatte  
View profile  
 More options Jun 13 2012, 8:33 pm
From: François Schiettecatte <fschietteca...@gmail.com>
Date: Wed, 13 Jun 2012 20:33:00 -0400
Subject: Re: change default editor to bbedit
Bob

I should point out there is a big difference between the EDITOR environment variable (explained by Rich below) and the 'alias' command.

You might want to check this resources:

        http://www.gnu.org/software/bash/manual/

The O'Reilly Bash book is pretty good too!

Cheers

François

On Jun 13, 2012, at 8:25 PM, bobPCL wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Sica  
View profile  
 More options Jun 13 2012, 8:38 pm
From: Robert Sica <bobs...@purplecrowlidar.ca>
Date: Wed, 13 Jun 2012 20:38:14 -0400
Local: Wed, Jun 13 2012 8:38 pm
Subject: Re: change default editor to bbedit

aahhh, now I get what Rich was telling me. Thanks so much to both of you, I
see the difference now.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil Dobbin  
View profile  
 More options Jun 13 2012, 11:34 pm
From: Phil Dobbin <phildob...@gmail.com>
Date: Thu, 14 Jun 2012 04:34:18 +0100
Local: Wed, Jun 13 2012 11:34 pm
Subject: Re: change default editor to bbedit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13/06/2012 23:25, bobPCL wrote:

> I can open a terminal window in Mac Lion and run the command:

>>bbedit file.name

> and bbedit works, and says it is in /usr/bin/bbedit.

> If I try to put in my .profile: export EDITOR='/usr/bin/bbedit' I get
> "-bash: edit: command not found". Or the same thing happens if I put the
> command in .bashrc. Or if I leave off the /usr/bin and put it in either
> place. Always the same error.

> That being said if I put /usr/bin/edit that works (but not for bbedit).

> Would someone please let me know what I'm doing wrong? I'm running from
> an account with admin access.

Try:

`export EDITOR=/usr/bin/bbedit` (without the backticks)

in your bash_profile (assuming when you installed the command line tools
you chose `/usr/bin/`).

Similarly, you can use:

`export GIT_EDITOR=/usr/bin/bbedit`

for your git commit messages if you don't want to pass the `m` flag on
your commits.

That will work if you run your shell as a login shell (see
<https://rvm.io/support/faq/#shell_login> from the wonderful Wayne E.
Seguin for a brief explanation).

Also, unfortunately, there is no `sudo update-alternatives --config
editor` on OS X as there is GNU/Linux to make this scenario plainer.
Blame FreeBSD :-)

Cheers,

  Phil...

- --
But masters, remember that I am an ass.
Though it be not written down,
yet forget not that I am an ass.

        Wm. Shakespeare - Much Ado About Nothing

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJP2Vu3AAoJEKpMeDHWT5ADsE8IAKtqYGtydTQouQBToMV+tfea
jquUKm5RfcyLwyh3zCVaqyurDl4bWFNJ75YYo+5BW5TrqIDnN6gPMMH1aEqEo5zA
2AhGl6zu+OMIdhxVNBie7Pd6quGjXs204sj9yJAVDSPZJK22fqduUmgvedIS1QHb
cgsj1lA+bMAXDzG7BdXXNG2o8leNvYe6kB4VzzMZc7dCV2MRAWyX0gleJek453Fx
ox79gwmXmqJZhxprN6CdU6ShgUpAGBy7V1hXwtQF2mA3yjo3GzNRG5UhqaGFytZT
AJBO6Grh4HryCRFKTB+IoFqI6/2kLvS9EtW8deEs764wPCx+9f4JvNx8qYSFg/I=
=Fl2o
-----END PGP SIGNATURE-----

  smime.p7s
5K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Satrapa  
View profile  
 More options Jun 14 2012, 12:39 am
From: Alex Satrapa <gr...@goldweb.com.au>
Date: Thu, 14 Jun 2012 14:39:24 +1000
Local: Thurs, Jun 14 2012 12:39 am
Subject: Re: change default editor to bbedit
Just a note about using BBEdit for editing commit messages: I use '/usr/local/bin/bbedit --wait --resume' for that purpose, mainly to allow the commit message to be written before returning control to the invoking process. The "--wait" means "wait for document to be closed in BBEdit" and "--resume" means "restore focus to the invoking application when the document is closed in BBEdit".

HTH

On 14/06/2012, at 13:34 , Phil Dobbin wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rod Buchanan  
View profile  
 More options Jun 14 2012, 9:28 am
From: Rod Buchanan <r...@kdsi.net>
Date: Thu, 14 Jun 2012 08:28:45 -0500
Local: Thurs, Jun 14 2012 9:28 am
Subject: Re: change default editor to bbedit
On Jun 13, 2012, at 7:25 PM, bobPCL wrote:

> thanks. That does work for crontab. Unfortunately it does work if you say "edit file.name", you can say bbedit but not edit.

Add this to ~/.bashrc

        alias edit='/usr/bin/bbedit'

--
Rod


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Wilcox  
View profile  
 More options Jun 14 2012, 10:46 am
From: Ryan Wilcox <ryanwil...@gmail.com>
Date: Thu, 14 Jun 2012 07:46:02 -0700 (PDT)
Local: Thurs, Jun 14 2012 10:46 am
Subject: Re: change default editor to bbedit

On Thursday, June 14, 2012 12:39:24 AM UTC-4, Grail wrote:

> Just a note about using BBEdit for editing commit messages: I use
> '/usr/local/bin/bbedit --wait --resume' for that purpose, mainly to allow
> the commit message to be written before returning control to the invoking
> process.

Grail raises an excellent point: by default the bbedit command will turn
immediately. This causes some confusion with some command line tools, which
expect the editor command to quit only after the user has saved and quit
their writing.

In English, most command line tools expect to fire off the editor, and
expect to hear back from the user when they are done editing. Instead, what
the bbedit command does (by default) is to open the file in BBEdit then
return immediately.

So, the bbedit tool is written to behave like: "Ok, I have displayed the
file to the user, my job is done". Where as most command line tools expect
the editor's job to be done when the user saves + closes the document in
question.

Here's the line from my own unix config:

export EDITOR=~/bin/bb

My ~/bin/bb script looks like this:

#!/bin/sh

# Information for this script comes from:
#
<http://superuser.com/questions/383124/knowing-user-is-sshing-in-from-...>

if [[ $SSH_CONNECTION ]]
then
  vim "$@"
else
  bbedit -w  "$@"
fi

This script says, "If the user is SSHing in right now, use vim as the
editor. Else use BBEdit and wait around until the user closes the document
in question".

Why the check about SSH connections? I sometimes SSH into my main OS X
machine using a Linux netbook. If I need to edit a file I don't want to
launch BBEdit because I have no way of editing the text then because I'm
not in front of OS X right now.

Hope this helps,
_Ryan Wilcox


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Gordon  
View profile  
 More options Jun 14 2012, 1:58 pm
From: Rick Gordon <li...@rickgordon.com>
Date: Thu, 14 Jun 2012 10:58:37 -0700
Local: Thurs, Jun 14 2012 1:58 pm
Subject: Re: change default editor to bbedit
But how will that work for other classes of documents, such as images, which have their own default editor?

------------------

On 6/14/12 at 8:28 AM -0500, Rod Buchanan wrote in a message entitled
"Re: change default editor to bbedit":

>On Jun 13, 2012, at 7:25 PM, bobPCL wrote:

>> thanks. That does work for crontab. Unfortunately it does work if you say "edit file.name", you can say bbedit but not edit.

>Add this to ~/.bashrc

>    alias edit='/usr/bin/bbedit'

>--
>Rod

--
___________________________________________________

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________

WWW:   http://www.shelterpub.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
François Schiettecatte  
View profile  
 More options Jun 14 2012, 2:10 pm
From: François Schiettecatte <fschietteca...@gmail.com>
Date: Thu, 14 Jun 2012 14:10:34 -0400
Local: Thurs, Jun 14 2012 2:10 pm
Subject: Re: change default editor to bbedit
It is not relevant, all the alias does is replace the command 'edit' with the command '/usr/bin/bbedit', the default MacOS X install does not have an 'edit' command.

Note that you can add parameters to the alias:

        alias edit='/usr/bin/bbedit --wait --resume'

There is the '/usr/bin/open' command which will open a document with its Mac application, so I would use that for you images, etc...

François

On Jun 14, 2012, at 1:58 PM, Rick Gordon wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rick Gordon  
View profile  
 More options Jun 14 2012, 2:28 pm
From: Rick Gordon <li...@rickgordon.com>
Date: Thu, 14 Jun 2012 11:28:34 -0700
Local: Thurs, Jun 14 2012 2:28 pm
Subject: Re: change default editor to bbedit
Ah, right. I was confusing edit and open.

------------------

On 6/14/12 at 2:10 PM -0400, François Schiettecatte wrote in a message entitled
"Re: change default editor to bbedit":

--
___________________________________________________

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________

WWW:   http://www.shelterpub.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »