Looking for a linux-based editor that can "process lines containing"

72 views
Skip to first unread message

Mark C.

unread,
Jul 22, 2025, 1:12:01 PMJul 22
to BBEdit Talk
After many years I finally bought a license for BBedit that I use with the Macbook at work.
At home I use an old linux box running Lubuntu. I'm trying different editors to try and get some of that sweet BBedit functionality at home.

I was reading an article about trying to replace BBedit with Sublime Text, and it noted the areas where Sublime falls short:

  • “Process Duplicate Lines…”
    • Eliminate duplicate lines in a file. This is often useful after performing a series of text transformations.
  • “Process Lines Containing…”
    • Delete (or preserve) all lines containing a subexpression. Exactly like the grep command-line tool.
    I'm wondering if there is an editor for Linux  that allows me to "process lines containing"
I guess it's something I could figure out with SED and AI.

Thanks

Steve deRosier

unread,
Jul 22, 2025, 3:26:56 PMJul 22
to bbe...@googlegroups.com
Hi,

I just use BBedit with Linux via sftp. I use my Mac as my primary
graphical desktop, and nearly 100% of the time I'm ssh'd into a Linux
box (my primary coding function is embedded Linux). Over the years
I've used two different techniques:

1. You can export your Linux filesystem with nfs or samba. Of the two
I prefer nfs for this use case but I will warn you that it seems to
cause instability in Finder after long periods of connection and then
abrupt non-clean disconnections.
2. You can use the SFTP functionality of BBEdit to open remote
documents in conjunction with a little magic on the Linux side. This
is what I'm doing about 99% of the time now.

#1 you can easily research. For easy use of the SFTP function, I
create a few little adaptors on the Linux side to make it work so I
can just type `bbedit filename` on the Linux side and it opens on my
Mac.

Step 1: make sure you install the bbedit commandline tools and in a
terminal you can locally type `bbedit file.txt` and it will open the
editor etc.
Step 2: I have this in 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
}

function bbresults {
ssh derosier@$REMOTEHOST /usr/local/bin/bbresults
}

export CSCOPE_EDITOR=bbeditcscope
```

Step 3: totally optional, but I use cscope and it doesn't work nice
with the above, so I have ~/bin/bbeditcscope:
```
#!/bin/bash

# $1 : Line number from cscope in +## format
# $2 : File name, relative to cscope's location

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

One thing to note, you might have to force Linux to use IPv4 instead
of IPv6 for the IP addresses to work right. I do that in my
.ssh/config via AddressFamily:
```
Host linux.local
HostName linux.local
ForwardX11 yes
ForwardX11Trusted yes
TCPKeepAlive yes
ServerAliveInterval 60
AddressFamily inet
```
Also it's critical to setup key-based auth or you're constantly typing
in your password.

