Skip to content

Instantly share code, notes, and snippets.

@hanfeisun
Created May 25, 2012 05:27
Show Gist options
  • Save hanfeisun/2785959 to your computer and use it in GitHub Desktop.
Save hanfeisun/2785959 to your computer and use it in GitHub Desktop.
My emacs config in LiuLab
(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin:/Applications/Racket5/bin/:/usr/texbin/"))
(setenv "CLASSPATH" ":/Users/hanfei/Documents/Sandbox/TIJ/TIJS/TIJ-3rd-edition-code")
(if x-resource-name
(progn
(set-face-attribute 'default nil :font "inconsolata-18")
))
(if (not (equal emacs-version "23.4.1"))
(progn
(server-mode 'on)
(add-hook 'emacs-lisp-mode-hook 'company-mode)
(add-hook 'c-mode-common-hook 'company-mode)
(add-hook 'python-mode-hook 'company-mode)))
(transient-mark-mode 'on)
(set-default 'tramp-default-proxy-alist (quote("my-sudo-alias" nil "/ssh:[email protected]#33001")))
(show-paren-mode t)
(defun insert-buffer-name ()
(interactive)
(insert (buffer-name)))
(add-to-list 'load-path "~/.emacs.d")
(add-to-list 'load-path "~/.emacs.d/slime")
(eval-after-load "slime"
'(progn
(setq slime-lisp-implementations
'((sbcl ("sbcl" "--core" "/Users/hanfei/.emacs.d/slime/sbcl.core-for-slime"))
(clisp ("/usr/local/bin/clisp"))))
;; (setq inferior-lisp-program "/usr/local/bin/clisp -K full")
(slime-setup '(slime-fancy slime-banner slime-asdf))))
(require 'slime)
(add-to-list 'load-path "~/.emacs.d/elpa/auctex-11.86/")
;; (require 'quack)
(setq scheme-program-name "racket")
(defun browse-url-default-macosx-browser (url &optional new-window)
"Ask MacOS to load URL using the system-default web browser."
(interactive (browse-url-interactive-arg "URL: "))
(start-process "browser" nil "open" "-a" "firefox" url)
)
(setq browse-url-browser-function 'browse-url-default-macosx-browser)
(setq bookmark-save-flag 1)
;; (add-to-list 'load-path "~/.emacs.d/python-mode.el-6.0.8/")
;; (setq py-install-directory "~/.emacs.d/python-mode.el-6.0.8/")
;; (require 'python-mode)
(require 'javadoc-help)
;; to speedup, just load it on demand
(autoload 'pylookup-lookup "pylookup"
"Lookup SEARCH-TERM in the Python HTML indexes." t)
(autoload 'pylookup-update "pylookup"
"Run pylookup-update and create the database at `pylookup-db-file'." t)
(global-set-key (kbd "C-h j") 'javadoc-lookup)
(global-set-key (kbd "C-h y") 'pylookup-lookup)
(global-set-key (kbd "C-c b") 'insert-buffer-name)
(custom-set-variables
;; custom-set-variables 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.
'(TeX-PDF-mode t t)
'(TeX-default-mode (quote plain-tex-mode))
'(ansi-color-names-vector ["#2e3436" "#a40000" "#4e9a06" "#c4a000" "#204a87" "#5c3566" "#729fcf" "#eeeeec"])
'(c-default-style (quote ((c-mode . "linux") (java-mode . "java") (awk-mode . "awk") (other . "gnu"))))
'(custom-enabled-themes nil)
'(doc-view-continuous t)
'(ede-project-directories (quote ("/Users/hanfei/Documents/mis")))
'(exec-path (quote ("/usr/bin" "/bin" "/usr/sbin" "/sbin" "/Applications/Emacs.app/Contents/MacOS/bin" "/usr/local/bin" "/usr/local/Cellar/ghostscript/9.05/bin" "/usr/texbin")))
'(gud-gdb-command-name "/usr/local/bin/gdb -i=mi")
)
(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.
)
;;BEGIN-RACKET-SCRIBBLE-EMACS-INSTALL
;; Updated: 2012-03-18T04:41:25Z
;; (condition-case err
;; (require 'scribble "/Users/hanfei/Library/Racket/planet/300/5.2.1/cache/neil/scribble-emacs.plt/1/2/scribble")
;; (error (message "Could not load Scribble Emacs: %s" err)))
;;END-RACKET-SCRIBBLE-EMACS-INSTALL
(setq org-hide-leading-stars t)
;; (require 'gnuplot)
;; (setq gnuplot-program "/usr/bin/gnuplot")
;; automatically open files ending with .gp or .gnuplot in gnuplot mode
(setq auto-mode-alist
(append '(("\\.\\(gp\\|gnuplot\\)$" . gnuplot-mode)) auto-mode-alist))
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(setq TeX-view-program-selection
'((output-pdf "PDF Viewer")))
(setq TeX-view-program-list
'(("PDF Viewer" "open %o")))
(global-ede-mode) ; Enable the Project management system
(setq semantic-default-submodes '(global-semantic-idle-scheduler-mode
global-semanticdb-minor-mode
global-semantic-idle-summary-mode
global-semantic-mru-bookmark-mode
global-semantic-highlight-func-mode
))
(semantic-mode 1)
(defconst user-include-dirs
(list
"/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include"
"/usr/include/c++/4.2.1"
"/usr/include/c++/4.2.1/backward"
"/usr/local/include"
"/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include"
"/usr/include"
"/System/Library/Frameworks"
"/Library/Frameworks"))
(mapc (lambda (dir)
(semantic-add-system-include dir 'c++-mode)
(semantic-add-system-include dir 'c-mode))
user-include-dirs)
(require 'semantic/analyze/refs)
(require 'flymake)
;; (global-semantic-decoration-mode 1)
;; (require 'semantic/decorate/include nil 'noerror)
;; (semantic-toggle-decoration-style "semantic-tag-boundary" -1)
;; (global-semantic-highlight-edits-mode (if window-system 1 -1))
;; (global-semantic-show-parser-state-mode 1)
;; (global-ede-mode 1)
(when (executable-find "global")
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)
(setq ede-locate-setup-options '(ede-locate-global ede-locate-base)))
(when (executable-find "gcc")
(require 'semantic/bovine/c nil 'noerror)
(and (eq system-type 'windows-nt)
(semantic-gcc-setup)))
(require 'semantic/bovine/el nil 'noerror)
(setq pulse-command-advice-flag (if window-system 1 nil))
(global-set-key (kbd "C-c h j") 'semantic-ia-fast-jump)
(global-set-key (kbd "C-c C-k") 'compile)
;; (remove-hook 'python-mode-hook 'company-mode)
(defun show-fly-err-at-point ()
"If the cursor is sitting on a flymake error, display the message in the minibuffer"
(interactive)
(let ((line-no (line-number-at-pos)))
(dolist (elem flymake-err-info)
(if (eq (car elem) line-no)
(let ((err (car (second elem))))
(message "%s" (flymake-ler-text err)))))))
;; (setq py-shell-name "ipython")
;; (setq ipython-command "ipython")
;; (require 'ipython)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment