Skip to content

Latest commit

 

History

History
229 lines (215 loc) · 6.4 KB

emacs-config.org

File metadata and controls

229 lines (215 loc) · 6.4 KB

Customizations

disabling annoying defaults

(put 'set-goal-column 'disabled nil)

make windows a little transparent

(setq transparency-level 90)
(set-frame-parameter nil 'alpha transparency-level)
(add-hook 'after-make-frame-functions (lambda (selected-frame) (set-frame-parameter selected-frame 'alpha transparency-level)))

keys

setup keyboard type

(set-keyboard-coding-system 'mac-roman)

alt key == meta

(setq mac-option-modifier 'meta)

disable downcase region because of key conflict

(put 'downcase-region 'disabled nil)

shortcuts for “other window” window movement

(global-set-key (kbd "C-x C-n") 'other-window)
(global-set-key (kbd "C-x C-p") 'other-window-backward)

added shortcut for “wrap region with tag”

(global-set-key (kbd "C-c w") 'wrap-region-with-tag)

org mode shortcuts

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)

keys for lusty explorer

(global-set-key (kbd "<f5>") 'lusty-file-explorer)
(global-set-key (kbd "<f6>") 'lusty-buffer-explorer)

kill “tabbed editor windows” as a concept

(tabbar-mode 0)

replace shitty old buffer display with ibuff

(global-set-key (kbd "C-x C-b") 'ibuffer-list-buffers)

add better keys for bookmark set & retrieve

(global-set-key (kbd "<f8>") 'bookmark-jump)
(global-set-key (kbd "<f7>") 'bookmark-set)

Color Themes

load them up

(add-to-list 'load-path "~/.emacs.d/color-theme")
(require 'color-theme)
(color-theme-initialize)

some favorite themes

;(color-theme-arjen)
;(color-theme-charcoal-black)
;(color-theme-billw)
(color-theme-clarity)
;(color-theme-calm-forest)
;(color-theme-lethe)

MobileOrg

directories and such

(setq org-mobile-directory "~/Dropbox/MobileOrg")
(setq org-directory "~/work/ppap/Notes,_Minutes,_Ideas,_Outlines/outlines")
(setq org-mobile-inbox-for-pull "~/Dropbox/MobileOrg")

My functions

Clean devworks code

Clean devworks listings (currently not working)

(defun clean-code nil "Clean up code listings for XML embedation"
(interactive)
(query-replace "<" "lt;")
(query-replace ">" "gt;")
(query-replace "&" "&amp;"))

Window functions

handy windowing function, based on Emacs Extensions book

(defun other-window-backward (&optional n)
  "Select the previous window."
  (interactive "P")
  (other-window (- (prefix-numeric-value n))))

Found simple word count function

(defun word-count nil "Count words in buffer" (interactive)
(shell-command-on-region (point-min) (point-max) "wc -w"))

wrap each line in the selected region with a begin-end tag

(defun wrap-tag-lines (b e tag)
  "'tag' every line in the region with a tag"
  (interactive "r\nMTag for line: ")
  (save-restriction
    (narrow-to-region b e)
    (save-excursion
      (goto-char (point-min))
      (while (< (point) (point-max))
        (beginning-of-line)
        (insert (format "<%s>" tag))
        (end-of-line)
        (insert (format "</%s>" tag))
        (forward-line 1)))))

Langauge modes

scheme

(setenv "MITSCHEME_LIBRARY_PATH"  "/Applications/mit-scheme.app/Contents/Resources")

scala

(add-to-list 'load-path "~/.emacs.d/scala")  
(require 'scala-mode-auto)

groovy

setup and some path munging to make Groovy happier

(autoload 'groovy-mode "groovy-mode" "Groovy editing mode." t)
(add-to-list 'auto-mode-alist '("\.groovy$" . groovy-mode))
(add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode))

(defvar lib-dir "/Users/nford/bin/")
(setenv "GROOVY_HOME" (concat lib-dir "groovy-1.7.10"))
(setenv "PATH" (concat (getenv "PATH")
		       ":" (getenv "GROOVY_HOME") "/bin"))

markdown

(setenv "PATH" (concat (getenv "PATH") ":" lib-dir "markdown/markdown"))

extensions

Minimap

Emulates Sublime Text’s minimap with a real buffer

(require 'minimap)

DocBook

Docbook support

(autoload 'docbook-xml-mode "docbook-xml-mode" "Major mode for
Docbook" t)

Flyspell

(require 'flyspell)
(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
(setq-default flyspell-mode t)

;; auto-load for flyspell mode
(dolist (hook '(markdown-mode-hook))
  (add-hook hook (lambda () (flyspell-mode 1))))
(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
(setq-default flyspell-mode t)
(dolist (hook '(markdown-mode-hook))
  (add-hook hook (lambda () (flyspell-mode 1))))
;; killer flyspell-check-previous-highlighted-word keybinding
(global-set-key (kbd "C-c j") 'flyspell-check-previous-highlighted-word)

ido

(require 'ido)
(ido-mode t)
(setq ido-enable-flex-matching t)

YAS

(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/plugins/yasnippet/snippets")

;; reset some keys to help recursive expansion
(define-key yas/keymap [tab] 'yas/expand)

word count minor mode

Minor mode to count words.

(autoload 'word-count-mode "word-count"
          "Minor mode to count words." t nil)
(global-set-key "\M-+" 'word-count-mode)

emacs tile

(require 'emacsd-tile)

Associations

markdown

(autoload 'markdown-mode "markdown-mode.el"
   "Major mode for editing Markdown files" t)
(setq auto-mode-alist
   (cons '("\\.md" . markdown-mode) auto-mode-alist))

html mode (not helper mode) for html files

(setq auto-mode-alist (cons '("\\.html?$" . html-mode) auto-mode-alist))

Rake files are ruby too

(add-to-list 'auto-mode-alist '("Rakefile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake$" . ruby-mode))