How can I directly edit text files over SSH or FTP?
For what it's worth, here are the solutions I've found so far, but I'm happy with none:

DroidEdit has an SFTP/FTP option in the pro (paid) version. I have not tested it myself so I can't guarantee anything.

I used to mount a samba or NFS share on my local Android file system, using the CifsManager app, which can be tunneled through SSH, and then you work on the files as if they were on your local device. However, this required a rooted device, and I'm not sure it's still possible with recent Android systems (the problematic part being to mount a file system that isn't provided by the base Android system ; it seems the cifs or nfs kernel module is not part of standard ROMs anymore).

If your remote computer has a desktop environment, you could use a VNC client (there are a few available for Android). But remote applications are not designed to work with a touchscreen, and without keyboard/mouse.