 (global-set-key "\C-x\C-b"                          'electric-buffer-list)
 (global-set-key "\C-c\C-b"                          'browse-url-at-point)
 
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;;; Appearance ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Command key mapped to meta in OSX
+(setq mac-option-modifier 'none)
+(setq mac-command-modifier 'meta)
+
+; Misc appearance
 (set-scroll-bar-mode                          -1) ; no scrollbar
 (menu-bar-mode                                -1) ; no menubar
 (tool-bar-mode                                -1) ; no buttonbar

;; .emacs
;; awdeorio's emacs customizations

;; Added by Package.el.  This must come before configurations of
;; installed packages.
(package-initialize)

; customizations go in ~/.elisp, check this dir first
(setq load-path (append load-path (list (expand-file-name "~/.emacs.d/elisp"))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Customized Keybindings ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Command key mapped to meta
(setq mac-option-modifier 'none)
(setq mac-command-modifier 'meta)

(global-set-key "\C-ci"                             'indent-to)
(global-set-key "\C-cl"                             'this-line-to-top-of-window)
(global-set-key "\C-\M-_"                           'redo)

(add-to-list 'auto-mode-alist '("\\.md\\'" . visual-line-mode))
(add-to-list 'auto-mode-alist '("README" . visual-line-mode))

; PHP mode
(autoload 'php-mode "php-mode" "Enter PHP mode." t)
(setq auto-mode-alist (cons '("\\.php\\'" . php-mode) auto-mode-alist))

; Graphviz dot mode
(autoload 'graphviz-dot-mode "graphviz-dot-mode" "Enter Graphviz mode." t)
(setq auto-mode-alist (cons '("\\.dot\\'" . graphviz-dot-mode) auto-mode-alist))

; Spell checking mode
(autoload 'flyspell-mode-on "flyspell" "On-the-fly ispell." t)
(add-hook 'latex-mode-hook 'flyspell-mode)
(add-hook 'text-mode-hook 'flyspell-mode)
(add-hook 'html-mode-hook 'flyspell-mode)

; Outline mode
(add-hook 'outline-minor-mode-hook       ; C-m is the prefix key
          (lambda () (local-set-key "\C-m" outline-mode-prefix-map)))
(add-hook 'outline-mode-hook             ; C-m is the prefix key
          (lambda () (local-set-key "\C-m" outline-mode-prefix-map)))

; Todo.txt mode
; https://github.com/rpdillon/todotxt.el/blob/master/readme.org
(require 'todotxt)
(add-to-list 'auto-mode-alist '("todo.txt" . todotxt-mode))
(add-to-list 'auto-mode-alist '("bills.*" . todotxt-mode))
(add-hook 'todotxt-mode-hook 'goto-address-mode) ; for URLs
(add-hook 'todotxt-mode-hook 'global-auto-revert-mode) ; for Dropbox

; C-mode for Arduino files (.ino)
(add-to-list 'auto-mode-alist '("\\.ino$" . c-mode))

; Tab completion
(setq hippie-expand-try-functions-list
      '(try-expand-dabbrev
        try-expand-dabbrev-all-buffers
