Skip to content

Instantly share code, notes, and snippets.

@ramhiser
Created November 19, 2011 09:01
Show Gist options
  • Save ramhiser/1378634 to your computer and use it in GitHub Desktop.
Save ramhiser/1378634 to your computer and use it in GitHub Desktop.
.emacs
(require 'mouse)
(xterm-mouse-mode t)
(defun track-mouse (e))
;; Save all backup file in this directory.
(setq backup-directory-alist `(("." . "~/.emacs_backups/")))
(setq backup-by-copying t)
;; Tabs yields 2 spaces
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq indent-line-function 'insert-tab)
;; Show column number on the bottom status bar.
(setq column-number-mode t)
;; Use the Solarized color theme
;; git-clone'd from:
;; https://github.com/sellout/emacs-color-theme-solarized
(add-to-list 'load-path "~/.emacs.d/emacs-color-theme-solarized/")
(add-to-list 'custom-theme-load-path "~/.emacs.d/emacs-color-theme-solarized/")
(load-theme 'solarized-dark t)
;; Use Emacs Speaks Statistics (ESS)
(add-to-list 'load-path "~/.emacs.d/ESS/lisp/")
(require 'ess-site)
;; Turns off the 'smart' underscore in ESS
;; If on, this feature types " <- " if the underscore is pressed.
(ess-toggle-underscore nil)
;; Loads ESS-tracebug to debug R code within emacs/ESS.
;; The hook loads ESS-tracebug automatically when R is loaded.
;; For more information, see: http://code.google.com/p/ess-tracebug/
(require 'ess-tracebug)
(add-hook 'ess-post-run-hook 'ess-tracebug t)
;; Add support for knit and purl
;; Script obtained from:
;; http://sjp.co.nz/posts/emacs-ess-knitr/
(add-to-list 'load-path "~/.emacs.d/ess-knitr/")
(require 'ess-knitr)
;; To use org-mode. This is from David O'Toole's Org tutorial:
;; http://orgmode.org/worg/org-tutorials/orgtutorial_dto.html
(require 'org-install)
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)
;; We begin in org-mode by default with the following file types:
;; *.org
;; README
;; README.md
;; TODO
;; NOTES
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(add-to-list 'auto-mode-alist '("README$" . org-mode))
(add-to-list 'auto-mode-alist '("README.md$" . org-mode))
(add-to-list 'auto-mode-alist '("TODO$" . org-mode))
(add-to-list 'auto-mode-alist '("NOTES$" . org-mode))
;; Agenda files for Org-mode
;; When the agenda mode is run, these files are queried for their TODO tasks.
;; (setq org-agenda-files (list "~/todo/work.org"
;; "~/todo/school.org"
;; "~/todo/home.org"))
;; Standard Orgmode-to-LaTeX export commands
;; I obtained the below commands from the official Org-mode site.
;; http://orgmode.org/worg/org-tutorials/org-latex-export.html
;; Detailed customizations can be obtained with directions from the same link.
(require 'org-latex)
(unless (boundp 'org-export-latex-classes)
(setq org-export-latex-classes nil))
(add-to-list 'org-export-latex-classes
'("article"
"\\documentclass{article}"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
;; AucTex Startup Codes
;; As recommended by the AucTeX Quick Start Guide, I have added auto-save
;; and parse-self.
;; Link: http://www.gnu.org/software/auctex/manual/auctex/Quick-Start.html
(setq TeX-auto-save t)
(setq TeX-parse-self t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment