4 ms·
As a regular vim user who explored the emacs world for a while, I have somewhat mixed advice. emacs is worth learning. It highlights certain features, almost
by Xurinos 16y ago
As a regular vim user who explored the emacs world for a while, I have somewhat mixed advice.
emacs is worth learning. It highlights certain features, almost all of which you can pretty much get in vim -- it is just a different focus. One feature you do NOT have in vim is the ability to smoothly run a subprocess within the editor. That is why vimmers like to call emacs an OS; however, despite the ridicule, there really is something different about the SLIME experience that you ought to feel. There has been a lot of work on emacs to make it integrate in neat graphical ways.
However, if you are fairly competent in vim, emacs is not worth using regularly for editing anything that has to do with text. The biggest issue is that to make emacs usable, you have to remap just about everything. It is almost as if its designers did everything in their power to stop people from editing text. For example (and there are many), vim folks make their lives quickly easier by using (book)marks and macros; compare the key combos for these in vim to the ones in emacs, and you will see one reason why emacs editing is, by default, slower.
I avoid remapping keys because I actually work with other people sometimes within their environment, and it helps if the keys do the same thing. This makes for an unfortunate need for me to NOT get used to dvorak. :(
There are other nitpicks, such as the inability to edit/view large files (before some naysayer shows up again to ask what large files we might edit: genome files and log files come to mind).
Also, if you are told to try viper mode (and then told subsequently to use vimpulse.el with it -- definitely do this if you are using viper), these are good suggestions to get a fraction of vim's functionality along with some minor but annoying differences. Again, I point you towards macros. But also note that as soon as, for any reason, you open another buffer (for help, for an error, for giggles), you are in emacs keys world again and not in viper, so you will not be able to do your beloved Ctrl-W Ctrl-W immediately. If you are going to try emacs, just use the emacs bindings and forget about viper/vimpulse.
One advantage suggested by emacs folks is the configurability of the editor with elisp. It is true that it is very configurable. You will find, however, that some of the difference is marketing and FUD; vimscript is a rather powerful little language worth learning in its own right. Most people do not realize that vimscript has OOP. And elisp does not teach you Lisp that you can use outside emacs... just Lispy concepts.
All that said, I am not such a hardcore vimmer that I have a "set -i vi" configuration in bash. Learning emacs helped me learn how to do edits faster on the commandline. With dual experience in these editors, I sometimes use the wrong keys (try to move forward a word with Alt-F). Fortunately, in vim, undo is just a "u" away.
Try it out. Let me know if you come away with the same experience or find ways to make it reasonably tolerable.
- kroger 16y ago"For example (and there are many), vim folks make their lives quickly easier by using (book)marks and macros; compare the key combos for these in vim to the ones in emacs, and you will see one reason why emacs editing is, by default, slower." Could you provide a concrete example? I'm not trolling, I never used vi but I use emacs a lot and find emacs macros very useful and powerful.
- hazzen 16y agoVim define a macro (stored in q because it is easiest, but to change the name replace the second q with any letter): qq<do stuff>q Emacs define a macro: C-x ( <do stuff> C-x ) Vim do that macro again 40 times: 40@q Emacs do that macro again 40 times: C-u 40 C-x e Naming a macro in Emacs (so you can have multiple) takes even more keystrokes and I'm not entirely sure on the incantation to repeat a macro from name - none of the help files seem to tell me how to do this, only to save it.
- parbo 16y agoHow about F3<do stuff>F4?
- Xurinos 16y agoOnly one macro?
- delackner 16y agoAnyone? I'd like to know the emacs way to save the expression into a register. Or is there a way to cycle through expressions that were previously repeated?
- angusgr 16y agoI think one way of doing what you suggested is M-x name-last-kbd-macro which will bind the last macro you defined into a named function for the rest of the session.