Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; This is the Aquamacs Preferences file.
- ;; Add Emacs-Lisp code here that should be executed whenever
- ;; you start Aquamacs Emacs. If errors occur, Aquamacs will stop
- ;; evaluating this file and print errors in the *Messags* buffer.
- ;; Use this file in place of ~/.emacs (which is loaded as well.)
- ; Core code, mostly base UI stuff.
- (setq-default tab-width 2)
- (setq-default indent-tabs-mode nil)
- (setq mac-emulate-three-button-mouse nil)
- (one-buffer-one-frame-mode 0)
- (setq cua-highlight-region-shift-only t)
- (setq load-path (cons "/Users/dfayram/lib/emacs" load-path))
- ; I do this so often...
- (defun edit-my-preferences ()
- "Edits my local preferences."
- (interactive)
- (find-file
- "/Users/dfayram/Library/Preferences/Aquamacs Emacs/Preferences.el"))
- (define-key global-map "\C-xP" 'edit-my-preferences)
- (defadvice zap-to-char (after my-zap-to-char-advice (arg char) activate)
- "Kill up to the ARG'th occurence of CHAR, and leave CHAR.
- The CHAR is replaced and the point is put before CHAR."
- (insert char)
- (forward-char -1))
- (defun my-new-frame-with-new-scratch ()
- (interactive)
- (let ((one-buffer-one-frame t))
- (new-frame-with-new-scratch)))
- (defun my-close-current-window-asktosave ()
- (interactive)
- (let ((one-buffer-one-frame t))
- (close-current-window-asktosave)))
- (define-key osx-key-mode-map (kbd "A-n") 'my-new-frame-with-new-scratch)
- (define-key osx-key-mode-map (kbd "A-w") 'my-close-current-window-asktosave)
- (defmacro quick-key (keymap &rest keypairs)
- "Quickly define keys for a specific KEYMAP by giving pairs, like (\"\\C-ca\" 'do-nothing-special)"
- `(progn ,@(map 'list (lambda (kp)
- `(define-key ,keymap ,(car kp) ,(cadr kp)))
- keypairs)))
- ; Sum essential custom mode stuff.
- (require 'ido)
- (ido-mode t)
- ; SideBrain
- (setq load-path (cons "/Users/dfayram/lib/emacs/sidebrain" load-path))
- (require 'sidebrain)
- (quick-key global-map
- ("\C-c\C-sa" 'sidebrain-begin-task)
- ("\C-c\C-se" 'sidebrain-end-task)
- ("\C-c\C-sr" 'sidebrain-resume-task)
- ("\C-c\C-ss" 'sidebrain-suspend-task)
- ("\C-c\C-so" 'sidebrain-observe)
- ("\C-c\C-sb" 'sidebrain-browse-tasks)
- ("\C-c\C-sP" 'sidebrain-new-project)
- ("\C-c\C-sG" 'sidebrain-new-project-group)
- ("\C-c\C-sp" 'sidebrain-set-project)
- ("\C-c\C-sR" 'sidebrain-reminder))
- ;(sidebrain-load-from-file)
- (add-hook 'kill-emacs-hook (lambda () (sidebrain-save-to-file)) t)
- ; Let's go, yasnippet
- ;(require 'dropdown-list)
- (setq load-path (cons "/Users/dfayram/lib/emacs/yasnippet" load-path))
- (require 'yasnippet)
- (yas/initialize)
- (yas/load-directory "~/lib/emacs/snippets/")
- (yas/load-directory "~/lib/emacs/yasnippet/snippets/")
- ; Distel stuff
- ;;This is needed for Erlang mode setup
- (setq erlang-root-dir "/p/lib/erlang")
- (setq load-path (cons "/p/lib/erlang/lib/tools-2.6.1/emacs" load-path))
- (setq exec-path (cons "/p/lib/erlang/bin" exec-path))
- (require 'erlang-start)
- ;;This is needed for Distel setup
- (let ((distel-dir "/Users/dfayram/lib/emacs/distel/elisp"))
- (unless (member distel-dir load-path)
- ; Add distel-dir to the end of load-path
- (setq load-path (append load-path (list distel-dir)))))
- (require 'distel)
- (distel-setup)
- ;;Some Erlang customizations
- (add-hook 'erlang-mode-hook
- (lambda ()
- ;; when starting an Erlang shell in Emacs, default in the node name
- (setq inferior-erlang-machine-options '("-sname" "emacs"))
- ;; add Erlang functions to an imenu menu
- (imenu-add-to-menubar "imenu")
- (yas/minor-mode-on)
- (define-key erlang-mode-map [f5] 'compile)
- (define-key erlang-mode-map (kbd "\C-c\C-dM") 'erlang-man-function)))
- ;;A number of the erlang-extended-mode key bindings are useful in the shell too
- (defconst distel-shell-keys
- '(("\C-\M-i" erl-complete)
- ("\M-?" erl-complete)
- ("\M-." erl-find-source-under-point)
- ("\M-," erl-find-source-unwind)
- ("\M-*" erl-find-source-unwind)
- )
- "Additional keys to bind when in Erlang shell.")
- (add-hook 'erlang-shell-mode-hook
- (lambda ()
- ;; add some Distel bindings to the Erlang shell
- (dolist (spec distel-shell-keys)
- (define-key erlang-shell-mode-map (car spec) (cadr spec)))))
- (setq erlang-indent-level 2)
- ; Git setups
- (setq load-path (cons "/Users/dfayram/lib/emacs/git" load-path))
- (require 'vc-git)
- (when (featurep 'vc-git) (add-to-list 'vc-handled-backends 'git))
- (require 'git)
- (autoload 'git-blame-mode "git-blame"
- "Minor mode for incremental blame for Git." t)
- ; Super-awesome table mode
- (require 'table)
- ; Markdown mode
- (require 'markdown-mode)
- (setq markdown-mode-alist (cons '("\\.text" . markdown-mode) auto-mode-alist))
- ; Paredit mode
- (require 'paredit)
- (setq scheme-mode-hook
- '(lambda () (paredit-mode +1)))
- (setq emacs-lisp-mode-hook
- '(lambda () (paredit-mode +1)))
- ; Configure SLIME
- (setq load-path (cons "/Users/dfayram/lib/emacs/slime" load-path))
- (require 'slime)
- (setq inferior-lisp-program "/Users/dfayram/bin/sbcl"
- ;; inferior-lisp-program "/Users/dfayram/lib/ccl/scripts/openmcl64"
- lisp-indent-function 'common-lisp-indent-function)
- (slime-setup)
- ; Jabber. Completely crazy
- ;; (setq load-path (cons "/Users/dfayram/lib/emacs/jabber" load-path))
- ;; (require 'gnus)
- ;; (require 'jabber)
- ; Ruby Flymake
- (require 'flymake)
- ;; Invoke ruby with '-c' to get syntax checking
- (set-face-background 'flymake-errline "red4")
- (set-face-background 'flymake-warnline "dark slate blue")
- (defun flymake-ruby-init ()
- (let* ((temp-file (flymake-init-create-temp-buffer-copy
- 'flymake-create-temp-inplace))
- (local-file (file-relative-name
- temp-file
- (file-name-directory buffer-file-name))))
- (list "ruby" (list "-c" local-file))))
- (push '(".+\\.rb$" flymake-ruby-init) flymake-allowed-file-name-masks)
- (push '("Rakefile$" flymake-ruby-init) flymake-allowed-file-name-masks)
- (push '("^\\(.*\\):\\([0-9]+\\): \\(.*\\)$" 1 2 nil 3) flymake-err-line-patterns)
- (add-hook 'ruby-mode-hook
- '(lambda ()
- ;; Don't want flymake mode for ruby regions in rhtml files and also on read only files
- (if (and (not (null buffer-file-name)) (file-writable-p buffer-file-name))
- (flymake-mode))
- ))
- (require 'gist)
Add Comment
Please, Sign In to add comment