Created
March 16, 2009 09:00
-
-
Save prtksxna/79798 to your computer and use it in GitHub Desktop.
My .emacs file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; | |
; dot emacs | |
; Prateek Saxena (prtksxna) | |
;;; | |
;; Load Files and Directories | |
(add-to-list 'load-path "~/.emacs.d/plugins") | |
(add-to-list 'load-path "~/.emacs.d/modes/rails") | |
(add-to-list 'load-path "~/.emacs.d/modes/org/lisp") | |
(add-to-list 'load-path "~/.emacs.d/plugins/erc") | |
(add-to-list 'load-path "~/.emacs.d/modes/rinari") | |
(add-to-list 'load-path "~/.emacs.d/modes/rhtml") | |
(load-file "~/.emacs.d/themes/monokai-terminal.el") | |
(load-file "~/.emacs.d/themes/almost-monokai.el") | |
;; Modes | |
(add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode)) | |
(autoload 'javascript-mode "javascript" nil t) | |
;; Switch to Safari | |
(defun switch-to-safari() | |
(interactive) | |
(save-buffer) | |
(do-applescript "tell application \"Safari\" to activate | |
tell application \"System Events\" | |
tell process \"Safari\" | |
keystroke \"r\" using {command down} | |
end tell | |
end tell") | |
(message "Is everything running?") | |
) | |
(global-set-key (kbd "C-c s") 'switch-to-safari) | |
;; Require Modes and Plugins | |
(require 'twit) | |
(require 'erc) | |
(require 'textmate) | |
(require 'smooth-scrolling) | |
(require 'yasnippet-bundle) | |
(require 'find-recursive) | |
(require 'rails) | |
(require 'rinari) | |
(require 'rhtml-mode) | |
(add-hook 'rhtml-mode-hook | |
(lambda () (rinari-launch))) | |
(textmate-mode) | |
(auto-fill-mode) | |
;; Activate OrgMode | |
(require 'org-install) | |
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode)) | |
(define-key global-map "\C-cl" 'org-store-link) | |
(define-key global-map "\C-ca" 'org-agenda) | |
(setq org-log-done t) | |
;; Open Emacs in Fullscreen without the Toolbar | |
(defun mac-toggle-max-window () | |
(interactive) | |
(set-frame-parameter nil 'fullscreen (if (frame-parameter nil 'fullscreen) | |
nil | |
'fullboth))) | |
(tool-bar-mode) | |
(mac-toggle-max-window) | |
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) | |
(display-battery-mode) | |
;; Fix dired-mode | |
(add-hook 'dired-mode-hook | |
(lambda () | |
(define-key dired-mode-map (kbd "<return>") | |
'dired-find-alternate-file) ; was dired-advertised-find-file | |
(define-key dired-mode-map (kbd "^") | |
(lambda () (interactive) (find-alternate-file ".."))) | |
; was dired-up-directory | |
)) | |
;; Keyboard Shortcuts | |
(global-set-key (kbd "C-c d") 'shell) | |
(global-set-key (kbd "C-c C-b p") 'twit-post) | |
(global-set-key (kbd "C-c C-z") 'zone) | |
(global-set-key (kbd "C-?") 'comment-region) | |
(global-set-key (kbd "C-c C-b s") 'twit-show-recent-tweets) | |
(global-set-key (kbd "M-S-C-<left>") 'shrink-window-horizontally) | |
(global-set-key (kbd "M-S-C-<right>") 'enlarge-window-horizontally) | |
(global-set-key (kbd "M-S-C-<down>") 'shrink-window) | |
(global-set-key (kbd "M-S-C-<up>") 'enlarge-window) | |
(global-set-key (kbd "C-c left") 'winnder-undo) | |
(global-set-key (kbd "C-c right") 'winnder-redo) | |
(windmove-default-keybindings) | |
;; Tiny Customizations | |
(global-hl-line-mode ) ; Highlight the current line | |
(setq show-trailing-whitespace t) ; Highlight whitespaces | |
(savehist-mode 1) ; Save the history | |
;(set-variable 'color-theme-is-global nil) | |
;; Hooks | |
(add-hook 'write-file-functions 'delete-trailing-whitespace) | |
;(add-hook 'shell-mode-hook 'color-theme-monokai-terminal) | |
(setq org-agenda-files (file-expand-wildcards "~/.emacs.d/org/*.org")) | |
(color-theme-almost-monokai) | |
(custom-set-variables | |
'(diary-file "~/.emacs.d/diary") | |
'(color-theme-is-global nil) | |
'(org-agenda-files (quote ("~/.emacs.d/org/2Jan2010.org" "~/.emacs.d/org/3Jan2010.org" "~/.emacs.d/org/all.org" "~/.emacs.d/org/travel.org" "~/.emacs.d/org/5Jan2010.org"))) | |
'(safe-local-variable-values (quote ((todo-categories "Todo" "Todo" "Life" "Todo")))) | |
'(timeclock-file "~/.emacs.d/timelog")) | |
(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 'dired-find-alternate-file 'disabled nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment