From 1c1128c2e10a0cbd39b9844adab99e082f1ccdd5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 1 Jul 2013 03:03:23 +0200 Subject: [PATCH] Added mouse-support and some haskell-mode config to init.el --- .gitignore | 2 ++ init.el | 25 ++++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..07e51b9cb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/plists/.DS_Store +/.DS_Store diff --git a/init.el b/init.el index 0c5dc0bfc..74dc73428 100644 --- a/init.el +++ b/init.el @@ -8,12 +8,31 @@ ;; Important packages (defvar my-pkgs '(starter-kit starter-kit-bindings haskell-mode) - "A list of packages to install at launch.") + "Packages to install at launch.") (dolist (p my-pkgs) (when (not (package-installed-p p)) (package-install p))) +;; Enable mouse support on OS X +(unless window-system + (require 'mouse) + (xterm-mouse-mode t) + (global-set-key [mouse-4] '(lambda () + (interactive) + (scroll-down 1))) + (global-set-key [mouse-5] '(lambda () + (interactive) + (scroll-up 1))) + (defun track-mouse (e)) + (setq mouse-sel-mode t) +) + ;; Configure haskell-mode -(custom-set-variables - '(haskell-mode-hook '(turn-on-haskell-indentation))) +;; Enable semi-automatic indentation and font-locking +(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) +(add-hook 'haskell-mode-hook 'font-lock-mode) + +;; Add keybindings to move nested blocks with C-, rsp. C-. +(define-key haskell-mode-map (kbd "C-,") 'haskell-move-nested-left) +(define-key haskell-mode-map (kbd "C-.") 'haskell-move-nested-right)