I've long quit using vim on a daily basis, but the "how to exit Vim?" jokes are still somehow funny. A recent encounter was an old tweet by @iamdeveloper: "I've been using Vim for about 2 years now, mostly because I can't figure out how to exit it."
I've always used :x or :x! and no longer remember why. Probably it's a bad idea like without actually looking right now I think it might mean to ignore permissions (if you're root enough) and just write even if perms would have blocked it. Hm, maybe x means wq and just the ! means force.
The fact that everyone says the meme is dead, but in this small thread there are 5 different people posting how to exit, and none of them are the same says there is still pretty good substance behind that meme.
I feel like the default behavior should be to not write unless changes have been made. I may be misunderstanding here, but what would be getting written if nothing's been changed?
or they should just make sure emacs can work with the machine thru ssh, then there is nothing to install ;)
if no ssh, then nano is not a bad option, though i would go with joe (https://joe-editor.sourceforge.io/) which can also show the shortcuts, but much much more powerful, yet it's just a single ~700kbyte exe (or 1.5MB with some optional syntax highlighting grammars and docs)
>or they should just make sure emacs can work with the machine thru ssh, then there is nothing to install ;)
While (neo)vim doesn't have TRAMP and dired, it has netrw, which does the same stuff (on a basic level). You can do the following to edit a remote file:
vim scp://user@hostname/path-to-file-here
You can also replace user@hostname with an ssh alias you've configured, which makes it easier to work with multihop ssh and different keys and users. One useful usage of the remote editing is to combine it with opening multiple files to compare two files on different machines:
vim -O ~/.config/mpv/mpv.conf scp://htpc/.config/mpv/mpv.conf
To browse a directory instead of a specific file, just put the dir instead of a non-dir file and it will open a filebrowser view where you can then pick a file to open. In the above examples, leave off mpv.conf and you'll then be able to pick either your mpv.conf or input.conf or files related to your mpv scripts.
:wq (sorry, I had to).