├── README.md ├── .gitignore ├── themes └── rubytapas-theme.el └── init.el /README.md: -------------------------------------------------------------------------------- 1 | # emacs.d 2 | Emacs config 3 | 4 | 5 | # Just clone 6 | 7 | git clone git@github.com:gs/emacs.d.git ~/.emacs.d 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | auto-save-list 2 | elpa/ 3 | projectile-bookmarks.eld 4 | projectile.cache 5 | recentf 6 | snippets 7 | transient 8 | *~ 9 | garbage.el 10 | .python-environments/ 11 | elpy/ 12 | ac-comphist.dat 13 | flychek* 14 | .last-package-update-day 15 | flycheck_init.el 16 | parinfer-rust/ 17 | -------------------------------------------------------------------------------- /themes/rubytapas-theme.el: -------------------------------------------------------------------------------- 1 | ;;; rubytapas-theme.el --- rubytapas theme with Emacs theme engine 2 | 3 | ;; Copyright (C) 2013 by Adam Lloyd 4 | ;; Copyright (C) 2013 by Syohei YOSHIDA 5 | ;; Copyright (C) 2013 by Avdi Grimm 6 | 7 | ;; Author: Avdi Grimm 8 | ;; URL: 9 | ;; Version: 10 | ;; X-Original-Version: 0.01 11 | 12 | ;; This program is free software; you can redistribute it and/or modify 13 | ;; it under the terms of the GNU General Public License as published by 14 | ;; the Free Software Foundation, either version 3 of the License, or 15 | ;; (at your option) any later version. 16 | 17 | ;; This program is distributed in the hope that it will be useful, 18 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | ;; GNU General Public License for more details. 21 | 22 | ;; You should have received a copy of the GNU General Public License 23 | ;; along with this program. If not, see . 24 | 25 | ;;; Commentary: 26 | 27 | ;; This is a trivially modified version of the "Molokai" color theme. 28 | ;; It increases the contrast of comments for better visibility. 29 | 30 | ;;; Code: 31 | 32 | (deftheme rubytapas 33 | "rubytapas theme") 34 | 35 | (custom-theme-set-faces 36 | 'rubytapas 37 | 38 | '(default ((t (:background "#1B1D1E" :foreground "#F8F8F2")))) 39 | '(cursor ((t (:foregound "#F8F8F0")))) 40 | 41 | '(bold ((t (:weight bold)))) 42 | '(bold-italic ((t (:weight bold :slant italic)))) 43 | '(custom-face-tag ((t (:foreground "#66D9EF" :weight bold)))) 44 | '(custom-state ((t (:foreground "#A6E22E")))) 45 | '(italic ((t (:slant italic)))) 46 | '(region ((t (:background "#403D3D")))) 47 | '(underline ((t (:underline t)))) 48 | '(css-selector ((t (:foreground "#F92672")))) 49 | '(css-property ((t (:foreground "#66D9EF")))) 50 | '(diff-added ((t (:foreground "#A6E22E" :weight bold)))) 51 | '(diff-context ((t (:foreground "#F8F8F2")))) 52 | '(diff-file-header ((t (:foreground "#66D9EF" :background nil)))) 53 | '(diff-indicator-added ((t (:foreground "#A6E22E")))) 54 | '(diff-indicator-removed ((t (:foreground "#F92672")))) 55 | '(diff-header ((t (:foreground "#F8F8F2" :background "#232526")))) 56 | '(diff-hunk-header ((t (:foreground "#AE81FF" :background "#232526")))) 57 | '(diff-removed ((t (:foreground "#F92672" :weight bold)))) 58 | '(escape-glyph ((t (:foreground "#E6DB74")))) 59 | '(minibuffer-prompt ((t (:foreground "#66D9EF")))) 60 | '(mode-line ((t (:foreground "#F8F8F2" :background "#000000" 61 | :box (:line-width 1 :color "#000000" :style released-button))))) 62 | '(mode-line-buffer-id ((t (:foreground nil :background "#000000" :weight semi-bold)))) 63 | '(mode-line-inactive ((t (:foreground "#BCBCBC" :background "#000000" 64 | ':box (:line-width 1 :color "#232526"))))) 65 | '(mode-line-mousable ((t (:foreground "#BCBCBC" :background "#000000")))) 66 | '(mode-line-mousable-minor-mode ((t (:foreground "#BCBCBC" :background "#000000")))) 67 | '(font-lock-builtin-face ((t (:foreground "#A6E22E")))) 68 | '(font-lock-comment-face ((t (:foreground "#9860B6DABD62" :slant italic)))) 69 | '(font-lock-comment-delimiter-face ((t (:foreground "#465457" :slant italic)))) 70 | '(font-lock-constant-face ((t (:foreground "#AE81FF")))) 71 | '(font-lock-doc-face ((t (:foreground "#E6DB74" :slant italic)))) 72 | '(font-lock-function-name-face ((t (:foreground "#F92672" :slant italic)))) 73 | '(font-lock-keyword-face ((t (:foreground "#66D9EF")))) 74 | '(font-lock-negation-char-face ((t (:weight bold)))) 75 | '(font-lock-preprocessor-face ((t (:foreground "#A6E22E")))) 76 | '(font-lock-regexp-grouping-backslash ((t (:weight bold)))) 77 | '(font-lock-regexp-grouping-construct ((t (:weight bold)))) 78 | '(font-lock-string-face ((t (:foreground "#E6DB74")))) 79 | '(font-lock-type-face ((t (:foreground "#66D9EF")))) 80 | '(font-lock-variable-name-face ((t (:foreground "#F92672")))) 81 | '(font-lock-warning-face ((t (:foreground "#FFFFFF" ':background "#333333")))) 82 | '(fringe ((t (:background "#232526")))) 83 | '(highlight ((t (:foreground "#000000" :background "#C4BE89")))) 84 | '(hl-line ((t (:background "#293739" :inherit nil)))) 85 | '(col-highlight ((t (:background "#293739" :inherit nil)))) 86 | '(vline ((t (:background "#293739" :inherit nil)))) 87 | '(icompletep-choices ((t (:foreground "#F92672")))) 88 | '(icompletep-determined ((t (:foreground "#A6E22E")))) 89 | '(icompletep-keys ((t (:foreground "#F92672")))) 90 | '(icompletep-nb-candidates ((t (:foreground "#AE81FF")))) 91 | '(isearch ((t (:foreground "#C4BE89" :background "#000000")))) 92 | '(isearch-fail ((t (:foreground "#FFFFFF" :background "#333333")))) 93 | '(lazy-highlight ((t (:foreground "#465457" :background "#000000")))) 94 | '(markdown-italic-face ((t (:slant italic)))) 95 | '(markdown-bold-face ((t (:weight bold)))) 96 | '(markdown-header-face ((t (:weight normal)))) 97 | '(markdown-header-face-1 ((t (:foreground "#66D9EF")))) 98 | '(markdown-header-face-2 ((t (:foreground "#F92672")))) 99 | '(markdown-header-face-3 ((t (:foreground "#A6E22E")))) 100 | '(markdown-header-face-4 ((t (:foreground "#AE81FF")))) 101 | '(markdown-header-face-5 ((t (:foreground "#E6DB74")))) 102 | '(markdown-header-face-6 ((t (:foreground "#66D9EF")))) 103 | '(markdown-inline-code-face ((t (:foreground "#66D9EF")))) 104 | '(markdown-list-face ((t (:foreground "#A6E22E")))) 105 | '(markdown-blockquote-face ((t (:slant italic)))) 106 | '(markdown-pre-face ((t (:foreground "#AE81FF")))) 107 | '(markdown-link-face ((t (:foreground "#66D9EF")))) 108 | '(markdown-reference-face ((t (:foreground "#66D9EF")))) 109 | '(markdown-url-face ((t (:foreground "#E6DB74")))) 110 | '(markdown-link-title-face ((t (:foreground "#F92672")))) 111 | '(markdown-comment-face ((t (:foreground "#465457")))) 112 | '(markdown-math-face ((t (:foreground "#AE81FF" :slant italic)))) 113 | '(mumamo-background-chunk-major ((t (:background "#272822")))) 114 | '(mumamo-background-chunk-submode ((t (:background "#1B1D1E")))) 115 | '(outline-1 ((t (:foreground "#66D9EF")))) 116 | '(outline-2 ((t (:foreground "#F92672")))) 117 | '(outline-3 ((t (:foreground "#A6E22E")))) 118 | '(outline-4 ((t (:foreground "#AE81FF")))) 119 | '(outline-5 ((t (:foreground "#E6DB74")))) 120 | '(outline-6 ((t (:foreground "#66D9EF")))) 121 | '(outline-7 ((t (:foreground "#F92672")))) 122 | '(outline-8 ((t (:foreground "#A6E22E")))) 123 | '(secondary-selection ((t (:background "#272822")))) 124 | '(show-paren-match-face ((t (:foreground "#000000" :background "#FD971F")))) 125 | '(show-paren-mismatch-face ((t (:foreground "#960050" :background "#1E0010")))) 126 | '(widget-inactive-face ((t (:background "#ff0000")))) 127 | '(woman-addition ((t (:foreground "#AE81FF")))) 128 | '(woman-bold ((t (:foreground "#F92672")))) 129 | '(woman-italic ((t (:foreground "#A6E22E")))) 130 | '(woman-unknown ((t (:foreground "#66D9EF"))))) 131 | 132 | ;;;###autoload 133 | (when load-file-name 134 | (add-to-list 'custom-theme-load-path 135 | (file-name-as-directory (file-name-directory load-file-name)))) 136 | 137 | (provide-theme 'rubytapas) 138 | 139 | ;;; rubytapas-theme.el ends here 140 | -------------------------------------------------------------------------------- /init.el: -------------------------------------------------------------------------------- 1 | (setq inhibit-startup-message t) 2 | 3 | (tooltip-mode -1) ; Disable tooltips 4 | 5 | (menu-bar-mode -1) ; Disable the menu bar 6 | 7 | ;; Set up the visible bell 8 | (setq visible-bell t) 9 | 10 | ;; Highlight current line. 11 | (global-hl-line-mode t) 12 | 13 | (setq custom-file "~/.emacs.d/garbage.el") 14 | ;; Use `command` as `meta` in macOS. 15 | (setq mac-command-modifier 'meta) 16 | ;; Make ESC quit prompts 17 | (global-set-key (kbd "") 'keyboard-escape-quit) 18 | 19 | 20 | (add-to-list 'custom-theme-load-path "~/.emacs.d/themes/") 21 | 22 | ; Require and initialize `package`. 23 | (require 'package) 24 | (package-initialize) 25 | 26 | (setq package-archives '( 27 | ("melpa" . "https://melpa.org/packages/") 28 | ("org" . "https://orgmode.org/elpa/") 29 | ("elpa" . "https://elpa.gnu.org/packages/"))) 30 | 31 | 32 | (when (not (package-installed-p 'use-package)) 33 | (package-refresh-contents) 34 | (package-install 'use-package)) 35 | 36 | (require 'use-package) 37 | (setq use-package-always-ensure t) 38 | 39 | (use-package company 40 | :config 41 | (setq company-idle-delay 0.1) 42 | (global-company-mode t)) 43 | 44 | (setq evil-want-keybinding nil) 45 | (use-package command-log-mode) 46 | (use-package neotree) 47 | (use-package restart-emacs) 48 | (use-package evil-surround) 49 | (use-package py-autopep8) 50 | (use-package undo-fu) 51 | (use-package evil 52 | :init (setq evil-want-keybinding nil) 53 | :config 54 | (evil-mode t) 55 | (evil-set-undo-system 'undo-fu) 56 | (setq evil-move-cursor-back nil 57 | evil-move-beyond-eol t 58 | evil-want-fine-undo t 59 | evil-mode-line-format 'before 60 | evil-normal-state-cursor '(box "orange") 61 | evil-insert-state-cursor '(box "green") 62 | evil-visual-state-cursor '(box "#F86155") 63 | evil-emacs-state-cursor '(box "purple")) 64 | ;; Prevent evil-motion-state from shadowing previous/next sexp 65 | (require 'evil-maps) 66 | (define-key evil-motion-state-map "L" nil) 67 | (define-key evil-motion-state-map "M" nil)) 68 | (use-package evil-collection 69 | :after (evil) 70 | :config 71 | (evil-collection-init) 72 | ;; Stop changing how last-sexp works. Even though we have evil-move-beyond-eol 73 | ;; set, this is still being added, and I can't figure out why. Resorting to 74 | ;; this hack. 75 | (cl-loop 76 | for fun 77 | in '(elisp--preceding-sexp cider-last-sexp pp-last-sexp) 78 | do (advice-mapc (lambda (advice _props) (advice-remove fun advice)) fun))) 79 | (use-package evil-surround 80 | :config (global-evil-surround-mode 1)) 81 | (use-package which-key 82 | :diminish which-key-mode 83 | :config 84 | (which-key-mode 1)) 85 | (use-package winum 86 | :config (winum-mode 1)) 87 | (use-package smartparens 88 | :init (require 'smartparens-config) 89 | :diminish smartparens-mode 90 | :hook (prog-mode . smartparens-mode)) 91 | 92 | ; We don't actually enable cleverparens, because most of their bindings we 93 | ;; don't want, we install our own bindings for specific sexp movements 94 | (use-package evil-cleverparens 95 | :after (evil smartparens)) 96 | (use-package aggressive-indent 97 | :diminish aggressive-indent-mode 98 | :hook ((clojurex-mode 99 | clojurescript-mode 100 | clojurec-mode 101 | clojure-mode 102 | emacs-lisp-mode 103 | lisp-data-mode) 104 | . aggressive-indent-mode)) 105 | (use-package rainbow-delimiters 106 | :hook ((cider-repl-mode 107 | clojurex-mode 108 | clojurescript-mode 109 | clojurec-mode 110 | clojure-mode 111 | emacs-lisp-mode 112 | lisp-data-mode 113 | inferior-emacs-lisp-mode) 114 | . rainbow-delimiters-mode)) 115 | (use-package evil-org) 116 | (use-package projectile-ripgrep) 117 | (use-package rg) 118 | (use-package lispy) 119 | (use-package helm-rg) 120 | (use-package yasnippet-snippets) 121 | (use-package magit) 122 | (use-package rjsx-mode) 123 | (use-package yaml-mode) 124 | (use-package elpy) 125 | (use-package helm-projectile) 126 | (use-package helm) 127 | (use-package projectile) 128 | (use-package evil) 129 | (use-package evil-leader) 130 | (use-package noctilux-theme) 131 | (use-package clojure-mode) 132 | (use-package clojure-snippets) 133 | (use-package markdown-mode) 134 | (use-package clj-refactor) 135 | (use-package lispy) 136 | (use-package paredit) 137 | (use-package smart-tab) 138 | (use-package smart-yank) 139 | (use-package clj-refactor) 140 | (use-package doom-modeline) 141 | (use-package company-tabnine) 142 | (use-package cider) 143 | (use-package flycheck) 144 | (use-package flycheck-pos-tip) 145 | (use-package flycheck-clojure) 146 | (use-package jedi) 147 | (use-package company-jedi) 148 | (use-package auto-package-update) 149 | 150 | (load-theme 'noctilux t) 151 | (load-theme 'rubytapas t) 152 | 153 | ;;(setq whitespace-line-column 80) 154 | (setq whitespace-style '(face tabs empty trailing lines-tail)) 155 | (setq projectile-enable-caching t) 156 | (setq helm-autoresize-mode t) 157 | (setq helm-buffer-max-length 40) 158 | (setq elpy-rpc-timeout nil) 159 | 160 | (evil-mode t) 161 | (evil-org-mode t) 162 | (elpy-enable) 163 | (helm-mode t) 164 | (helm-projectile-on) 165 | (global-set-key (kbd "M-x") 'helm-M-x) 166 | (projectile-global-mode) 167 | (global-evil-leader-mode) 168 | (paredit-mode 1) 169 | (yas-global-mode 1) 170 | (clj-refactor-mode 1) 171 | (global-flycheck-mode 1) 172 | (doom-modeline-mode 1) 173 | (global-whitespace-mode) 174 | (recentf-mode 1) 175 | 176 | ;;(define-key evil-normal-state-map (kbd "C-]") 'elpy-goto-definition) 177 | (define-key evil-normal-state-map (kbd ";") 'evil-ex) 178 | (define-key evil-visual-state-map (kbd ";") 'evil-ex) 179 | (define-key evil-motion-state-map (kbd ";") 'evil-ex) 180 | (modify-syntax-entry ?_ "w") 181 | (modify-syntax-entry ?- "w") 182 | (global-set-key (kbd "C-x k") 'kill-this-buffer) 183 | (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) 184 | (evil-define-key 'normal neotree-mode-map (kbd "SPC") 'neotree-quick-look) 185 | (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) 186 | (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) 187 | 188 | (evil-leader/set-leader ",") 189 | ;; Special key mapings 190 | (evil-leader/set-key 191 | "p" 'helm-projectile 192 | "f" 'projectile-find-file 193 | "F" 'projectile-recentf 194 | "b" 'switch-to-buffer 195 | "k" 'kill-buffer 196 | "/" 'projectile-ripgrep 197 | "t" 'eshell 198 | "gg" 'magit-status 199 | "gb" 'magit-blame-addition 200 | "m" 'minimize-window 201 | "M" 'maximize-window 202 | "e" 'neotree-toggle 203 | "s" 'swiper 204 | "!" 'async-shell-command 205 | "TAB" 'org-cycle) 206 | 207 | (defun bury-compile-buffer-if-successful (buffer string) 208 | "Bury a compilation buffer if succeeded without warnings " 209 | (when (and 210 | (buffer-live-p buffer) 211 | (string-match "compilation" (buffer-name buffer)) 212 | (string-match "finished" string) 213 | (not 214 | (with-current-buffer buffer 215 | (goto-char (point-min)) 216 | (search-forward "warning" nil t)))) 217 | (run-with-timer 1 nil 218 | (lambda (buf) 219 | (bury-buffer buf) 220 | (switch-to-prev-buffer (get-buffer-window buf) 'kill)) 221 | buffer))) 222 | (add-hook 'compilation-finish-functions 'bury-compile-buffer-if-successful) 223 | (put 'downcase-region 'disabled nil) 224 | 225 | (setq make-backup-files nil) 226 | ;; tabnine completion support 227 | (require 'company-tabnine) 228 | (define-key global-map (kbd "C-l") #'company-tabnine) 229 | (add-to-list 'company-backends #'company-tabnine) 230 | --------------------------------------------------------------------------------