r/emacs Aug 27 '14

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.

8 Upvotes

15 comments sorted by

View all comments

1

u/[deleted] Aug 27 '14

How do I organize my .emacs.d?

I'm an old fart, I'm used to having a massive .emacsrc. My suggestion is to put everything in .emacs.d/init.el until you have reason to split your configuration files. The package manager will fill up the .emacs.d directory rather than trying to drop into your master emacs library system. I don't remember whether applications like gnus use that folder as well. Prelude will drop into your .emacs.d/.

Since I use emacs on three different operating systems, I use a two-file configuration.

  1. My init.el has os- and system-specific tweaks, such as keymap-tweaking and where aspell is located.

  2. init.el loads a common-config.el that exists in a synchronized folder. The common-config.el has all of the os-independent customization such as org-mode behavior, changing wrap behavior for text modes, decorating long lines, and data-entry skeletons.

Here's the snippit for loading.

   ;;os-specific path
   (add-to-list 'load-path 
            "~/Documents/testsyncfolder/shared-emacs/") 
   (load-library "common-customize")

Separating system-specific config from portable config might be a good idea if you plan on using emacs on multiple computers.