Skip to content

Instantly share code, notes, and snippets.

@arnar
Created December 12, 2011 16:11
Show Gist options
  • Save arnar/1468048 to your computer and use it in GitHub Desktop.
Save arnar/1468048 to your computer and use it in GitHub Desktop.
;; Personal prefs.
(setq user-mail-address "x")
(global-set-key "\C-w" 'backward-kill-word)
(global-set-key "\C-x\C-k" 'kill-region)
;; Packages and bundles
(add-to-list 'load-path "~/.emacs.d/")
(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")
;; Viper mode
;; (setq viper-mode t)
;; (require 'viper)
;; Let's try Evil instead
(add-to-list 'load-path "~/.emacs.d/evil")
(add-to-list 'load-path "~/.emacs.d/evil-surround")
(require 'evil)
(require 'surround)
(evil-mode 1)
(global-surround-mode 1)
(define-key evil-normal-state-map ",i" 'ibuffer)
(define-key evil-normal-state-map ",b" 'ido-switch-buffer)
(define-key evil-normal-state-map ",m" 'magit-status)
(define-key evil-normal-state-map "ZZ" (kbd "C-c C-c"))
;; org-mode relaterat
(define-key evil-normal-state-map ",a" 'org-agenda)
;; lisp-relaterat som annars inte verkar fungera
(define-key evil-normal-state-map ",hv" 'describe-variable)
(define-key evil-normal-state-map ",hk" 'describe-key)
(define-key evil-normal-state-map ",hf" 'describe-function)
(define-key evil-normal-state-map ",hm" 'describe-mode)
;; End of evil config copied from monotux@reddit
;; Spelling
(setq ispell-program-name "/usr/local/bin/aspell")
(setq ispell-extra-args '("-d" "/Library/Application Support/cocoAspell/aspell6-en-6.0-0/en.multi"))
;; Set up c-mode and relatives
(setq compilation-window-height 8)
(setq compilation-finish-function
(lambda (buf str)
(if (string-match "exited abnormally" str)=
(message "compilation errors, press C-X ` to visit")
(run-at-time 0.5 nil 'delete-windows-on buf)
(message "Compiled successfully"))))
;; To use all spaces indentation for c and co
(require 'cc-mode)
(defun my-build-tab-stop-list (width)
(let ((num-tab-stops (/ 80 width))
(counter 1)
(ls nil))
(while (<= counter num-tab-stops)
(setq ls (cons (* width counter) ls))
(setq counter (1+ counter)))
(set (make-local-variable 'tab-stop-list) (nreverse ls))))
(defun my-c-mode-common-hook ()
(setq tab-width 5) ;; change this to taste, this is what K&R uses :)
(my-build-tab-stop-list tab-width)
(setq c-basic-offset tab-width)
(setq indent-tabs-mode nil)) ;; force only spaces for indentation
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
(require 'color-theme)
(color-theme-initialize)
;(require 'ipython)
(setq ansi-color-for-comint-mode t)
(load "~/.emacs.d/haskell-mode/haskell-site-file")
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
;; Do not change directory to ~/.cabal on load
(setq inferior-haskell-find-project-root nil)
;(load "~/.emacs.d/haskell-indentation.el")
;(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
(require 'hpaste)
(require 'column-marker)
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/.emacs.d/snippets/")
;; (load-file "~/.emacs.d/dvc-snapshot/++build/dvc-load.el")
;; (load-file (let ((coding-system-for-read 'utf-8))
;; (shell-command-to-string "~/bin/agda-mode locate")))
(require 'tabbar)
(define-key global-map [(alt j)] 'tabbar-backward)
(define-key global-map [(alt k)] 'tabbar-forward)
(defun sacha/increase-font-size ()
(interactive)
(set-face-attribute 'default
nil
:height
(ceiling (* 1.10
(face-attribute 'default :height)))))
(defun sacha/decrease-font-size ()
(interactive)
(set-face-attribute 'default
nil
:height
(floor (* 0.9
(face-attribute 'default :height)))))
(global-set-key (kbd "C-+") 'sacha/increase-font-size)
(global-set-key (kbd "C--") 'sacha/decrease-font-size)
;; Hitting delete will delete region and selecting a region and then
;; press a character will replace region with that character.
(pending-delete-mode 1)
;; Indent with spaces, instead of tabs.
(setq-default indent-tabs-mode nil)
;; No backup files
;;(setq make-backup-files nil)
;; kill-line will kill whole line (including empty line).
(setq kill-whole-line t)
;; Rectangle mode
(setq cua-enable-cua-keys nil)
(setq cua-toggle-set-mark nil)
(cua-mode)
;; Unicode char entry
(setq read-quoted-char-radix 16)
(defun unicode-insert (char)
"Read a unicode code point and insert said character.
Input uses `read-quoted-char-radix'. If you want to copy
the values from the Unicode charts, you should set it to 16."
(interactive (list (read-quoted-char "Char: ")))
(ucs-insert char))
;; ansi-term colors
(setq ansi-term-color-vector
[unspecified "black" "firebrick1" "green3" "yellow3" "steelblue1"
"deeppink1" "cyan3" "grey90"])
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:stipple nil :background "grey20" :foreground "grey90" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 100 :width normal :family "DejaVu Sans Mono"))))
'(agda2-highlight-datatype-face ((t (:foreground "sky blue"))))
'(agda2-highlight-error-face ((t (:foreground "magenta" :underline t))))
'(agda2-highlight-field-face ((t (:foreground "DeepPink1"))))
'(agda2-highlight-function-face ((t (:foreground "sky blue"))))
'(agda2-highlight-inductive-constructor-face ((t (:foreground "green2"))))
'(agda2-highlight-keyword-face ((t (:foreground "Orange2"))))
'(agda2-highlight-module-face ((t (:foreground "violet"))))
'(agda2-highlight-number-face ((t (:foreground "violet"))))
'(agda2-highlight-postulate-face ((t (:foreground "sky blue"))))
'(agda2-highlight-primitive-face ((t (:foreground "sky blue"))))
'(agda2-highlight-primitive-type-face ((t (:foreground "sky blue"))))
'(agda2-highlight-record-face ((t (:foreground "sky blue"))))
'(agda2-highlight-string-face ((t (:foreground "firebrick1"))))
'(background "blue")
'(comint-highlight-prompt ((t (:foreground "gray90"))))
'(cursor ((t (:background "green"))))
'(font-lock-builtin-face ((((class color) (background dark)) (:foreground "Turquoise"))))
'(font-lock-comment-face ((t (:foreground "MediumAquamarine"))))
'(font-lock-constant-face ((((class color) (background dark)) (:bold t :foreground "DarkOrchid"))))
'(font-lock-doc-string-face ((t (:foreground "green2"))))
'(font-lock-function-name-face ((t (:foreground "SkyBlue"))))
'(font-lock-keyword-face ((t (:bold t :foreground "CornflowerBlue"))))
'(font-lock-preprocessor-face ((t (:italic nil :foreground "CornFlowerBlue"))))
'(font-lock-reference-face ((t (:foreground "DodgerBlue"))))
'(font-lock-string-face ((t (:foreground "LimeGreen"))))
'(font-lock-type-face ((t (:foreground "#9290ff"))))
'(font-lock-variable-name-face ((t (:foreground "PaleGreen"))))
'(font-lock-warning-face ((((class color) (background dark)) (:foreground "yellow" :background "red"))))
'(header-line ((t (:inherit mode-line :background "grey40" :foreground "white"))))
'(highlight ((t (:background "CornflowerBlue"))))
'(isearch ((nil (:foreground "grey20" :background "yellow" :weight bold))))
'(lazy-highlight ((((type tty pc) (class color)) (:foreground "dodger-blue" :weight extra-light))))
'(list-mode-item-selected ((t (:background "gold"))))
'(makefile-space-face ((t (:background "wheat"))))
'(minibuffer-prompt ((t (:foreground "grey90"))))
'(mode-line ((t (:background "Navy"))))
'(mouse ((t (:background "yellow"))))
'(nxml-delimited-data-face ((nil (:foreground "light blue"))))
'(nxml-delimiter-face ((t (:foreground "grey70"))))
'(nxml-name-face ((nil (:foreground "light green"))))
'(paren-match ((t (:background "darkseagreen4"))))
'(region ((t (:background "DarkSlateBlue"))))
'(show-paren-match ((t (:foreground "black" :background "wheat"))))
'(show-paren-mismatch ((((class color)) (:foreground "white" :background "red"))))
'(speedbar-button-face ((((class color) (background dark)) (:foreground "green4"))))
'(speedbar-directory-face ((((class color) (background dark)) (:foreground "khaki"))))
'(speedbar-file-face ((((class color) (background dark)) (:foreground "cyan"))))
'(speedbar-tag-face ((((class color) (background dark)) (:foreground "Springgreen"))))
'(tabbar-button-face ((t (:inherit tabbar-default-face :foreground "grey70"))))
'(tabbar-default-face ((t (:inherit variable-pitch :background "gray30" :foreground "gray60" :height 0.8))))
'(tabbar-selected-face ((t (:inherit tabbar-default-face :foreground "grey90"))))
'(tabbar-unselected-face ((t (:inherit tabbar-default-face :foreground "grey70"))))
'(tool-bar ((((type x w32 mac) (class color)) (:box (:line-width 1 :style released-button)))))
'(vhdl-speedbar-architecture-selected-face ((((class color) (background dark)) (:underline t :foreground "Blue"))))
'(vhdl-speedbar-entity-face ((((class color) (background dark)) (:foreground "darkGreen"))))
'(vhdl-speedbar-entity-selected-face ((((class color) (background dark)) (:underline t :foreground "darkGreen"))))
'(vhdl-speedbar-package-face ((((class color) (background dark)) (:foreground "black"))))
'(vhdl-speedbar-package-selected-face ((((class color) (background dark)) (:underline t :foreground "black"))))
'(viper-minibuffer-emacs ((((class color)) nil)))
'(viper-replace-overlay ((((class color)) nil)))
'(viper-search ((((class color)) (:foreground "dodgerblue" :weight bold))))
'(widget-field ((((class grayscale color) (background light)) (:background "DarkBlue")))))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(agda2-include-dirs (quote ("." "/data/home/arnar/chalmers/courses/types/agdalib/lib-0.2/src")))
'(column-number-mode t)
'(global-font-lock-mode t)
'(show-paren-mode t)
'(speedbar-frame-parameters (quote ((minibuffer) (width . 20) (border-width . 0) (menu-bar-lines . 0) (tool-bar-lines . 0) (unsplittable . t) (set-background-color "black"))))
'(split-width-threshold 200)
'(tool-bar-mode nil))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment