My .emacs file

I am using the Evil package, which essentially embeds the Vim editor inside Emacs. As I documented here, the behavior of ( and ) commands is inconsistent with that of Vim: in Vim, ( and ) move the cursor based on sentence, but in Evil, its move is based on paragraph. I think I can live with that, we’ll see.

Anoter thing that I miss is the super tab plugin that I like from Vim. It does completion based on text already in the buffer(s). This is very handy for composing emails and writing documentation. This is different from the auto-complete and yasnippert packages on Emacs. After some searching and hacking, I was able to get that to work.

Here is my .emacs config for now. A few highlights:

  • On Windows, the default .emacs location is at c:\users\username\appdata\roaming I am aware of the dotfiles practice and using the init.el file, but since this is on Windows, I opted for the simple, default solution.
  • I am using the MELPA package management. MELPA appears to be the most up to date and reliable Emacs package management based on my research so far. There are quite a bit of grumbling against Marmalade;
  • There is a section for automatic package installation: if Emacs detects a package I defined inside my-packages is not installed, it will install that automatically for me. However, for whatever reason, on Windows, if Emacs is invoked from the PowerShell console, the .emacs will not be triggered.
;; ---------------------------
;; -- Setup MELPA package management
;; ---------------------------
(require 'package)
(add-to-list 'package-archives
  '("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)

;; ---------------------------
;; -- Install packages I need
;; ---------------------------
(defvar my-packages '(evil smart-tab yasnippet)
  "A list of packages to ensure are installed at launch.")

(dolist (p my-packages)
  (when (not (package-installed-p p))
    (package-install p)))

;; ---------------------------
;; -- Config packages I need
;; ---------------------------

(require 'evil)
(evil-mode 1)
(require 'smart-tab)
(require 'yasnippet)

(add-to-list 'hippie-expand-try-functions-list
'yas/hippie-try-expand) ;put yasnippet in hippie-expansion list

(setq smart-tab-using-hippie-expand t)
(global-smart-tab-mode t)

2 thoughts on “My .emacs file”

  1. Thanks Mingle.

    Yeah, I’ve installed that the PowerShell package. I haven’t used it much yet. That may change fairly soon.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.