I do this too - using BBEdit to edit files on my Linux boxes. There's
three primary methods I use:
1. I have an NFS export on my Linux box and mount it on my Mac. From
there, working with files is exactly the same as if they were local.
I've sort of fallen out of this practice however due to a nasty
shutdown bug in OSX as well as the fact I'm doing a lot of editing via
VPNs remotely now.
2. For simple one-offs, I have a script that I have on my Linux boxes
that lets me type `bbedit <filename>` and then it ssh's back to my Mac
to issue the command to tell bbedit to open the relevant file via
ssh/sftp.
3. For long-term projects, I create a new project and open an SFTP
browser and then drag the "files" from the SFTP browser into the
project bar. For subdirectories, I create a collection (sometimes
nested) for each subdirectory I care about. Depending on the size of
the project this can be time consuming, but for big projects I tend to
do such as I need pieces instead of the whole directory structure at
once. One of these days I intend to write myself a script that will
let me import an entire remote file structure this way, but I've never
gotten around to it.
My use case - I'm primarily an embedded Linux developer, largely
focused on the Linux WiFi stack and kernel itself. Nearly 100% of my
work _must_ be done on Linux boxes. However, I find OSX as a much
more stable and feature-rich day-to-day desktop environment and a
better environment for me to do my Linux work.
For my BBEdit command, you can add the following to your .bashrc on
each remote linux host:
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
}
function bbresults {
ssh derosier@$REMOTEHOST /usr/local/bin/bbresults
}
Obviously adjust to your own username, and it's helpful to be using
key-based auth and multi-master on both sides. I use the function
`bbresults` to pipe build results to in order to bring them up in a
bbedit results window. It depends on the situation if it works well.
For using cscope, you need a script:
https://bitbucket.org/derosier/home_bin/src/master/bbeditcscope
and thus in your .bashrc:
export CSCOPE_EDITOR=bbeditcscope
Hopefully that's of some usefulness to you. Good luck!
- Steve
On Mon, Mar 2, 2020 at 7:41 AM Stephane Gauvin <[email protected]> wrote:
>
> Interesting -- you mean from a Mac running BBedit, right?
>
> Care to elaborate a bit more? My (extermely limited) experience with ssh is
> to run mySQL queries via CLI. had no idea that BBedit could be used.
>
> I was planning to : (a) sync files between a day-to-day mac and Ubuntu server
> via Dropbox (I do the same between my d2d and a remote MacPro server; or (b)
> learn how to rsync via ssh.
>
>
> On Mon., Mar. 2, 2020, 16:06 Marshall Clow, <[email protected]> wrote:
>>
>> On Mar 1, 2020, at 6:36 PM, Gauvins <[email protected]> wrote:
>> >
>> > I am in the process of building a Linux workstation but will most likely
>> > keep several macs as well. I like BBedit very much but will be vulnerable
>> > to a multi-platform equivalent.
>> >
>> > Any plan to port BBedit?
>>
>> I use BBEdit to edit files on a Ubuntu system every day. (over ssh)
>>
>> — Marshall
>>
>> --
>> This is the BBEdit Talk public discussion group. If you have a feature
>> request or need technical support, please email "[email protected]"
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/bbedit/7D4836E9-88DB-48E8-9AA5-09D4EF6D80EA%40gmail.com.
>
> --
> This is the BBEdit Talk public discussion group. If you have a feature
> request or need technical support, please email "[email protected]"
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/bbedit/CAJOyUQPYza2X35YTkfa_3jL8x4KUpcjk7Ewa_kwNT_LGW0eQCg%40mail.gmail.com.
--
This is the BBEdit Talk public discussion group. If you have a feature request
or need technical support, please email "[email protected]" 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/bbedit/CALLGbRKn8LV6PfG7VvdZjczZyzfBn_oZY1RykyQKbn1T8F2MAQ%40mail.gmail.com.