Skip to content

Instantly share code, notes, and snippets.

@delihiros
Created December 15, 2011 16:33
Show Gist options
  • Save delihiros/1481750 to your computer and use it in GitHub Desktop.
Save delihiros/1481750 to your computer and use it in GitHub Desktop.
(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")
(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)
; 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment