BBEdit or BBEdit-Like Editor Running Directly in Terminal

56 views
Skip to first unread message

Rick Gordon

unread,
Apr 3, 2023, 5:14:11 PM4/3/23
to bbe...@googlegroups.com
Is there any way to get a subset of BBEdit-like functionality in a
Terminal editor?

I often use BBEdit as a means of editing in the Terminal on my own
computer, but that doesn't work so easily with another computer that I
access via ssh, where I can't really exit the Terminal to edit. though I
could install a tool that I could run in the Terminal.

I see that there are a number of mouse-aware Terminal editors that are
available, and am just looking at ci-edit
<https://github.com/google/ci_edit>, though it seems sluggish.

I'd appreciate any suggestions here. Thanks.

___________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________
WWW: http://www.shelterpub.com

Rick Gordon

unread,
Apr 3, 2023, 5:17:39 PM4/3/23
to bbe...@googlegroups.com
I am aware that I can open a document in my local BBEdit via Open from
FTP/SFTP Server… I'm just looking for a more direct in-Terminal option.

------

Gregory Shenaut

unread,
Apr 3, 2023, 7:34:04 PM4/3/23
to bbe...@googlegroups.com
You could consider using sshfs.

Greg Shenaut

Sent from my iPhone

> On Apr 3, 2023, at 14:21, Rick Gordon <li...@rickgordon.com> wrote:
>
> Is there any way to get a subset of BBEdit-like functionality in a Terminal editor?
> --
> This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/642B4195.9010704%40rickgordon.com.

Rick Gordon

unread,
Apr 3, 2023, 8:54:46 PM4/3/23
to bbe...@googlegroups.com
Thanks, Gregory, but what's the advantage of that (except for a mounted
filesystem) vs using BBEdit opening via FTS/SFTP Server (which is what I
already do)? Does it give me a BBEdit-like Terminal editor?

Rick Gordon

--------

Steve deRosier

unread,
Apr 3, 2023, 8:54:47 PM4/3/23
to bbe...@googlegroups.com
Hi Rick,

I spend most of my time editing files that are on Linux boxes where I've got ssh access only.  I add this to my .bashrc:

export REMOTEHOST=`echo $SSH_CLIENT | cut -d ' ' -f 1`

export HOSTIP=`echo $SSH_CONNECTION | cut -d ' ' -f 3`


function bbedit {


# bbedit won't open a remote file via sftp if it doesn't exist. So, if it's a new file

# create it, call bbedit to open, and then kill it.

FCREATED=0

if [ ! -e "$PWD/$1" ]

then

touch "$PWD/$1"

FCREATED=1

fi

ssh derosier@$REMOTEHOST /usr/local/bin/bbedit -c -u --front-window "sftp://$USER@$HOSTIP/$PWD/$1"

# The above call will background and return immediately. The file will open in bbedit

# but since we've created it, and we don't want to leave it around, we kill it right away.

# If the user saves it, it gets recreated and content is saved. If not, there's no file,

# so we're cool too. It's a bit odd, but it works.

if [ "$FCREATED" -eq "1" ]

then

rm "$PWD/$1"

fi

}


Then editing a file is as simple as `bbedit somefile.txt` It calls back to my Mac and has bbedit open the file via sftp.  Edit, hit cmd-s and close the file/window as desired. Easy. Obviously you need ssh server enabled and your keys setup to avoid password prompts, but you can figure all that out.

Anyway, maybe that helps for you!

- Steve



Christopher Waterman

unread,
Apr 3, 2023, 9:40:15 PM4/3/23
to bbe...@googlegroups.com
I do something similar to Steve most of the time, as I dislike -hate really- vim, and emacs.
I do have an found an editor that I like and I think it might be good for you. It has mouse support, sane defaults, it isn’t modal so it’s a lot more like using a GUI editor like BBEdit.

https://micro-editor.github.io

Best of luck,
— Chris(topher)?

Rick Gordon

unread,
Apr 3, 2023, 10:03:03 PM4/3/23
to bbe...@googlegroups.com
Thanks, Steve and Chris for your recommendations. I will try both.

Rick Gordon

--------
> <mailto:li...@rickgordon.com>> wrote:
> >
> > Is there any way to get a subset of BBEdit-like functionality in
> a Terminal editor?
> >
> > I often use BBEdit as a means of editing in the Terminal on my
> own computer, but that doesn't work so easily with another
> computer that I access via ssh, where I can't really exit the
> Terminal to edit. though I could install a tool that I could run
> in the Terminal.
> >
> > I see that there are a number of mouse-aware Terminal editors
> that are available, and am just looking at ci-edit
> <https://github.com/google/ci_edit>, though it seems sluggish.
> >
> > I'd appreciate any suggestions here. Thanks.
> >
> > ___________________________________________
> > RICK GORDON
> > EMERALD VALLEY GRAPHICS AND CONSULTING
> > ___________________________________________
> > WWW: http://www.shelterpub.com
> >
> > --
> > This is the BBEdit Talk public discussion group. If you have a
> feature request or need technical support, please email
> "sup...@barebones.com <mailto:sup...@barebones.com>" rather than
> posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
> > --- You received this message because you are subscribed to the
> Google Groups "BBEdit Talk" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send an email to bbedit+un...@googlegroups.com
> <mailto:bbedit%2Bunsu...@googlegroups.com>.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/642B4195.9010704%40rickgordon.com.
>
> --
> This is the BBEdit Talk public discussion group. If you have a
> feature request or need technical support, please email
> "sup...@barebones.com <mailto:sup...@barebones.com>" rather than
> posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google
> Groups "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to bbedit+un...@googlegroups.com
> <mailto:bbedit%2Bunsu...@googlegroups.com>.
> --
> This is the BBEdit Talk public discussion group. If you have a feature
> request or need technical support, please email
> "sup...@barebones.com" rather than posting here. Follow @bbedit on
> Twitter: <https://twitter.com/bbedit>
> ---
> You received this message because you are subscribed to the Google
> Groups "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to bbedit+un...@googlegroups.com
> <mailto:bbedit+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/CALLGbR%2BUtEN%3Da6POaYcuRMSf_49TEoEi%3Dyn5mL1JYWDSfYW64A%40mail.gmail.com
> <https://groups.google.com/d/msgid/bbedit/CALLGbR%2BUtEN%3Da6POaYcuRMSf_49TEoEi%3Dyn5mL1JYWDSfYW64A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages