BBedit can edit remote files using SFTP. For instance, the command line tool lets you do something like:
bbedit sftp://username@remotehost:port/path/to/file.txt
iTerm's shell integration lets you select text from a remote "ls" command and right-click to "Download with scp" (very nice!). I was wondering if there was any way to combine the two, so that the context menu had an option like "Open with BBedit" which told BBedit to edit the file "in place" remotely with sftp instead of iTerm downloading it with scp? There's no way for instance to install a user Applescript to provide a context-menu item, and which would have access to the selected text and the ssh_config info necessary to send BBedit an "open" command?
Just as handy would be some sort of shell integration "bbedit" command similar to imgls and it2dl so you could issue a command on the remote host like "bbedit /some/remote/file" which would trigger a bbedit "open" request to edit that file via sftp. But I think that would need new escape code support?