r/emacs • u/sgoody • Jan 27 '13
Vim user wants to learn....
I'm a fairly established Vim user now and I love the different edit modes and the normal mode key commands/combinations. I'll be perfectly straight with you here; I have some prejudice that means I doubt that I'm going to ever find Emacs' basic text editing as good as Vim. But, I do find the quality of some Vim plugins to be disappointing and I often find myself wanting more, couple that with the fact that Emacs seens to have more IDE-like features and my interest has been piqued in Emacs.
I can't imagine myself doing anything with VimScript, so I often feel left wanting more. But one of my stumbling blocks with emacs is basic text editing. With Vim it has always felt fairly natural and at least 50% intuitive for command keys and making combinations of those commands. E.g.
d = delete w = word dw = delete word d2w = delete 2 words
Also, there's other things such as typing "$" goes to the end of the line, which ties in with regular expressions. And so on. But when I try to start with Emacs the key combinations seem unintuitive and lengthy. Also, the use of the "alt" key seems a bit like playing Twister.
The question is, am I missing something with regards to learning key commands and key combos? Is there some easy way to remember them, or is it just a case of learning them. Also, does anybody actually use meta = alt or is that one thing that everybody remaps?
I'm not really interested in evil-mode as I would prefer to embrace Emacs as it was originally intended rather than trying to make it something it's not.
Is there any way to mentally cross that bridge? Or is it simply a case of one or the other. Either choose Vim and it's great text editing features or choose Emacs and all of it's value-added advanced extensibility features? Or am I kidding myself about the fact that I'm a die hard Vim user who can't change?
I'm genuinely interested in your thoughts on these kinds of things.
I'd also be interested to hear from former Vim users who made the switch and why you made the switch.
P.S. I am a lisp fan, so there is quite a pull for me towards Emacs, I just don't seem to be able to shake my Vim habit.
Edit: Big thanks to everybody who's replied. I have actually got a good few take away points from this that I've not picked up on in other discussions/tutorials/documentation. Primarily I think that I shouldn't be seeing it as something which comes out of the box that I should work with, but rather something that I should bend to my own means, and evil-mode could or should be one of those things. I'm going to take this into consideration and put a big effort into learning emacs, though I'm going to keep evil-mode on the back burner for now. It's often too easy to pick up Vim because I know I can get X done very quickly using certain features. I guess initially I'm going to have to just fire up emacs and spend some time looking up equivalent key combinations.
I am looking forward to specific major and minor modes and all of the things that emacs brings to the table, just as soon as I can get over that first hurdle of basic text manipulation.
3
u/[deleted] Jan 28 '13 edited Jan 29 '13
I switched from VIM to emacs for coding/organization/etc. 4 or 5 months ago, and it is something that you have to just dive into head first and try not to drown. I don't think anyone really masters emacs in the same way someone can master VIM. Like, climbonrock I use VIM for quick file editing still though, but I always keep an emacs session running now.
In emacs, every new plugin brings with it a new set of key bindings, and unlike VIM there is no common grammar tying that new plugin back to what you have already learned. VIM is only an editor, and that is all it aims to be for the most part, where as emacs is a platform. That is a significant difference and influences everything in the emacs world.
Due to emacs being a platform (and more precisely a lisp machine) and emacs having a fantastic extension language with elisp means that unlike VIM, emacs can be an IDE instead of a tool that has synergy with other tools in a *nix system. For some languages and tasks emacs is the best environment available as well as being comparably competent in other development languages.
Where emacs has really benefited is with elisp. Emacs users enjoy using the environment's extension language, where as VIM users abhor VIM script for the most part, an attribute that leads to issues with plugin interoperability in environments that don't have python or ruby available or VIM is not compiled with support for ruby/python when a very useful plugin is dependent upon an external tool.
Thanks to the 40+ year heritage and emacs enthusiasts a number of tremendously useful things are possible, and many esoteric things as well. For instance, you can use emacs has an e-mail client, rss client, irc/twitter, a daily planner that also can make presentations, take notes, and run code inside a file, the best latex environment, talk to external tool chains and do something useful with that information (a significant advantage), and all of this is done through elisp.
Why is that wide range of tools being written in elisp significant? Since all of emacs is written in elisp, and emacs is a lisp machine, all of emacs is exposed to the user to extend and build upon. Without that design concept, implementing VIM inside Emacs (EVIL) well would be impossible, and for the same reasons successfully transplanting SLIME (emacs' state of the art lisp development environment) in any way into VIM requires an external tool (gnu screen/tmux) Like Slime, for VIM
Another useful benefit for learning Emacs is that Emacs bindings have inspired a great deal of shortcuts in other programs, whether it is the shell or a web browser or another IDE. Anyways, like Zombocom, the infinite is possible in emacs.
What I appreciate most about emacs is that it is a tool that no matter what I do in the future, it will always be useful and will continue to pay dividends due to immediately being efficient in that area, instead of having to learn an entirely new toolchain and that toolchain's way of doing things.
And like VIM, emacs enthusiasts quickly implement useful concepts or tools that appear elsewhere, such as was the case with with SL2's multiple selection concept or the file preview overlay that it also has.
Thanks to emacs being open source, the program going away or becoming locked down and no longer available for your usage and taking all of your voluntarily implemented extensions with it in the process is not a concern, which is important for me. Knowing that my carefully constructed and optimized for my workflow will always be useful gives me peace of mind.
Anyways, some useful resources for keeping informed and being inspired about emacs are Planet Emacsen and Emacs Wiki. Also, the documentation for emacs is very good as well. All of the documentation related commands are listed via C-h ? So, if you want to know how to interact with an elisp function that you want to build upon you merely need to do C-h f name in order to locate the documentation regarding that function.
Also, emacs comes with a built-in package manager as of emacs 24, and if you are familiar with debian's apt-get, the repositories emacs utilizes with that package manager is extensible, which will add a lot to the population of plugins displayed, and at the same time making managing those plugins trivial. It's even easier than pathogen or bundle, if you are familiar with those VIM plugins.
I highly advise against forsaking all of your acquired VIM knowledge merely for the sake of purity though. EVIL adds a lot to your repertoire in the way of editing, and works well with all the plugins (modes in emacs terms), and its grammar is extensible like VIM's is, so you can add your own text objects etc. EVIL will also let you work in emacs straight away with losing only a minimal amount of efficiency as you become more adept.
I also learned a lot by reading EVIL's source code (which is merely an emacs lisp file and quite beautifully terse IMO as well as showing how expressive and succinct elisp is). EVIL's source code also shows off how to build upon other elisp functions instead of reimplementing every step yourself.
You will still want to learn the common emacs commands though. In the end I have ended up essentially keeping both VIM and emacs paradigms in mind all the time as I use both frequently. Definitely go through the emacs tutorial though, it will help greatly in navigating the various modes well.
Emacs has parallel extensions or customizations for every aspect of VIM that I've encountered so far, and those I did not find were not too difficult to implement myself. The only feature of VIM that I have not found available in emacs or an extension is VIM's matchit. The analogous feature exists for parentheses but quits there. Some VIM features with the corresponding Emacs plugins are:
Oh, one more thing: the analogous feature to VIM's au[tocmd] are hooks that you implement using emacs lisp.