3 ms·
>4) Emacs had packages that would emulate vim It's terribly inefficient for emacs vi emulation mode to actually quit emacs when you type ":q", because it takes
by DonHopkins 7y ago
>4) Emacs had packages that would emulate vim
It's terribly inefficient for emacs vi emulation mode to actually quit emacs when you type ":q", because it takes much longer for emacs to start up than vi, and people use a long-running emacs a lot differently than they use disposable vi's.
UniPress Emacs's vi emulation mode would actually flip you over to an emacs shell buffer when you typed :q, and the shell would recognize when you typed "vi foo.c" and flip back over to a vi emulator buffer instead of actually running vi, but INSTANTLY, since changing buffers in a running emacs was much faster than actually starting up a new vi process.
So die-hard vi users didn't have to re-learn their muscle memory, and could just stay in the same emacs all the time, while the same old emacs alternately flipped between pretending to be a shell, and pretending to be vi.
- pmoriarty 7y ago"it takes much longer for emacs to start up than vi" This is false on pretty much any modern system. They start up in about the same amount of time. Using lots of packages (in both vim and Emacs) will slow down startup speed, but there are tricks to speed that up too (like by defering actual loading of them until they're needed). Also, most people who run Emacs just keep it running all the time, and almost never quit or restart it, so startup speed would not be an issue even if it was slow, which it isn't. "people use a long-running emacs a lot differently than they use disposable vi's" Emacs has an emacs-client binary which you can use exactly the way you use a disposable vi (or vim). It'll connect to the long-running Emacs process in the background, but that's an implementation detail that you as an Emacs user wouldn't have to worry about, apart from starting Emacs once when you boot your system. Regarding your description of shell-flipping, Emacs does offer shell integration, where that sort of thing can be done, but I personally don't use it and run shells outside of Emacs (and run both my shells and Emacs itself under tmux), so my workflow with Emacs and the shell mirrors the traditional vi/vim workflow. I didn't have to change my decades-old vim muscle memory or workflow when I made the switch to Emacs.
- DonHopkins 7y agoIt was true of UniPress Emacs, running on a 4 meg Sun 3/50. It's been a long time since UniPress sold any version of Emacs.
- alexhutcheson 7y agoalias vi='emacsclient -t -a ""' Then whenever you run 'vi' it will create a new frame on an Emacs instance that's running as a server[1]. If there's not an Emacs server already running, then it will start one for you, so the first invocation will be slow, but every subsequent invocation will be fast. No need to change your muscle memory for this particular case. [1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server https://www.gnu.org/software/emacs/manual/html_node/emacs/Em...