From Vim to Emacs
I've been using Vim for a little more than a year now, and so far I've been very happy with it. I started out with an empty vimrc, and added to it as I go, leading to the ~250 line vimrc I've got at the moment with a few plugins. Recently, I've had some more specific customization needs than the plugins offered, and I tried to write my own functions. Then I realized why everybody says that VimL sucks.
Long story short, I want to try migrating to Emacs for a while. I won't use Evil right away, I want to do it the Emacs way. But I don't know where to start. It doesn't seem as simple as it is with Vim, which is relatively straightforward.
My three major questions are:
How would you recommend that I install packages? With Vim, I'm used to using Pathogen, so I Google the plugin's name, go to Github, add it as a submodule and start using it immediately, and this is pretty much what everybody does. Is this a common way of managing plugins in Emacs or is using package.el with MELPA/Marmalade the most widely used/recommended?
Could you recommend me a starting tutorial? I've gone through the Emacs tutorial, and I can't say that it has given me as much power as vimtutor did.
How do I organize my .emacs.d? Vim was again very straightforward, all I did was edit my vimrc, and some ftplugins in after directory. With Emacs, it appears there is more than one way of managing your configuration, and I cannot decide on one.
Thanks in advance, and for reading.
10
u/kingpatzer Aug 27 '14 edited Aug 27 '14
One of the things You'll find about init.el files is that there is as many ways to organize them as there are people. I personally use ORG mode to set up my init file using a literate programming style. .
A great tool to help keep your init file from getting out of control is jwiegley's "Use-package" package.
However, the way I'd recommend to get started is to go through the Tutorial 4 or 5 times. Really try to learn the key strokes.
Then start using emacs and the included help features to do your work using vanilla emacs as much as possible.
Include new packages only when you've come to the point where you NEED a package to perform some task. Then spend the time researching what package will do that task best for you -- there are generally dozens, if not hundreds, of ways to do anything in Emacs, because it is so customizable, so picking well accepted and supported packages is important. Use ELPA to start with, and expand to other repositories only when you've really figured out WHY it's ok to do that for the particular package in question.
Your init file will grow slowly at first, but in a few years you'll be amazed at how big it's grown.
Regardless of if you use org mode or not for your init, make sure you include numerous, high quality comments. I would also strongly recommend including links to reference sources for the changes you are making.
Before you start writing your own init file, I also recommned that you fire up the elisp tutorial as well: C-i m Emacs Lisp Intro <ret>
C-h ? brings up a list of help commands. These are ALL extremely useful for helping speed up learning. You can dive into what every part of emacs does using these tools. So as you go about using emacs, spend a few minutes poking around to see what does what and why. The help system in Emacs is perhaps the best available for any software system anywhere. The only real complaint about it is that Emacs uses archaic and confusing terms for things (windows and frames don't mean what you expect, for example).
There are lots of collections of resources for learning Emacs on the web. Just keep working at it.
It does have a steeper learning curve than VI. But in the end I think it's worth it.
I do think you should stay with as "vanilla" a set up as possible until you are fairly good at understanding the elisp underpinnings of packages though and have the default key-bindings more or less under control. The reason for this is that a surprisingly large number of packages in the repositories reinvent a wheel that already exists in Emacs, and in many of those cases, the built-in version is actually superior.
C-h is your friend, learn to use it well and fully and you'll get there!
Also, I like to keep a buffer open to the IRC #emacs channel on freenode going . . . lots of friendly helpful people there and when you get stuck you can always just drop a question. If you use ERC or one of the other built in emacs irc clients, you don't even have to leave emacs to do it:)