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 From 0f074a7e25da6ef4f6aaf0433cc48dfd5b353415 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 21:51:43 +0200 Subject: Fixes to .emacs --- .emacs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to '.emacs') diff --git a/.emacs b/.emacs index 4bb3336..27eb5ce 100644 --- a/.emacs +++ b/.emacs @@ -1,3 +1,12 @@ +(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/"))) + + (defun ensure-package-installed (&rest packages) "Assure every package is installed, ask for installation if it’s not. @@ -17,13 +26,6 @@ Return a list of installed packages or nil for every skipped package." (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 -- cgit v1.2.3 From 8021595407c5338f408afcb2eba0ddbd7fb331eb Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 21:54:35 +0200 Subject: Fixes to .emacs --- .emacs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.emacs') diff --git a/.emacs b/.emacs index 27eb5ce..ee4bb1e 100644 --- a/.emacs +++ b/.emacs @@ -6,6 +6,7 @@ ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) +(package-initialize) (defun ensure-package-installed (&rest packages) "Assure every package is installed, ask for installation if it’s not. @@ -28,7 +29,6 @@ Return a list of installed packages or nil for every skipped package." (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/") -- cgit v1.2.3 From f34fb82051b0ad29c4786fe2848fe2e65031f9d9 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 21:57:38 +0200 Subject: Added MELPA to .emacs --- .emacs | 2 ++ 1 file changed, 2 insertions(+) (limited to '.emacs') diff --git a/.emacs b/.emacs index ee4bb1e..9342025 100644 --- a/.emacs +++ b/.emacs @@ -2,6 +2,8 @@ (add-to-list 'package-archives '("marmaled" . "http://marmalade-repo.org/packages/") t) +(add-to-list 'package-archives + '("melpa" . "http://melpa.org/packages/")) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))) -- cgit v1.2.3 From 4fb45bb2e553f1447440f30e74877124aada68d5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 22:06:33 +0200 Subject: Added Fix to haskell faces to .emacs --- .emacs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '.emacs') diff --git a/.emacs b/.emacs index 9342025..438b60f 100644 --- a/.emacs +++ b/.emacs @@ -65,3 +65,10 @@ Return a list of installed packages or nil for every skipped package." kept-new-versions 6 kept-old-versions 2 version-control t) + +(custom-set-variables + '(haskell-font-lock-symbols t)) +(custom-set-faces + '(font-lock-type-face ((t (:foreground "PaleGreen" :weight bold)))) + '(font-lock-function-face ((t (:foreground "LightSkyBlue" :weight bold)))) + ) -- cgit v1.2.3 From 640d38abbc4302d08721624f49d56641af751ab4 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 15 Jul 2015 23:16:39 +0200 Subject: nix-mode, keychain-environment, mic-paren --- .emacs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.emacs') diff --git a/.emacs b/.emacs index 438b60f..d7de207 100644 --- a/.emacs +++ b/.emacs @@ -29,7 +29,7 @@ Return a list of installed packages or nil for every skipped package." (or (file-exists-p package-user-dir) (package-refresh-contents)) -(ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode) +(ensure-package-installed 'color-theme 'evil 'evil-dvorak 'undo-tree 'zenburn-theme 'magit 'haskell-mode 'keychain-environment 'nix-mode 'mic-paren) (package-initialize) -- cgit v1.2.3 From 4a30327944eed71d936836d05c665aa58afad85b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 16 Jul 2015 20:05:06 +0200 Subject: Tweaks to haskell-mode --- .emacs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to '.emacs') diff --git a/.emacs b/.emacs index d7de207..c35c552 100644 --- a/.emacs +++ b/.emacs @@ -66,9 +66,17 @@ Return a list of installed packages or nil for every skipped package." kept-old-versions 2 version-control t) +(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) +(eval-after-load "haskell-mode" + '(progn + (define-key haskell-mode-map (kbd "C-,") 'haskell-move-nested-lift) + (define-key haskell-mode-map (kbd "C-.") 'haskell-move-nested-right))) + (custom-set-variables '(haskell-font-lock-symbols t)) -(custom-set-faces - '(font-lock-type-face ((t (:foreground "PaleGreen" :weight bold)))) - '(font-lock-function-face ((t (:foreground "LightSkyBlue" :weight bold)))) - ) +(add-hook 'haskell-mode-hook + (custom-set-faces + '(font-lock-type-face ((t (:foreground "PaleGreen" :weight bold)))) + '(font-lock-function-face ((t (:foreground "LightSkyBlue" :weight bold)))) + ) + ) -- cgit v1.2.3