(setq gc-cons-threshold (* 100 1024 1024)) (require 'package) (add-to-list 'package-archives '( "melpa" . "https://melpa.org/packages/") t) (add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) (package-initialize) (unless package-archive-contents (package-refresh-contents)) (unless (package-installed-p 'use-package) (package-refresh-contents) (package-install 'use-package)) (eval-when-compile (require 'use-package)) (require 'use-package-ensure) (setq use-package-always-ensure t) (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. '(async-bytecomp-package-mode t) '(package-archives '(("gnu" . "https://elpa.gnu.org/packages/") ("melpa" . "https://melpa.org/packages/") ("org" . "https://orgmode.org/elpa/"))) '(package-selected-packages '(evil-surround evil-collection undo-tree toc-org evil-org org-plus-contrib evil-goggles evil-expat evil-commentary auto-package-update lispy smartparens which-key git-gutter rainbow-delimiters auto-complete-distel auto-complete evil magit evil-magit)) '(undo-tree-auto-save-history t) '(undo-tree-history-directory-alist '(("." . "~/.undohist-emacs"))) '(undo-tree-visualizer-diff t) '(undo-tree-visualizer-timestamps 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. '(evil-goggles-change-face ((t (:inherit diff-removed)))) '(evil-goggles-delete-face ((t (:inherit diff-removed)))) '(evil-goggles-paste-face ((t (:inherit diff-added)))) '(evil-goggles-undo-redo-add-face ((t (:inherit diff-added)))) '(evil-goggles-undo-redo-change-face ((t (:inherit diff-changed)))) '(evil-goggles-undo-redo-remove-face ((t (:inherit diff-removed)))) '(evil-goggles-yank-face ((t (:inherit diff-changed))))) ;; auto-package-update (use-package auto-package-update :ensure t :config (setq auto-package-update-delete-old-versions t) (auto-package-update-maybe)) ;; Autocomplete (use-package auto-complete :config (global-auto-complete-mode t)) ;; Theme (use-package base16-theme :config (load-theme 'base16-oceanicnext t)) ;; Undo-tree (use-package undo-tree :config (global-undo-tree-mode)) ;; Magit (use-package magit) ;; EVIL (use-package evil :ensure t :init (setq evil-want-keybinding nil) :config (evil-mode 1)) (use-package evil-collection :after evil :ensure t :config (evil-collection-init)) (use-package evil-commentary :ensure t) (use-package evil-expat :ensure t) (use-package evil-goggles :ensure t :config (evil-goggles-mode) ;; optionally use diff-mode's faces; as a result, deleted text ;; will be highlighed with `diff-removed` face which is typically ;; some red color (as defined by the color theme) ;; other faces such as `diff-added` will be used for other actions (evil-goggles-use-diff-faces)) (use-package evil-surround :after evil :ensure t :config (global-evil-surround-mode 1)) (use-package evil-org :after (evil org) :config (add-hook 'org-mode-hook 'evil-org-mode) (add-hook 'evil-org-mode-hook (lambda () (evil-org-set-key-theme))) (require 'evil-org-agenda) (evil-org-agenda-set-keys)) (evil-set-leader 'normal (kbd "SPC")) (evil-define-key 'normal 'global (kbd "C-k") 'evil-scroll-up) (evil-define-key 'normal 'global (kbd "C-j") 'evil-scroll-down) (evil-define-key 'normal 'global (kbd "l") 'evil-window-right) (evil-define-key 'normal 'global (kbd "h") 'evil-window-left) (evil-define-key 'normal 'global (kbd "j") 'evil-window-down) (evil-define-key 'normal 'global (kbd "k") 'evil-window-up) (evil-define-key 'normal 'global (kbd "i") 'help) (evil-define-key 'normal 'global (kbd "gc") 'evil-commentary) (evil-define-key 'normal 'global (kbd "u") 'undo-tree-visualize) ;; Lispy (use-package lispy) (add-hook 'emacs-lisp-mode-hook (lambda () (lispy-mode 1))) ;; smartparens (use-package smartparens :config (smartparens-global-mode t)) ;; which-key (use-package which-key :config (which-key-mode)) ;; Git gutter (use-package git-gutter :config (global-git-gutter-mode +1)) ;; Rainbow Delims (use-package rainbow-delimiters :config (add-hook 'prog-mode-hook 'rainbow-delimiters-mode)) ;; Org Mode (use-package org :mode (("\\.org$" . org-mode)) :ensure org-plus-contrib :config (evil-define-key 'normal 'global (kbd " SPC l") 'org-store-link) (evil-define-key 'normal 'global (kbd " SPC a") 'org-agenda) (evil-define-key 'normal 'global (kbd " SPC c") 'org-capture) ) (use-package toc-org :after (org) :config (add-hook 'org-mode-hook 'toc-org-mode) (add-hook 'markdown-mode-hook 'toc-org-mode)) (setq cider-font-lock-dynamically '(macro core function var)) ;; These don't work yet? ;; (define-key evil-insert-state-map (kbd "C-\\") 'cider-eval-defun-up-to-point) ;; (define-key evil-normal-state-map (kbd "C-\\") 'cider-eval-defun-up-to-point) ;; Extra things ; (global-whitespace-mode 1) ; (progn ;; Make whitespace-mode with very basic background coloring for whitespaces. ;; http://ergoemacs.org/emacs/whitespace-mode.html ; (setq whitespace-style (quote (face spaces tabs newline space-mark tab-mark newline-mark ))) ;; Make whitespace-mode and whitespace-newline-mode use “¶” for end of line char and “▷” for tab. ; (setq whitespace-display-mappings ;; all numbers are unicode codepoint in decimal. e.g. (insert-char 182 1) ; (quote ( ; (space-mark 32 [183] [46]) ; SPACE 32 「 」, 183 MIDDLE DOT 「·」, 46 FULL STOP 「.」 ; (newline-mark 10 [182 10]) ; LINE FEED, ; (tab-mark 9 [8614]) ; tab ; ) ; ) ; ) ; )