From 8de3d902ae7df10c3444cf4b2993d132c3efaea1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 21:35:49 +0200 Subject: First try at .emacs --- .emacs | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .emacs (limited to '.emacs') diff --git a/.emacs b/.emacs new file mode 100644 index 0000000..4bb3336 --- /dev/null +++ b/.emacs @@ -0,0 +1,63 @@ +(defun ensure-package-installed (&rest packages) + "Assure every package is installed, ask for installation if it’s not. + +Return a list of installed packages or nil for every skipped package." + (mapcar + (lambda (package) + ;; (package-installed-p 'evil) + (if (package-installed-p package) + nil + (if (y-or-n-p (format "Package %s is missing. Install it? " package)) + (package-install package) + package))) + packages)) + +;; make sure to have downloaded archive description. +;; Or use package-archive-contents as suggested by Nicolas Dudebout +(or (file-exists-p package-user-dir) + (package-refresh-contents)) + +(require 'package) +(add-to-list 'package-archives + '("marmaled" . "http://marmalade-repo.org/packages/") t) +(when (< emacs-major-version 24) + ;; For important compatibility libraries like cl-lib + (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) + +(ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode) + +;; activate installed packages +(package-initialize) + +(add-to-list 'load-path "~/.nix-profile/share/emacs/site-lisp/") +(add-to-list 'load-path "/run/current-system/sw/share/emacs/site-lisp/") + +(menu-bar-mode -1) +(scroll-bar-mode -1) + +(require 'evil) +(evil-mode 1) + +(require 'color-theme) +(color-theme-initialize) +(if (daemonp) + (add-hook 'after-make-frame-functions + (lambda (frame) + (with-selected-frame frame + (color-theme-ld-dark)))) + (color-theme-ld-dark) + ) + +(global-undo-tree-mode) + +(set-default-font "DejaVu Sans Mono") +(tool-bar-mode -1) + +(global-set-key (kbd "RET") 'newline-and-indent) +(global-set-key (kbd "M-g") 'magit-status) + +(setq backup-directory-alist `(("." . "~/.saves"))) +(setq delete-old-versions t + kept-new-versions 6 + kept-old-versions 2 + version-control t) -- cgit v1.2.3