Skip to content

Instantly share code, notes, and snippets.

@bryanl
Created December 30, 2008 18:38
Show Gist options
  • Save bryanl/41700 to your computer and use it in GitHub Desktop.
Save bryanl/41700 to your computer and use it in GitHub Desktop.
(add-to-list 'load-path
"~/.emacs.d/plugins")
(setq mac-command-key-is-meta t)
(setq default-tab-width 2)
(server-start)
(require 'pair-mode)
;;;; editor
;; font
(set-face-font 'default "-apple-inconsolata-medium-r-normal--12-0-72-72-m-0-iso10646-1")
(set-face-font 'modeline "-apple-inconsolata-medium-r-normal--11-0-72-72-m-0-iso10646-1")
(set-face-font 'minibuffer-prompt "-apple-inconsolata-medium-r-normal--11-0-72-72-m-0-iso10646-1")
(line-number-mode 1)
(column-number-mode 1)
(setq-default indent-tabs-mode nil)
(setq standard-indent 2)
;; Color themes
(require 'color-theme)
(setq color-theme-is-global t)
(color-theme-zenburn)
;; textmate
(add-to-list 'load-path
"~/.emacs.d/vendor/textmate.el")
(require 'textmate)
(textmate-mode)
;; rinari
(add-to-list 'load-path
"~/.emacs.d/vendor/rinari")
(require 'rinari)
(require 'ri)
(require 'whitespace)
;; open urls in default browser
(setq browse-url-browser-function 'browse-url-default-macosx-browser)
(require 'textile-mode)
(add-to-list 'auto-mode-alist '("\\.textile\\'" . textile-mode))
(require 'gist)
(require 'screenplay)
(require 'autotest)
;; make emacs more mac friendly
(global-set-key (kbd "M-s") 'save-buffer)
(global-set-key (kbd "M-z") 'undo)
;(defun toggle-fullscreen ()
; (interactive)
; (set-frame-parameter nil 'fullscreen (if (frame-parameter nil 'fullscreen)
; nil
; 'fullboth)))
;(global-set-key (kbd "M-n") 'toggle-fullscreen
;; eshell
(add-hook 'eshell-mode-hook
'(lambda nil
(let ((path))
(setq path "/opt/local/bin:/usr/local/bin:/usr/bin:/bin")
(setenv "PATH" path))
(local-set-key "\C-u" 'eshell-kill-input)))
(defun eshell/edit (&rest args)
"Invoke `find-file' on the file.
\"edit +42 foo\" also goes to line 42 in the buffer."
(while args
(if (string-match "\\`\\+\\([0-9]+\\)\\'" (car args))
(let* ((line (string-to-number (match-string 1 (pop args))))
(file (pop args)))
(find-file file)
(goto-line line))
(find-file (pop args)))))
;; erc
(setq erc-server "irc.freenode.net"
erc-port 6667
erc-nick "bryanl"
erc-user-full-name "bryan liles"
erc-prompt-for-password t)
;; erc-set
(set-face-font 'erc-default-face "-apple-inconsolata-medium-r-normal--14-0-72-72-m-0-iso10646-1")
(set-face-font 'erc-prompt-face "-apple-inconsolata-medium-r-normal--14-0-72-72-m-0-iso10646-1")
(set-face-font 'erc-input-face "-apple-inconsolata-medium-r-normal--14-0-72-72-m-0-iso10646-1")
;(set-face-font 'erc-nick-default-face "-apple-inconsolata-medium-r-normal--14-0-72-72-m-0-iso10646-1")
;(set-face-font 'erc-timestamp-face "-apple-inconsolata-medium-r-normal--10-0-72-72-m-0-iso10646-1")
(set-face-font 'erc-direct-msg-face "-apple-inconsolata-medium-r-normal--14-0-72-72-m-0-iso10646-1")
(set-face-font 'erc-notice-face "-apple-inconsolata-medium-r-normal--10-0-72-72-m-0-iso10646-1")
;(set-face-font 'erc-header-line "-apple-inconsolata-medium-r-normal--10-0-72-72-m-0-iso10646-1")
(setq erc-header-line-face-method t)
(setq erc-track-exclude-types '("JOIN" "NICK" "PART" "QUIT"))
(setq erc-hide-list '("JOIN" "PART" "QUIT"))
(setq erc-button-url-regexp
"\\([-a-zA-Z0-9_=!?#$@~`%&*+\\/:;,]+\\.\\)+[-a-zA-Z0-9_=!?#$@~`%&*+\\/:;,]*[-a-zA-Z0-9\\/]")
(add-hook 'erc-mode-hook 'erc-add-scroll-to-bottom)
(setq erc-prompt ">>")
(require 'erc-highlight-nicknames)
(add-to-list 'erc-modules 'highlight-nicknames)
(erc-update-modules)
(require 'erc-match)
(setq erc-keywords '("bryanl"))
(require 'erc-join)
(erc-autojoin-mode 1)
(setq erc-autojoin-channels-alist
'(("freenode.net" "#emacs" "#offrails" "#rubyonrails" "#snort" "#git"
"#github" "#macosx" "#rails-contrib" "#merb")))
(add-hook 'erc-after-connect '(lambda (SERVER NICK)
(erc-message "PRIVMSG" "NickServ identify blahblah")))
(require 'growl)
(defun my-erc-hook (match-type nick message)
"Shows a growl notification, when user's nick was mentioned.
If the buffer is currently not visible, makes it sticky."
(and (eq match-type 'current-nick)
(growl (concat "Your nick was mentioned on: "
(buffer-name (current-buffer)))
message
(not (erc-buffer-visible (current-buffer))))))
(add-hook 'erc-text-matched-hook 'my-erc-hook)(server-start)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment