Skip to content

Instantly share code, notes, and snippets.

@bryangarza
Created June 1, 2015 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryangarza/a4f35d4958dc4f18e929 to your computer and use it in GitHub Desktop.
Save bryangarza/a4f35d4958dc4f18e929 to your computer and use it in GitHub Desktop.
(require 'cl)
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
(defvar my-packages '(evil
rainbow-delimiters
magit))
(dolist (p my-packages)
(when (not (package-installed-p p))
(package-install p)))
(global-rainbow-delimiters-mode t)
(setq electric-indent-mode t)
(menu-bar-mode -1)
(global-linum-mode 1) ; display line numbers
(column-number-mode 1) ; display column and row of cursor in mode-line
(add-hook 'text-mode-hook 'turn-on-auto-fill) ; when opening a text file, hard wrap it
(require 'evil)
(evil-mode 1)
;; change mode-line color by evil state
(lexical-let ((default-color (cons (face-background 'mode-line)
(face-foreground 'mode-line))))
(add-hook 'post-command-hook
(lambda ()
(let ((color (cond ((minibufferp) default-color)
((evil-insert-state-p) '("#e80000" . "#ffffff"))
((evil-emacs-state-p) '("#444488" . "#ffffff"))
((buffer-modified-p) '("#006fa0" . "#ffffff"))
(t default-color))))
(set-face-background 'mode-line (car color))
(set-face-foreground 'mode-line (cdr color))))))
;; for when you install themes, look at how I do it
;;(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
;;(load-theme 'noctilux t)
(fset 'yes-or-no-p 'y-or-n-p) ;; replace yes or no with y or n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment