2011-06-11 19:51:08 +02:00
|
|
|
;; -*- mode: Emacs-Lisp; -*-
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; LOAD-PATHS ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(add-to-list 'load-path "~/.emacs.d/elisp")
|
|
|
|
(add-to-list 'load-path "~/.emacs.d/naquadah-theme")
|
|
|
|
(add-to-list 'load-path "~/.emacs.d/elisp/markdown-mode")
|
|
|
|
(add-to-list 'load-path "~/.emacs.d/elisp/git-commit-mode")
|
2011-06-26 12:41:49 +02:00
|
|
|
(add-to-list 'load-path "~/.emacs.d/elisp/lua-mode")
|
2011-06-11 19:51:08 +02:00
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; REQUIRES ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(require 'naquadah-theme)
|
|
|
|
(require 'autopair)
|
|
|
|
(require 'column-marker)
|
|
|
|
(require 'git-commit)
|
|
|
|
(require 'org-crypt)
|
|
|
|
(require 'rainbow-delimiters)
|
|
|
|
(require 'uniquify)
|
|
|
|
(require 'server)
|
|
|
|
(require 'org-publish)
|
2011-06-15 12:19:30 +02:00
|
|
|
(require 'htmlize)
|
2011-06-26 12:41:49 +02:00
|
|
|
(require 'muttrc-mode)
|
2011-06-11 19:51:08 +02:00
|
|
|
|
2011-06-26 12:41:49 +02:00
|
|
|
(load-file "~/.emacs.d/functions.el")
|
2011-06-11 19:51:08 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; AUTOLOADS ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2011-06-26 12:41:49 +02:00
|
|
|
(autoload 'vala-mode "vala-mode" "Major mode for Vala" t)
|
|
|
|
(autoload 'csharp-mode "csharp-mode" "Major mode for C#" t)
|
|
|
|
(autoload 'sqlplus-mode "sqlplus" "Major mode for PL/SQL" t)
|
|
|
|
(autoload 'batch-mode "batch-mode" "Major mode for Batch" t)
|
|
|
|
(autoload 'lua-mode "lua-mode" "A Major mode for Lua" t)
|
|
|
|
(autoload 'php-mode "php-mode-improved" "Major mode for PHP" t)
|
|
|
|
(autoload 'graphviz-dot-mode "graphviz-dot-mode" "Major mode for dot" t)
|
|
|
|
(autoload 'cmake-mode "cmake-mode" "Major mode for CMake" t)
|
|
|
|
(autoload 'markdown-mode "markdown-mode" "Major mode for Markdown" t)
|
|
|
|
(autoload 'rainbow-mode "rainbow-mode" "Minor mode for colors" t)
|
|
|
|
(autoload 'stumpwm-mode "stumpwm-mode" "Major mode for stumpwm" t)
|
|
|
|
(autoload 'muttrc-mode "muttrc-mode" "Major mode for muttrc" t)
|
|
|
|
;; Go
|
|
|
|
(autoload 'go-mode "go-mode" "Major mode for google go" t)
|
|
|
|
(autoload 'gofmt "go-mode" "" t)
|
|
|
|
(autoload 'go-fmt-before-save "go-mode" "" t)
|
2011-06-15 12:19:30 +02:00
|
|
|
|
2011-06-11 19:51:08 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; VARIABLES ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(defvar font-lock-operator-face 'font-lock-operator-face)
|
|
|
|
(defvar font-lock-end-statement 'font-lock-end-statement)
|
|
|
|
|
|
|
|
(defadvice server-create-window-system-frame
|
|
|
|
(after set-system-frame-colours ())
|
|
|
|
"Set custom frame colours when creating the first frame on a display"
|
|
|
|
(message "Running after frame-initialize")
|
|
|
|
(setup-system-frame-colours))
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; FILE ASSOCIATIONS ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.vala$" . vala-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.vapi$" . vala-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.bat$" . batch-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.php[345]?$" . php-mode))
|
2011-06-15 12:19:30 +02:00
|
|
|
(add-to-list 'auto-mode-alist '("\\.js\\(on\\)?$" . js-mode))
|
2011-06-11 19:51:08 +02:00
|
|
|
(add-to-list 'auto-mode-alist '("\\.m\\(ark\\)?do?wn$". markdown-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("CMakeLists\\.txt$" . cmake-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.cmake$" . cmake-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.css$" . css-mode))
|
2011-06-15 12:19:30 +02:00
|
|
|
(add-to-list 'auto-mode-alist '("mutt-cloud-" . mail-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("stumpwmrc" . stumpwm-mode))
|
2011-06-26 12:41:49 +02:00
|
|
|
(add-to-list 'auto-mode-alist '("\\.go$" . go-mode))
|
2011-06-11 19:51:08 +02:00
|
|
|
|
|
|
|
(add-to-list 'file-coding-system-alist '("\\.vala$" . utf-8))
|
|
|
|
(add-to-list 'file-coding-system-alist '("\\.vapi$" . utf-8))
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; KEYBINDS ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(global-set-key "\C-m" 'newline-and-indent)
|
|
|
|
(global-set-key (kbd "C-x n r") 'narrow-to-region)
|
|
|
|
(global-set-key "\C-cl" 'org-store-link)
|
|
|
|
(global-set-key "\C-cc" 'org-capture)
|
|
|
|
(global-set-key "\C-ca" 'org-agenda)
|
2011-06-15 12:19:30 +02:00
|
|
|
(global-set-key [f5] '(lambda ()
|
|
|
|
(interactive)
|
|
|
|
(revert-buffer nil t nil)))
|
2011-06-26 12:41:49 +02:00
|
|
|
(global-set-key [M-left] 'windmove-left)
|
|
|
|
(global-set-key [M-right] 'windmove-right)
|
|
|
|
(global-set-key [M-up] 'windmove-up)
|
|
|
|
(global-set-key [M-down] 'windmove-down)
|
2011-06-11 19:51:08 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; THEME SETTINGS ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(naquadah-theme-set-faces
|
|
|
|
'naquadah
|
|
|
|
|
|
|
|
;; markdown-mode
|
|
|
|
'(markdown-link-face (:inherit 'link))
|
|
|
|
'(markdown-header-face-1 (:inherit 'org-level-1))
|
|
|
|
'(markdown-header-face-2 (:inherit 'org-level-2))
|
|
|
|
'(markdown-header-face-3 (:inherit 'org-level-3))
|
|
|
|
'(markdown-header-face-4 (:inherit 'org-level-4))
|
|
|
|
'(markdown-header-face-5 (:inherit 'org-level-5))
|
|
|
|
'(markdown-header-face-6 (:inherit 'org-level-6)))
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; SETTINGS ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2011-06-22 21:46:22 +02:00
|
|
|
(setq-default indent-tabs-mode nil) ; spaces, no tabs
|
|
|
|
(setq-default truncate-lines t) ; don't wrap
|
|
|
|
(setq-default php-warn-if-mumamo-off nil) ; don't warn me about this
|
|
|
|
|
|
|
|
(setq inhibit-startup-message t) ; Don't show welcome screen
|
|
|
|
(setq require-final-newline t) ; Always put final newline
|
|
|
|
(setq inhibit-default-init t) ; Don't load default library
|
|
|
|
(setq scroll-conservatively 101) ; scroll only one line
|
|
|
|
(setq browse-url-browser-function 'browse-url-generic)
|
|
|
|
(setq browse-url-generic-program "$BROWSER")
|
|
|
|
(setq whitespace-style '(face trailing)) ; For use with markdown mode
|
|
|
|
(setq uniquify-buffer-name-style 'reverse)
|
|
|
|
(setq org-confirm-babel-evaluate nil)
|
|
|
|
(setq org-tags-exclude-from-inheritance '("crypt"))
|
|
|
|
(setq org-crypt-key "33E8CC1CC4")
|
|
|
|
(setq org-use-fast-todo-selection t)
|
|
|
|
(setq org-default-notes-file (concat org-directory "/notes.org"))
|
|
|
|
(setq org-ditaa-jar-path "/usr/share/java/ditaa/ditaa-0_9.jar")
|
|
|
|
(setq jit-lock-defer-time 0.2) ; Don't fontlock immediately
|
|
|
|
(setq htmlize-output-type 'inline-css)
|
|
|
|
(setq ido-save-directory-list-file nil)
|
|
|
|
(setq ido-auto-merge-delay-time 2) ; Wait before fixing names
|
|
|
|
(setq org-outline-path-complete-in-steps t)
|
|
|
|
|
|
|
|
(setq frame-title-format ; I don't like emacs@cloud, must have file
|
|
|
|
'(:eval ; name
|
|
|
|
(concat "emacs: " (buffer-name))))
|
|
|
|
|
|
|
|
(setq backup-directory-alist ; backup file location
|
|
|
|
`((".*" . ,temporary-file-directory)))
|
|
|
|
|
|
|
|
(setq auto-save-file-name-transforms ; autosave file location
|
|
|
|
`((".*" ,temporary-file-directory t)))
|
|
|
|
|
|
|
|
(setq default-frame-alist ; default frame settings
|
|
|
|
(append '((font . "DejaVu Sans Mono-10:antialias=true"))))
|
|
|
|
|
|
|
|
(setq org-todo-keywords
|
2011-06-11 19:51:08 +02:00
|
|
|
'((sequence "TODO(t)"
|
|
|
|
"IN PROGRESS(p)"
|
|
|
|
"WAITING(w@/!)"
|
|
|
|
"|"
|
|
|
|
"DONE(d!/!)"
|
2011-06-22 21:46:22 +02:00
|
|
|
"CANCELLED(c@/!)")))
|
2011-06-11 19:51:08 +02:00
|
|
|
|
2011-06-22 21:46:22 +02:00
|
|
|
(setq org-babel-load-languages
|
|
|
|
'((ditaa . t)))
|
2011-06-11 19:51:08 +02:00
|
|
|
|
2011-06-22 21:46:22 +02:00
|
|
|
(setq org-refile-targets
|
2011-06-11 19:51:08 +02:00
|
|
|
'((org-agenda-files :maxlevel . 5)
|
2011-06-22 21:46:22 +02:00
|
|
|
(nil :maxlevel . 5)))
|
2011-06-11 19:51:08 +02:00
|
|
|
|
2011-06-22 21:46:22 +02:00
|
|
|
(setq org-todo-keyword-faces
|
2011-06-11 19:51:08 +02:00
|
|
|
'(("TODO" :foreground "red" :weight bold)
|
|
|
|
("IN PROGRESS" :foreground "yellow" :weight bold)
|
|
|
|
("DONE" :foreground "forest green" :weight bold)
|
|
|
|
("WAITING" :foreground "orange" :weight bold)
|
2011-06-22 21:46:22 +02:00
|
|
|
("CANCELLED" :foreground "orangered" :weight bold)))
|
|
|
|
|
|
|
|
(if window-system
|
|
|
|
(x-init)
|
|
|
|
(cli-init))
|
2011-06-11 19:51:08 +02:00
|
|
|
|
|
|
|
(fset 'yes-or-no-p 'y-or-n-p) ; switch yes or no to y or n
|
|
|
|
|
2011-06-22 21:46:22 +02:00
|
|
|
(tool-bar-mode -1) ; no toolbar
|
|
|
|
(menu-bar-mode -1) ; no menubar
|
|
|
|
(scroll-bar-mode -1) ; no scrollbars
|
|
|
|
(line-number-mode -1) ; don't show line number in splitter
|
|
|
|
(global-linum-mode t) ; Show line numbers in gutter
|
|
|
|
(column-number-mode t) ; show column number in splitter
|
2011-06-11 19:51:08 +02:00
|
|
|
(global-font-lock-mode t) ; show syntax highlighting, old
|
|
|
|
(delete-selection-mode t) ; delete selection upon typing
|
2011-06-22 21:46:22 +02:00
|
|
|
(show-paren-mode t) ; show the opposite paren
|
|
|
|
(ido-mode t)
|
|
|
|
(autopair-global-mode) ; automatically add the other delimiter
|
2011-06-11 19:51:08 +02:00
|
|
|
|
|
|
|
(add-to-list 'compilation-finish-functions 'my-comp-finish-function)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; HOOKS ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(add-hook 'before-save-hook 'on-before-save)
|
|
|
|
(add-hook 'after-save-hook 'on-after-save)
|
2011-06-17 16:39:16 +02:00
|
|
|
(add-hook 'prog-mode-hook 'on-prog-mode)
|
2011-06-11 19:51:08 +02:00
|
|
|
(add-hook 'c-mode-hook 'on-c-mode)
|
|
|
|
(add-hook 'html-mode-hook 'on-html-mode)
|
|
|
|
(add-hook 'markdown-mode-hook 'on-markdown-mode)
|
|
|
|
(add-hook 'org-mode-hook 'on-org-mode)
|
|
|
|
(add-hook 'php-mode-hook 'on-php-mode)
|
2011-06-15 12:19:30 +02:00
|
|
|
(add-hook 'mail-mode-hook 'on-mail-mode)
|
2011-06-11 19:51:08 +02:00
|
|
|
(add-hook 'git-commit-mode-hook 'auto-fill-mode)
|
|
|
|
(add-hook 'emacs-startup-hook 'fullscreen)
|
|
|
|
(add-hook 'css-mode-hook 'rainbow-mode)
|
|
|
|
(add-hook 'after-make-frame-functions 'setup-system-frame-colours t)
|
|
|
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; SKELETONS ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(define-skeleton cmake-project-skeleton
|
|
|
|
"A cmake project template file"
|
|
|
|
"Name: "
|
|
|
|
"cmake_minimum_required(VERSION 2.6)\n"
|
|
|
|
"project(" str ")\n"
|
|
|
|
"\n"
|
|
|
|
"set(" str "_VERSION_MAJOR 0)\n"
|
|
|
|
"set(" str "_VERSION_MINOR 0)\n"
|
|
|
|
"set(" str "_VERSION_PATCH 0)\n"
|
|
|
|
"\n"
|
|
|
|
"set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})\n"
|
|
|
|
"add_subdirectory(src)")
|
|
|
|
|
2011-06-17 16:39:16 +02:00
|
|
|
(define-skeleton myaethon-set-varchar-docstring
|
|
|
|
"A docstring for a varchar setter"
|
|
|
|
""
|
|
|
|
"\/* Setter for the "
|
|
|
|
(skeleton-read "name: ")
|
|
|
|
" column\n"
|
|
|
|
"\n"
|
|
|
|
'(indent-according-to-mode)
|
|
|
|
"$value: string, no longer than "
|
|
|
|
(skeleton-read "len: ")
|
|
|
|
" characters */"
|
|
|
|
'(fill-paragraph))
|
|
|
|
|
|
|
|
(define-skeleton myaethon-set-array-varchar-docstring
|
|
|
|
"A docstring for an array/varchar setter"
|
|
|
|
""
|
|
|
|
'(setq name (skeleton-read "name: "))
|
|
|
|
'(setq len (string-to-number (skeleton-read "length: ")))
|
|
|
|
'(setq size (floor (/ (- len 1) 2)))
|
|
|
|
"/* Setter for the "
|
|
|
|
name
|
|
|
|
" column\n"
|
|
|
|
"\n"
|
|
|
|
'(indent-according-to-mode)
|
|
|
|
"$value: array, with no more than "
|
|
|
|
(number-to-string size)
|
|
|
|
" elements; string, no langer than "
|
|
|
|
(number-to-string len)
|
|
|
|
" characters */"
|
|
|
|
'(fill-paragraph))
|
|
|
|
|
2011-06-11 19:51:08 +02:00
|
|
|
(org-crypt-use-before-save-magic)
|
|
|
|
(ad-activate 'server-create-window-system-frame)
|
|
|
|
(add-php-keywords)
|
|
|
|
(add-html-keywords)
|
|
|
|
(make-face 'font-lock-operator-face)
|
|
|
|
(make-face 'font-lock-end-statement)
|
|
|
|
(set-face-foreground 'font-lock-operator-face "#EDD400")
|
|
|
|
(set-face-foreground 'font-lock-end-statement "#888A85")
|
|
|
|
|
|
|
|
(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.
|
|
|
|
'(org-agenda-files (quote ("~/documents/org/main.org")))
|
|
|
|
'(safe-local-variable-values (quote ((Mode . shell-script) (ispell-local-dictionary . nl)))))
|
|
|
|
(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.
|
|
|
|
)
|
|
|
|
(put 'narrow-to-region 'disabled nil)
|