Hacker News new | ask | show | jobs
by blackrock 2881 days ago
I once used emacs. I still do from time to time. But it's too complicated for its own good.

Vim works pretty well. It's simple enough to get by. But these days, I usually only use it for viewing mode. And maybe for some light editing.

For anything more complicated, then I just shell into the server, and open the file in a full featured text editor.

1 comments

Emacs has Tramp, so you can open and edit the remote file right on your computer and emacs takes care of shelling into the server in the background and applying your edits.
Tramp also works with things like dired (Emacs directory/file browser) and GDB. Which means that nowadays, I often don't even need to explicitly open a shell on the server (and if I do, it's M-x shell). Tramp also handles tunneling connections and user/privilege switch. So, for instance, I can open my remote home directory, as root, on some server in another network like this:

C-x f ssh:me@public-server|ssh:me@private-server|sudo:private-server:/home/me

And it will just work, opening a dired view of the home directory on remote server, with root privileges. Further commands (e.g. opening files) will also work on the remote, mostly seamlessly.

Internally, Emacs manages shell connections and translates your operations to shell commands; e.g. opening a file will copy it over to your system, and saving it will copy the altered version back.

Vim has bcvi which is a similar concept.

Whilst I'm happy to use plain Vim it can be useful if you've customised your own set up and don't want to port it to each server.

For those interest in how use raw Vim as a "fully featured" editor I'd recommend Drew Neil's book,

https://pragprog.com/book/dnvim2/practical-vim-second-editio...

http://sshmenu.sourceforge.net/articles/bcvi/