Skip to content

Instantly share code, notes, and snippets.

@verma verma/init.el
Created Feb 10, 2016

Embed
What would you like to do?
;; such emacs init
;;
(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")))
(package-initialize)
; list the packages you want
(setq package-list
'(better-defaults
undo-tree
evil
paredit
cider
clojure-mode
sass-mode
less-css-mode
git-gutter
powerline
smex
fiplr
clj-refactor
base16-theme))
; activate all the packages (in particular autoloads)
(package-initialize)
; fetch the list of packages available
(unless package-archive-contents
(package-refresh-contents))
; install the missing packages
(dolist (package package-list)
(unless (package-installed-p package)
(package-install package)))
;; general
(setq inhibit-startup-message t) ;; no startup message
(global-hl-line-mode) ;; highlight current line
;; evil
(evil-mode 1)
;; fiplr
(setq fiplr-root-markers '(".git" ".svn"))
(setq fiplr-ignored-globs '((directories (".git" ".svn" ".repl" "out" "target" "node_modules"))
(files ("*.jpg" "*.png" "*.zip" "*~" ".*" "#*"))))
(global-set-key (kbd "C-x C-p") 'fiplr-find-file)
;; powerline
(powerline-center-theme)
;; clojure-mode
(add-hook 'clojure-mode-hook 'enable-paredit-mode)
(add-hook 'clojure-mode-hook 'evil-paredit-mode)
(defvar om-methods
(list 'render
'render-state
'init-state
'will-mount
'did-mount
'did-update
'should-update
'will-receive-props
'will-update
'display-name
'will-unmount)
"Methods that should receive sexy clojure indents.")
(defun customize-clojure-indents ()
(dolist (v om-methods)
(put-clojure-indent v 'defun)))
(add-hook 'clojure-mode-hook #'customize-clojure-indents)
;; smex
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
;; clj-refactor
(defun my-clojure-mode-hook ()
(clj-refactor-mode 1)
(yas-minor-mode 1) ; for adding require/use/import statements
;; This choice of keybinding leaves cider-macroexpand-1 unbound
(cljr-add-keybindings-with-prefix "C-c C-m"))
(add-hook 'clojure-mode-hook #'my-clojure-mode-hook)
;; font
(setq mac-allow-anti-aliasing t)
(set-frame-font (font-spec :family "Consolas"
:size 16
:antialias t))
(setq-default lispy-spacing 3)
(load-theme 'base16-eighties-dark t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.