Created
January 10, 2012 05:06
-
-
Save delihiros/1587097 to your computer and use it in GitHub Desktop.
This file contains 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
(setq indent-tabs-mode nil) | |
(setq load-path | |
(append | |
(list | |
(expand-file-name "~/emacssetup") | |
) | |
load-path)) | |
(require 'mac-key-mode) | |
(mac-key-mode 1) | |
(global-set-key "\C-z" 'undo) | |
(setq visible-bell t) | |
(if window-system (server-start)) | |
(iswitchb-mode t) | |
(iswitchb-default-keybindings) | |
(set-frame-parameter nil 'alpha '75) | |
(set-frame-parameter nil 'fullscreen 'fullboth) | |
(setq mac-option-modifier 'meta) | |
(setq mac-function-modifier 'meta) | |
(setq pc-select-selection-keys-only t) | |
(pc-selection-mode 1) | |
(setq make-backup-files nil) | |
(setq auto-save-default nil) | |
;;shell-pop | |
(require 'shell-pop) | |
(shell-pop-set-internal-mode "ansi-term") | |
(defvar ansi-term-after-hook nil) | |
(add-hook 'ansi-term-after-hook | |
'(lambda () | |
(define-key term-raw-map "\C-t" 'shell-pop))) | |
(defadvice ansi-term (after ansi-term-after-advice (org)) | |
"run hook as after advice" | |
(run-hooks 'ansi-term-after-hook)) | |
(ad-activate 'ansi-term) | |
(global-set-key "\C-t" 'shell-pop) | |
;; indented line \C-a | |
(defun beginning-of-indented-line (current-point) | |
(interactive "d") | |
(if (string-match | |
"\[ \t]+$" | |
(save-excursion | |
(buffer-substring-no-properties | |
(progn (beginning-of-line) (point)) | |
current-point))) | |
(beginning-of-line) | |
(back-to-indentation))) | |
(add-hook 'c-mode-common-hook | |
'(lambda () | |
(setq c-basic-offset 4))) | |
(add-hook 'c-mode-hook | |
'(lambda () | |
(c-toggle-auto-state t))) | |
(require 'elscreen) | |
(if window-system | |
(define-key elscreen-map "\C-t" 'iconify-or-deiconify-frame) | |
(define-key elscreen-map "\C-t" 'suspend-emacs)) | |
;; haskell-mode | |
(load "~/emacssetup/haskellmode/haskell-site-file") | |
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) | |
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) | |
;;(add-hook 'haskell-mode-hook 'turn-on-haskell-indent) | |
;;(add-hook 'haskell-mode-hook 'turn-on-haskell-simple-indent) | |
(setq haskell-program-name"/usr/bin/ghci") | |
(setq pc-select-selection-keys-only t) | |
(pc-selection-mode 1) | |
(autoload 'riece "riece" "Start Riece" t) | |
(require 'color-theme) | |
(color-theme-initialize) | |
(color-theme-clarity) | |
(autoload 'ruby-mode "ruby-mode" | |
"Mode for editing ruby source files" t) | |
(setq auto-mode-alist | |
(append '(("\\.rb$" . ruby-mode)) auto-mode-alist)) | |
(setq interpreter-mode-alist (append '(("ruby" . ruby-mode)) | |
interpreter-mode-alist)) | |
(autoload 'run-ruby "inf-ruby" | |
"Run an inferior Ruby process") | |
(autoload 'inf-ruby-keys "inf-ruby" | |
"Set local key defs for inf-ruby in ruby-mode") | |
(add-hook 'ruby-mode-hook | |
'(lambda () | |
(inf-ruby-keys))) | |
;; Common Lisp | |
;; (add-to-list 'load-path "slime") | |
;;(require 'slime-autoloads) | |
;;(eval-after-load "slime" | |
;; '(progn | |
;; (add-to-list 'load-path "/usr/local/slime/contrib") | |
;; (slime-setup '(slime-fancy slime-banner)) | |
;; (setq slime-complete-symbol*-fancy t) | |
;; (setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol))) | |
;; Optionally, specify the Lisp program you are using. Default is "lisp" | |
;; If the Allegro directory is not in your PATH environment variable | |
;; this should be a fully qualified path. | |
;; choose one of the below based on Express or non-Express usage | |
;; (setq inferior-lisp-program "alisp") | |
;;(setq inferior-lisp-program "/Applications/AllegroCL/allegro-express") | |
;; clozure cl | |
(setq inferior-lisp-program "ccl64") | |
(add-to-list 'load-path (expand-file-name "slime")) | |
;; load SLIME | |
(require 'slime) | |
(slime-setup '(slime-repl slime-fancy slime-banner)) | |
(setq slime-net-coding-system 'utf-8-unix) | |
;; popwin | |
(require 'popwin) | |
(setq display-buffer-function 'popwin:display-buffer) | |
;; acslime | |
(require 'ac-slime) | |
(add-hook 'slime-mode-hook 'set-up-slime-ac) | |
(add-hook 'slime-repl-mode-hook 'set-up-slime-ac) | |
;; auto-complete | |
(require 'auto-complete) | |
(global-auto-complete-mode t) | |
(require 'auto-complete-config) | |
(add-to-list 'ac-dictionary-directories "dict") | |
(ac-config-default) | |
;; Graphviz | |
(load "graphviz-dot-mode.el") | |
(add-hook 'graphviz-dot-mode-hook | |
(lambda () | |
(local-set-key [f5] "\C-x\C-s\C-cc\C-m\C-cp"))) | |
;; clojure | |
(require 'clojure-mode) | |
(setq clojure-src-root (expand-file-name "~/share/clojure")) | |
(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. | |
'(inhibit-startup-screen t)) | |
(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. | |
) | |
;; gauche | |
;;(setq scheme-program-name "gosh") | |
(setq scheme-program-name "mit-scheme") | |
(require 'cmuscheme) | |
(defun scheme-other-window () | |
"Run scheme on other window" | |
(interactive) | |
(switch-to-buffer-other-window | |
(get-buffer-create "*scheme-gauche*")) | |
(run-scheme scheme-program-name)) | |
(define-key global-map | |
"\C-cS" 'scheme-other-window) | |
(global-set-key "\C-h" 'delete-backward-char) | |
;; drill instructor | |
;;(require 'drill-instructor) | |
;;(setq drill-instructor-global t) | |
; mmm-mode | |
(require 'mmm-mode) | |
(setq mmm-global-mode 'maybe) | |
(setq mmm-submode-decoration-level 2) | |
(set-face-background 'mmm-default-submode-face nil) | |
(mmm-add-mode-ext-class nil "\\.php?\\'" 'html-php) | |
(mmm-add-classes | |
'((html-php | |
:submode php-mode | |
:front "<\\?\\(php\\)?" | |
:back "\\?>"))) | |
(add-to-list 'auto-mode-alist '("\\.php?\\'" . html-mode)) | |
;; Flymake | |
(require 'flymake) | |
(defun flymake-cc-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 "g++" (list "-Wall" "-Wextra" "-fsyntax-only" local-file)))) | |
(push '("\\.cpp$" flymake-cc-init) flymake-allowed-file-name-masks) | |
(push '("\\.c$" flymake-cc-init) flymake-allowed-file-name-masks) | |
;; (defun flymake-Haskell-init () | |
;; (flymake-simple-make-init-impl | |
;; 'flymake-create-temp-with-folder-structure nil nil | |
;; (file-name-nondirectory buffer-file-name) | |
;; 'flymake-get-Haskell-cmdline)) | |
;; (defun flymake-get-Haskell-cmdline (source base-dir) | |
;; (list "ghc" | |
;; (list "--make" "-fbyte-code" | |
;; (concat "-i"base-dir) | |
;; source))) | |
;; (defvar multiline-flymake-mode nil) | |
;; (defvar flymake-split-output-multiline nil) | |
;; (defadvice flymake-split-output | |
;; (around flymake-split-output-multiline activate protect) | |
;; (if multiline-flymake-mode | |
;; (let ((flymake-split-output-multiline t)) | |
;; ad-do-it) | |
;; ad-do-it)) | |
;; (defadvice flymake-split-string | |
;; (before flymake-split-string-multiline activate) | |
;; (when flymake-split-output-multiline | |
;; (ad-set-arg 1 "^\\s *$"))) | |
;; (add-hook | |
;; 'haskell-mode-hook | |
;; '(lambda () | |
;; (add-to-list 'flymake-allowed-file-name-masks | |
;; '("\\.l?hs$" flymake-Haskell-init flymake-simple-java-cleanup)) | |
;; (add-to-list 'flymake-err-line-patterns | |
;; '("^\\(.+\\.l?hs\\):\\([0-9]+\\):\\([0-9]+\\):\\(\\(?:.\\|\\W\\)+\\)" | |
;; 1 2 3 4)) | |
;; (set (make-local-variable 'multiline-flymake-mode) t) | |
;; (if (not (null buffer-file-name)) (flymake-mode)) | |
;; )) | |
;; ;; Display messages at the minibuffer | |
;; (global-set-key "\C-cd" | |
;; 'flymake-show-and-sit ) | |
;; (defun flymake-show-and-sit () | |
;; "Displays the error/warning for the current line in the minibuffer" | |
;; (interactive) | |
;; (progn | |
;; (let* ( (line-no (flymake-current-line-no) ) | |
;; (line-err-info-list (nth 0 (flymake-find-err-info flymake-err-info line-no))) | |
;; (count (length line-err-info-list)) | |
;; ) | |
;; (while (> count 0) | |
;; (when line-err-info-list | |
;; (let* ((file (flymake-ler-file (nth (1- count) line-err-info-list))) | |
;; (full-file (flymake-ler-full-file (nth (1- count) line-err-info-list))) | |
;; (text (flymake-ler-text (nth (1- count) line-err-info-list))) | |
;; (line (flymake-ler-line (nth (1- count) line-err-info-list)))) | |
;; (message "[%s] %s" line text) | |
;; ) | |
;; ) | |
;; (setq count (1- count))))) | |
;; (sit-for 60.0) | |
;; ) | |
;; | |
;; (defun flymake-ocaml-init () | |
;; (flymake-simple-make-init-impl | |
;; 'flymake-create-temp-with-folder-structure nil nil | |
;; (file-name-nondirectory buffer-file-name) | |
;; 'flymake-get-ocaml-cmdline)) | |
;; (defun flymake-get-ocaml-cmdline (source base-dir) | |
;; (list "ocaml_flycheck.pl" | |
;; (list source base-dir))) | |
;; (push '(".+\\.ml[yilp]?$" flymake-ocaml-init flymake-simple-java-cleanup) | |
;; flymake-allowed-file-name-masks) | |
;; (push | |
;; '("^\\(\.+\.ml[yilp]?\\|\.lhs\\):\\([0-9]+\\):\\([0-9]+\\):\\(.+\\)" | |
;; 1 2 3 4) flymake-err-line-patterns) | |
;; (defun credmp/flymake-display-err-minibuf () | |
;; "Displays the error/warning for thecurrent line in the minibuffer" | |
;; (interactive) | |
;; (let* ((line-no (flymake-current-line-no)) | |
;; (line-err-info-list (nth 0 (flymake-find-err-info flymake-err-info line-no))) | |
;; (count (length line-err-info-list)) | |
;; ) | |
;; (while (> count 0) | |
;; (when line-err-info-list | |
;; (let* ((file (flymake-ler-file (nth (1- count) line-err-info-list))) | |
;; (full-file (flymake-ler-full-file (nth (1- count) line-err-info-list))) | |
;; (text (flymake-ler-text (nth (1- count) line-err-info-list))) | |
;; (line (flymake-ler-line (nth (1- count) line-err-info-list)))) | |
;; (message "[%s] %s" line text) | |
;; ) | |
;; ) | |
;; (setq count (1- count))))) | |
;; (custom-set-faces '(flymake-errline ((((class color)) (:background "LightYellow?" :underline "OrangeRed?")))) | |
;; '(flymake-warnline ((((class color)) (:background "LightBlue?2" :underline "Yellow"))))) | |
;; C++ | |
(add-hook 'c++-mode-hook | |
'(lambda () | |
(flymake-mode t))) | |
(add-hook 'c-mode-hook | |
'(lambda () | |
(flymake-mode t))) | |
;; tex | |
(setq auto-mode-alist | |
(cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist)) | |
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t) | |
(setq dvi2-command "open -a TeXShop" | |
tex-command "~/Library/TeXShop/bin/platex2pdf-utf8") | |
;; smart-compile | |
(require 'smart-compile) | |
(global-set-key "\C-cc" 'smart-compile) | |
(define-key menu-bar-tools-menu [compile] '("Compile..." . smart-compile)) | |
;; gdb | |
(setq gdb-many-windows t) | |
(add-hook 'gdb-mode-hook '(lambda () (gud-tooltip-mode t))) | |
(setq gdb-use-separate-io-buffer t) | |
(setq gud-tooltip-echo-area nil) | |
;; pretty mode | |
(require 'pretty-mode) | |
(global-pretty-mode 1) | |
;; auto install | |
(require 'auto-install) | |
(setq auto-install-directory "~/emacssetup/") | |
(auto-install-update-emacswiki-package-name t) | |
;; anything | |
(require 'anything) | |
;; gist | |
(require 'gist) | |
(require 'anything-gist) | |
;; ocaml-mode | |
(setq auto-mode-alist | |
(cons '("\\.ml[iylp]?$" . caml-mode) auto-mode-alist)) | |
(autoload 'caml-mode "caml" "Major mode for editing Caml code." t) | |
(autoload 'run-caml "inf-caml" "Run an inferior Caml process." t) | |
(global-set-key "\C-q" 'caml-types-show-type) | |
; tuareg-mode | |
;; (setq auto-mode-alist (cons '("\\.ml[iylp]?$" . tuareg-mode) auto-mode-alist)) | |
;; (autoload 'tuareg-mode "tuareg" "Major mode for editing Caml code" t) | |
;; (autoload 'camldebug "camldebug" "Run the Caml debugger" t) | |
;; (add-hook | |
;; 'tuareg-mode-hook | |
;; '(lambda () | |
;; (if (not (null buffer-file-name)) (flymake-mode)) | |
;; (define-key tuareg-mode-map "\C-cd" 'credmp/flymake-display-err-minibuf) | |
;; (define-key tuareg-mode-map "\C-cn" `flymake-goto-next-error))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment