Skip to content

Instantly share code, notes, and snippets.

@cwvh
Created January 1, 2014 01:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwvh/8204150 to your computer and use it in GitHub Desktop.
Save cwvh/8204150 to your computer and use it in GitHub Desktop.
~/.emacs.d/init.el
(setq initial-scratch-message nil)
(setq inhibit-startup-message t)
(setq-default tab-width 4)
(setq-default indent-tabs-mode nil)
(prefer-coding-system 'utf-8)
(setq make-backup-files nil)
(setq auto-save-default nil)
(global-font-lock-mode t)
(setq ring-bell-function 'ignore)
(global-unset-key "\C-z")
(fset 'yes-or-no-p 'y-or-n-p)
(iswitchb-mode 1)
(icomplete-mode 1)
(auto-fill-mode 1)
(setq fill-column 79)
(require 'package)
(add-to-list 'package-archives
; '("marmalade" . "http://marmalade-repo.org/packages/"))
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(when (< emacs-major-version 24)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)
(if window-system
(progn
(scroll-bar-mode -1)
(tool-bar-mode -1)
(tooltip-mode -1)
(set-frame-font "Anonymous Pro-13"))
;; -nw
(menu-bar-mode -1))
(load-theme 'moe-dark t)
;(require 'moe-theme-switcher)
(delete-selection-mode t)
(blink-cursor-mode t)
(show-paren-mode t)
(column-number-mode t)
;(set-fringe-style -1)
(if (or (eq window-system 'ns)
(eq window-system 'mac))
(progn
(setq mac-command-modifier 'meta)
;(setq mac-option-modifier nil)
;(setq ns-function-modifier 'hyper)
;; keybinding to toggle fullscreen
(global-set-key (quote [M-f10]) (quote ns-toggle-fullscreen))))
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
(eval-after-load 'shell
'(progn
(define-key shell-mode-map [up] 'comint-previous-input)
(define-key shell-mode-map [down] 'comint-next-input)
(define-key shell-mode-map "\C-p" 'comint-previous-input)
(define-key shell-mode-map "\C-n" 'comint-next-input)))
;(define-key global-map (kbd "RET") 'newline-and-indent)
(require 'tramp)
(eval-after-load 'tramp '(setenv "SHELL" "/bin/bash"))
(setq tramp-default-method "ssh")
;; Fix for Emacs binaries under Mac having the wrong $PATH.
;; If a particular shell variable is needed:
;; (exec-path-from-shell-copy-env "SHELLVAR")
;; TODO(cwvh): this seems broken; dump path manually for now.
(require 'exec-path-from-shell)
(exec-path-from-shell-initialize)
(setenv "PATH" "/Users/cwvh/bin:/Users/cwvh/.cabal/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/go/bin")
(defun cwvh:c-initialization-hook ()
(define-key c-mode-base-map (kbd "RET") 'newline-and-indent)
(setq c-basic-offset 4
tab-with 4
indent-tabs-mode nil))
(add-hook 'c-initialization-hook 'cwvh:c-initialization-hook)
(defun cwvh:c-mode-hook ()
(c-set-style "linux"))
(add-hook 'c-mode-hook 'cwvh:c-mode-hook)
(c-add-style "tc++pl"
'("stroustrup"
(c-offsets-alist
(inline-open . 0))))
(defun cwvh:c++-mode-hook ()
(c-set-style "tc++pl"))
(add-hook 'c++-mode-hook 'cwvh:c++-mode-hook)
;(defun cwvh:c-mode-common-hook ()
; (c-toggle-hungry-state 1))
;(add-hook 'c-mode-common-hook 'cwvh:c-mode-common-hook)
;(load (expand-file-name "~/quicklisp/slime-helper.el"))
;(setq inferior-lisp-program "sbcl")
;(add-hook 'slime-mode-hook
; (lambda ()
; (define-key slime-mode-map (kbd "<tab>") 'slime-fuzzy-indent-and-complete-symbol)
; (paredit-mode +1)))
(defun cwvh:haskell-mode-hook ()
;(set (make-local-variable 'require-final-newline) t)
(turn-on-haskell-decl-scan)
(turn-on-haskell-doc-mode)
(turn-on-haskell-indentation)
(setq tab-width 2
haskell-indent-offset 2
haskell-indentation-layout-offset 2
haskell-indentation-left-offset 2
haskell-indentation-ifte-offset 2))
(add-hook 'haskell-mode-hook 'cwvh:haskell-mode-hook)
(require 'evil)
(evil-mode 1)
(ido-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment