Created
December 8, 2013 00:27
-
-
Save shargoj/7851797 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;;;;;; Important Keybindings ;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; When on a mac, ensure sane defaults | |
(setq mac-option-key-is-meta nil) | |
(setq mac-command-key-is-meta t) | |
(setq mac-command-modifier 'meta) | |
(setq mac-option-modifier nil) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;;;;;; Package Management Stuff ;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; Import packages and add additional package repositories | |
(require 'package) | |
(add-to-list 'package-archives | |
'("marmalade" . "http://marmalade-repo.org/packages/")) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.milkbox.net/packages/") t) | |
(package-initialize) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;;;;;; Make emacs fun to work with ;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(global-set-key [(meta x)] 'helm-M-x) | |
(global-set-key [(ctrl x) (ctrl f)] 'helm-find-files) | |
(global-set-key (kbd "C-0") 'ace-jump-mode) | |
(setq ring-bell-function 'ignore) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;;;;;; Sane Emacs Defaults ;;;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(require 'multiple-cursors) | |
(multiple-cursors-mode 1) | |
(global-set-key (kbd "C->") 'mc/mark-next-like-this) | |
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) | |
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) | |
(require 'auto-complete) | |
(global-auto-complete-mode t) | |
(require 'flymake) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;;;;;;; Language-specifics ;;;;;;;;;;; | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; haXe | |
(require 'haxe-mode) | |
(defun haxe-item-to-list (item) | |
"Given a value like: | |
<i n=\"charAt\"><t>index : Int -> String</t><d>foo</d></i> | |
returns: | |
'(\"charAt\" \"index : Int\" \"foo\") " | |
(list (car item) (cadr i))) | |
(defun parse-haxe-completion-xml (xml) | |
"Parse the results of HaXe's compiler-based completion" | |
(let* ((root (with-temp-buffer | |
(insert xml) | |
(xml-parse-region (point-min) (point-max))))) | |
root)) | |
(parse-haxe-completion-xml "<i n=\"length\"><t>Int</t><d>foo</d></i>") | |
;;; Clojure | |
(require 'cider) | |
(require 'ac-nrepl) | |
(ac-nrepl-setup) | |
(add-hook 'cider-repl-mode-hook 'ac-nrepl-setup) | |
(add-hook 'cider-interaction-mode-hook 'ac-nrepl-setup) | |
(eval-after-load "auto-complete" | |
'(add-to-list 'ac-modes 'cider-repl-mode)) | |
(defun set-auto-complete-as-completion-at-point-function () | |
(setq completion-at-point-functions '(auto-complete))) | |
(add-hook 'auto-complete-mode-hook 'set-auto-complete-as-completion-at-point-function) | |
(add-hook 'cider-repl-mode-hook 'set-auto-complete-as-completion-at-point-function) | |
(add-hook 'cider-interaction-mode-hook 'set-auto-complete-as-completion-at-point-function) | |
;;; Racket | |
(setq exec-path (append exec-path '("/Applications/Racket v5.3.3/bin/"))) | |
;;; Haskell | |
(setenv "PATH" (concat (getenv "PATH") ":/sw/bin" ":~/.cabal/bin")) | |
(require 'ghc-core) | |
(autoload 'ghc-init "ghc" nil t) | |
(add-hook 'haskell-mode-hook (lambda () (ghc-init) (flymake-mode))) | |
(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. | |
'(column-number-mode t) | |
'(custom-safe-themes (quote ("fa189fcf5074d4964f0a53f58d17c7e360bb8f879bd968ec4a56dc36b0013d29" "fc6e906a0e6ead5747ab2e7c5838166f7350b958d82e410257aeeb2820e8a07a" default))) | |
'(global-auto-complete-mode t) | |
'(haskell-mode-hook (quote (turn-on-haskell-indentation))) | |
'(help-at-pt-display-when-idle (quote (flymake-overlay)) nil (help-at-pt)) | |
'(help-at-pt-timer-delay 1.5)) | |
(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. | |
) | |
(load-theme 'monokai) | |
(put 'upcase-region 'disabled nil) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
installed packages: man-commands save-packages ac-geiser ac-nrepl ac-slime ace-jump ace-jump ack-and auto-complete better-defaults cider cl-lib clojure-mode dash durendal ensime epl flymake-cursor flymake-easy flymake-haskell geiser ghc ghci-completion git-commit git-rebase haskell-mode haxe-mode helm hi2 ido-ubiquitous key-chord litable magit monokai-theme multiple-cursors org paredit pkg-info popup projectile protobuf-mode s scala-mode2 slime slime-clj slime-fuzzy slime-repl visual-regexp wgrep wgrep-helm yasnippet yasnippet-bundle zenburn-theme