Projects are worth discussing. I do utilize projects. With option #1
(use a remote fileystem) they work as expected and you can basically
just point the project at a directory and new files get picked up
automatically. However with my SFTP method, they require some manual
work. I usually setup a new project and save it locally (I don't keep
them in git with the project, instead I usually keep them in my
Dropbox. There's Reasons for that). Then, on the linux side, I'l do a
`bbedit .` in the project directory. This will bring up a ftp
browser. From here, I can open whatever files I want. I create
collections for the directories in the directory structure, and then I
drag the relevant files into my project pane into the correct
collection. Note this will create "files" that are actually SFTP URLs
and will have the '@' icon. For large projects that grow as I create
them, it's not a big deal. For large projects that are prexisting, it
would be a big problem, however you usually only need to muck with a
small subset. Like for the Linux kernel I usually only pull in the
relevant DTS files, driver code as I need them, etc, and not try to
structure the entire thing. I keep meaning to automate this but
haven't ever gotten around to it. But if you had a large number of
files all in one directory, simply selecting them all in the FTP
explorer and dragging the entire set over is pretty easy and quick.

For find-all type purposes, you can't do the "find in project"
checkbox because the files aren't local nor open. I open everything I
want and use the "Open Editing Windows" or "Open Text Documents"
search in options.

If you have situations where files might change on the server (like
git operations, eg rebases, branch changes, stashes, etc), note that's
not synchronized and BBEdit won't see those out-of-band edits.
shift-cmd-R is your friend. I have just gotten in the habit of
hitting it when moving from my terminal back to the editor. Lately
I've been making heavy use of claude code in my workflow and so reload
from server is a really big deal for me.

The remote-filesystem methods don't have the downsides of using the
SFTP, but using the SFTP method lets me work with files when very
remote over a VPN on a slow connection, and is nice not having to
setup a file service.

There's many ways to do this, but it works great for me. And the fine
guys at BareBones have always done a great job keeping my workflow
working. In other words, in the rare occasions there's been a small
bug in a new release that messes up my (admittedly fringe) workflow,
they've been super responsive and quick to fix it. Anyway, maybe the
above will work for you and let you use BBEdit "on Linux."

For quick edits (think git commit messages and config file changes)
while on a Linux terminal I use emacs. But I much prefer a good GUI.
I've been using BBEdit for 25 years as my primary editor for Linux,
Embedded Linux, and pure uC embedded work. I hate IDEs and every time
I try to switch to something, I come back to BBEdit within days. It's
one of the reasons I'm loving claude code: it works with my workflow
and editor giving me the same benefits of Cursor or the LLM features
of VSCode without me having to switch. This workflow might not be
great for you, but hopefully it helps show you how you can sync up a
Linux workflow with BBEdit.

- Steve
> --
> This is the BBEdit Talk public discussion group. If you have a feature request or believe that the application isn't working correctly, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Mastodon: <https://mastodon.social/@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 visit https://groups.google.com/d/msgid/bbedit/1dd1f028-e6e9-4877-ae6c-2827dfff0a94n%40googlegroups.com.

Bruce Van Allen

unread,
Jul 22, 2025, 3:39:21 PMJul 22
to bbe...@googlegroups.com
In addition to Steve's approach, remember that modern macOS provides
"Connect to Server..." on the Go menu (in Finder), which allows opening
a Finder window on a remote connection. Files may then be opened,
changed and saved in BBEdit as though local. Very handy in my workflows
with remote machines. Might help with yours.

------ Original Message ------
From "Steve deRosier" <dero...@gmail.com>
To bbe...@googlegroups.com
Date 7/22/2025 12:26:05 PM
Subject Re: Looking for a linux-based editor that can "process lines
containing"
>To view this discussion visit https://groups.google.com/d/msgid/bbedit/CALLGbRJFqxeQRZBAhCi02DuNhtrVqk1UeMSv2wOZt2__hJxA-w%40mail.gmail.com.


- Bruce

_bruce__van_allen__santa_cruz__ca_


James Reynolds

unread,
Jul 23, 2025, 12:27:37 PMJul 23
to bbe...@googlegroups.com
Several years ago I tried to switch to Linux. BBEdit prevented me from completing the switch. That said, I did a pretty exhaustive audit of the Linux editors. vi tends to be everyone's favorite, no joke. I also found micro, a pretty cool cli editor.

As far as GUI's go, VS Code kind of rules. It seems like everyone loves it. It's an Electron app (which means it's a web browser without guard rails) so it's cross platform. I can't stand editing code using a web browser textbox so I can't stand VS Code. All of the keyboard shortcuts are wrong (for a Mac power user). I did force myself to use VS Code for one project and I got used to it I guess but once I was done with the project I ran from VS Code like the plague. I think the people who love it don't use keyboard shortcuts and they grew up with web browsers and don't have anything against textboxes. I grew up using computers long before the textbox existed, and when they showed up in Netscape I never cared for them.

I think all of the other text editors are based on Scintilla (https://www.scintilla.org/). A few editors that use Scintilla include SciTE, Geany, TextAdept, and ZeroBrane Studio. I think all of those are available on macOS too. They are all scripted with Lua (my fav language) and have some really cool features. Everyone's favorite Windows editor, Notepad++, is even based off of Scintilla. There's a full list of editors based on Scintilla here: https://en.wikipedia.org/wiki/Scintilla_(software).

You basically have the CLI editors: vi, emacs, and then pico and it's descendants with micro being the latest and includes most modern editor features. Then you've got the Scintilla editors. Then you've got all the Electron editors, which includes VS Code, Atom (the OG), Cursor, and all the other AI first editors. Then you've got the old school GUI's, which includes BBEdit, Sublime Text, and many others that I don't hear about anymore like TextMate. Of course, there's the office apps too. They technically edit text.

https://en.wikipedia.org/wiki/List_of_text_editors

I've heard whispers that Zed might be good. It is being written by some of the people who contributed to Atom. And thank heavens it's not Electron. I haven't tried it though but I just opened it and maybe I'll use it by the end of today lol.

In fact, I just tried a few things and the first thing I notice is the menu where a keyboard shortcut lives in doesn't flash when you press the keyboard shortcut. It's a really small detail, but flashing the menu makes it so easy to learn keyboard shortcuts. Maybe they'll add the feature, I hope they do. But if they never do it goes to show the devs don't know or care about helping average users become power users. I think flashing the menu when a keyboard shortcut is typed goes back to the original Mac and all the philosophies that built it. Because Windows was a bad photocopy of macOS, it lacked the philosophies and so people who grew up using it don't even know that UIs can be a philosophical thing. But the great computer scientists that created this GUI world we all work in, like Larry Tesler and Alan Kay, were full to the brim of philosophies and most of those were written down in Apple's original HIG. I think that even Apple has forgotten these original philosophies.

https://uxdesign.cc/did-apple-abandoned-its-own-design-heuristics-accessibility-principles-2d616ed7ace5

All that said, nothing I've tried comes close to the functionality of BBEdit. Besides communication apps and iTerm2, BBEdit is my main app, so, yeah, I didn't switch to Linux. I don't use half of the functionality of BBEdit but I got addicted to some features that don't exist anywhere else. When I say addicted, I would probably be 10x slower without these features. IDK. BBEdit allowed me to learn some really weird editing habits like copying the file I'm editing into a new untitled document and comparing the front 2 docs so I can instantly see what I've changed and only updating the copy once I've finished the feature or fixed the bug (kind of like a video game checkpoint). Yeah, I'm kind of weird I guess.

James Reynolds
magnusviri.com
Reply all
Reply to author
Forward
0 new messages