├── .emacs.d ├── configs │ ├── basic-01-misc.el │ ├── basic-02-packages.el │ ├── basic-03-file-associations.el │ ├── basic-04-key-bindings.el │ ├── basic-05-hooks.el │ ├── basic-custom.el │ ├── standard-01-misc.el │ ├── standard-02-packages.el │ ├── standard-03-file-associations.el │ ├── standard-04-key-bindings.el │ ├── standard-05-hooks.el │ ├── standard-custom.el │ └── variables.el ├── init.el └── lib.el ├── .gitignore ├── LICENSE ├── README.md ├── docs └── README.org └── setup /.emacs.d/configs/basic-01-misc.el: -------------------------------------------------------------------------------- 1 | ;; System 2 | (if (eq system-type 3 | 'darwin) 4 | (progn 5 | (add-to-list 'exec-path 6 | "/usr/local/bin") 7 | (add-to-list 'exec-path 8 | "~/.cargo/bin"))) 9 | 10 | ;; Backup 11 | (setq backup-inhibited t 12 | create-lockfiles nil 13 | auto-save-default nil) 14 | 15 | ;; Startup 16 | (setq inhibit-startup-screen t 17 | initial-buffer-choice nil 18 | initial-scratch-message "") 19 | 20 | ;; Interface 21 | (menu-bar-mode -1) 22 | (display-battery-mode) 23 | 24 | ;; Text editing 25 | (column-number-mode) 26 | (show-paren-mode) 27 | (global-hl-line-mode) 28 | (setq-default indent-tabs-mode nil 29 | tab-width 4) 30 | (set-default 'cursor-type 31 | 'hbar) 32 | (delete-selection-mode 1) 33 | (prefer-coding-system 'utf-8-unix) 34 | (setq inhibit-eol-conversion t) 35 | (global-auto-revert-mode 1) 36 | 37 | ;; Spell-check 38 | (let ((path-to-aspell (locate-file "aspell" 39 | exec-path 40 | exec-suffixes 41 | 1))) 42 | (unless (null path-to-aspell) 43 | (progn 44 | (add-to-list 'exec-path (file-name-directory path-to-aspell)) 45 | (setq ispell-program-name "aspell" 46 | ispell-extra-args '("--sug-mode=ultra" "--lang=en_US"))))) 47 | 48 | ;; Package archives and 'customize' 49 | (setq custom-file 50 | (concat se2/se-root 51 | "custom.el")) 52 | (require 'package) 53 | (setq package-user-dir (concat se2/se-root "elpa") 54 | package--init-file-ensured t 55 | package-archives '(("GNU ELPA" . "https://elpa.gnu.org/packages/") 56 | ("MELPA Stable" . "https://stable.melpa.org/packages/") 57 | ("MELPA" . "https://melpa.org/packages/")) 58 | package-archive-priorities '(("MELPA Stable" . 10) 59 | ("GNU ELPA" . 5) 60 | ("MELPA" . 0))) 61 | (package-initialize) 62 | (unless (package-installed-p 'quelpa) 63 | (package-refresh-contents) 64 | (with-temp-buffer 65 | (url-insert-file-contents "https://raw.githubusercontent.com/quelpa/quelpa/master/quelpa.el") 66 | (eval-buffer) 67 | (quelpa-self-upgrade))) 68 | 69 | ;; Misc 70 | (winner-mode t) 71 | (require 'zone) 72 | (setq zone-programs [zone-pgm-quotes] 73 | org-todo-keywords '((sequence "DEFERRED(r)" "TODO(t)" "BLOCKED(b)" "IN-PROGRESS(p)" "|" 74 | "ALMOST-THERE(a)" "DONE(d)" "CANCELLED(c)" "DELEGATED(g)")) 75 | org-startup-indented t 76 | org-cycle-separator-lines 1 77 | dired-listing-switches "-alh") 78 | -------------------------------------------------------------------------------- /.emacs.d/configs/basic-02-packages.el: -------------------------------------------------------------------------------- 1 | (defvar se2/packages-basic 2 | '(;; Text-editing 3 | (multiple-cursors github "magnars/multiple-cursors.el" t) 4 | (company github "company-mode/company-mode" t) 5 | (undo-tree github "akhayyat/emacs-undo-tree" nil ("undo-tree.el")) 6 | (rainbow-mode github "emacsmirror/rainbow-mode" nil) 7 | (anzu github "emacsorphanage/anzu" t) 8 | (yasnippet github "joaotavora/yasnippet" t) 9 | (outer-spaces github "myTerminal/outer-spaces" nil) 10 | ;; Navigation 11 | (dumb-jump github "jacktasia/dumb-jump" t) 12 | (avy github "abo-abo/avy" t) 13 | (ace-window github "abo-abo/ace-window" t) 14 | (buffer-move github "lukhas/buffer-move" t) 15 | (perspective github "nex3/perspective-el" t) 16 | (window-shaper github "myTerminal/window-shaper" nil) 17 | ;; Language modes 18 | (markdown-mode github "jrblevin/markdown-mode" t) 19 | (web-mode github "fxbois/web-mode" t) 20 | (js2-mode github "mooz/js2-mode" t) 21 | (less-css-mode github "purcell/less-css-mode" t) 22 | (scss-mode github "antonj/scss-mode" t) 23 | (sass-mode github "nex3/sass-mode" t) 24 | (yaml-mode github "yoshiki/yaml-mode" t) 25 | (vue-mode github "AdamNiederer/vue-mode" t) 26 | (typescript-mode github "emacs-typescript/typescript.el" t) 27 | (rust-mode github "rust-lang/rust-mode" t) 28 | (csharp-mode github "emacs-csharp/csharp-mode" t) 29 | ;; Programming tools 30 | (eglot github "joaotavora/eglot" t) 31 | (slime github "slime/slime" t ("*")) 32 | (projectile github "bbatsov/projectile" t) 33 | (counsel-projectile github "ericdanan/counsel-projectile" t) 34 | (projectile-extras github "myTerminal/projectile-extras" nil) 35 | (column-enforce-mode github "jordonbiondo/column-enforce-mode" nil) 36 | (magit github "magit/magit" t ("lisp/*.el")) 37 | (quickrun github "emacsorphanage/quickrun" t) 38 | (restclient github "pashky/restclient.el") 39 | ;; File-system 40 | (dired-narrow github "Fuco1/dired-hacks" nil) 41 | (dired-subtree github "Fuco1/dired-hacks" nil) 42 | (dired-ranger github "Fuco1/dired-hacks" nil) 43 | (ztree github "fourier/ztree" nil) 44 | ;; Super-powers 45 | (which-key github "justbur/emacs-which-key" t) 46 | (counsel github "abo-abo/swiper" t ("counsel.el")) 47 | (key-chord github "emacsorphanage/key-chord" nil) 48 | (hydra github "abo-abo/hydra" t) 49 | (ellama github "s-kostyaev/ellama" nil) 50 | ;; Networking tools 51 | (mew github "kazu-yamamoto/Mew" t ("elisp/*.el")) 52 | ;; Statistical computing 53 | (ess github "emacs-ess/ESS" t ("*.el" "lisp/*.el")) 54 | (polymode github "polymode/polymode" t) 55 | (poly-R github "polymode/poly-R" t) 56 | (poly-markdown github "polymode/poly-markdown" t) 57 | ;; Misc 58 | (dim github "alezost/dim.el" t) 59 | (golden-ratio github "roman/golden-ratio.el" t) 60 | (volume github "dbrock/volume.el" nil) 61 | (zone-quotes github "myTerminal/zone-quotes" nil) 62 | )) 63 | 64 | (mapc 'se2/install-package-with-quelpa 65 | se2/packages-basic) 66 | 67 | (setq quelpa-update-melpa-p 68 | nil) 69 | 70 | (global-undo-tree-mode) 71 | 72 | (global-anzu-mode +1) 73 | 74 | (setq yas-snippet-dirs (list (concat se2/config-root 75 | "snippets"))) 76 | (yas-global-mode 1) 77 | 78 | (dumb-jump-mode) 79 | 80 | (customize-set-variable 'persp-mode-prefix-key 81 | (kbd "M-z")) 82 | (customize-set-variable 'persp-state-default-file 83 | (concat se2/se-root 84 | "persp-session-file")) 85 | (customize-set-variable 'persp-modestring-short 86 | t) 87 | (persp-mode) 88 | 89 | (setq inferior-js-program-command 90 | "node --interactive") 91 | 92 | (autoload 'markdown-mode 93 | "markdown-mode" 94 | "Major mode for editing Markdown files" 95 | t) 96 | 97 | (setq inferior-lisp-program 98 | (executable-find "sbcl")) 99 | 100 | (if (eq system-type 101 | 'windows-nt) 102 | (setq projectile-indexing-method 103 | 'alien)) 104 | (setq projectile-mode-line 105 | '(:eval (format " Project:%s" 106 | (projectile-project-name)))) 107 | (projectile-mode) 108 | (define-key projectile-mode-map 109 | (kbd "C-\\") 110 | 'projectile-command-map) 111 | 112 | (which-key-mode) 113 | 114 | (ivy-mode 1) 115 | (setq ivy-use-virtual-buffers t 116 | projectile-completion-system 'ivy) 117 | (counsel-projectile-mode) 118 | 119 | (key-chord-mode 1) 120 | 121 | (dim-minor-names '((undo-tree-mode nil undo-tree) 122 | (anzu-mode nil anzu) 123 | (projectile-mode nil projectile) 124 | (company-mode " a_ " company) 125 | (which-key-mode nil which-key) 126 | (outer-spaces-mode nil outer-spaces) 127 | (flyspell-mode " Aa" flyspell) 128 | (eldoc-mode nil eldoc) 129 | (fira-code-mode " i++" fira-code-mode) 130 | (buffer-face-mode nil face-remap) 131 | (hi-lock-mode nil hi-lock) 132 | (yas-minor-mode nil yasnippet) 133 | (ivy-mode nil ivy))) 134 | -------------------------------------------------------------------------------- /.emacs.d/configs/basic-03-file-associations.el: -------------------------------------------------------------------------------- 1 | (add-to-list 'auto-mode-alist 2 | '("\\.htm\\'" . web-mode)) 3 | (add-to-list 'auto-mode-alist 4 | '("\\.html\\'" . web-mode)) 5 | (add-to-list 'auto-mode-alist 6 | '("\\.jsx\\'" . web-mode)) 7 | (add-to-list 'auto-mode-alist 8 | '("\\.tsx\\'" . web-mode)) 9 | (add-to-list 'auto-mode-alist 10 | '("\\.handlebars\\'" . web-mode)) 11 | 12 | (add-to-list 'auto-mode-alist 13 | '("\\.js\\'" . js2-mode)) 14 | (add-to-list 'auto-mode-alist 15 | '("\\.ts\\'" . typescript-mode)) 16 | 17 | (add-to-list 'auto-mode-alist 18 | '("\\.scss\\'" . scss-mode)) 19 | (add-to-list 'auto-mode-alist 20 | '("\\.sass\\'" . sass-mode)) 21 | 22 | (add-to-list 'auto-mode-alist 23 | '("\\.text\\'" . markdown-mode)) 24 | (add-to-list 'auto-mode-alist 25 | '("\\.markdown\\'" . markdown-mode)) 26 | (add-to-list 'auto-mode-alist 27 | '("\\.md\\'" . markdown-mode)) 28 | -------------------------------------------------------------------------------- /.emacs.d/configs/basic-04-key-bindings.el: -------------------------------------------------------------------------------- 1 | ;;; Add-on for Ellama 2 | 3 | (defun ellama-omni-menu () 4 | "Provide the user with all Ellama actions." 5 | (interactive) 6 | (let ((ellama-actions '( 7 | ellama-code-complete 8 | ellama-code-add 9 | ellama-code-edit 10 | ellama-code-improve 11 | ellama-code-review 12 | ellama-generate-commit-message 13 | ellama-summarize 14 | ellama-summarize-webpage 15 | ellama-summarize-killring 16 | ellama-load-session 17 | ellama-session-rename 18 | ellama-session-remove 19 | ellama-session-switch 20 | ellama-improve-wording 21 | ellama-improve-grammar 22 | ellama-improve-conciseness 23 | ellama-make-list 24 | ellama-make-table 25 | ellama-make-format 26 | ellama-ask-about 27 | ellama-chat 28 | ellama-ask-line 29 | ellama-ask-selection 30 | ellama-translate 31 | ellama-translate-buffer 32 | ellama-complete 33 | ellama-chat-translation-enable 34 | ellama-chat-translation-disable 35 | ellama-define-word 36 | ellama-context-add-buffer 37 | ellama-context-add-file 38 | ellama-context-add-selection 39 | ellama-context-add-info-node 40 | ellama-provider-select 41 | ))) 42 | (if (featurep 'ivy) 43 | (let ((ivy-wrap t)) 44 | (ivy-read "Ellama: " 45 | ellama-actions 46 | :action (lambda (th) 47 | (call-interactively (intern th))))) 48 | (call-interactively (intern (ido-completing-read "Ellama: " 49 | (mapcar #'symbol-name 50 | ellama-actions))))))) 51 | 52 | ;;; Hydras 53 | 54 | (defhydra se2/hydra-toggles (:color pink) 55 | " 56 | _l_ line-numbers: %`display-line-numbers-mode 57 | _SPC_ outer-spaces: %`outer-spaces-mode 58 | _w_ word-wrap: %`visual-line-mode 59 | _k_ super-kill: %`kill-whole-line 60 | _s_ line-spacing: %`line-spacing 61 | 62 | " 63 | ("l" display-line-numbers-mode nil) 64 | ("SPC" outer-spaces-mode nil) 65 | ("w" visual-line-mode nil) 66 | ("k" se2/toggle-super-kill nil) 67 | ("s" se2/toggle-line-spacing nil) ; TODO: Move to standard mode 68 | ("q" nil "Cancel")) 69 | 70 | (defhydra se2/hydra-tools (:color blue) 71 | "Tools" 72 | ("z" se2/set-zoning "Enable zoning") 73 | ("x" zone-leave-me-alone "Disable zoning") 74 | ("." ztree-dir "ztree") 75 | ("/" term "Terminal") 76 | ("i" se2/prompt-to-connect-to-irc "Connect to IRC") 77 | ("l" ellama-omni-menu "Ellama...") 78 | ("?" ellama-chat "Chat with Ellama") 79 | ("q" nil "Cancel")) 80 | 81 | (defhydra se2/hydra-editing (:color blue) 82 | "Editing" 83 | ;; Programming 84 | (">" dumb-jump-go "Go to definition") 85 | ("<" dumb-jump-back "Back from definition") 86 | ;; Jumping 87 | ("k" avy-goto-char-timer "Jump to char") 88 | ("j" avy-goto-word-1 "Jump to word") 89 | ("l" avy-goto-line "Jump to line") 90 | ("[" pop-global-mark "Go back") 91 | ;; Searching 92 | ("s" projectile-find-all-occurrences "Search for occurrences") 93 | ("r" projectile-find-all-references "Search for references") 94 | ;; Misc 95 | ("f" se2/reload-current-file "Reload file") 96 | ("q" nil "Cancel")) 97 | 98 | (defhydra se2/hydra-windows () 99 | "Buffers and Windows" 100 | ;; Moving 101 | ("S-" windmove-up "^") 102 | ("S-" windmove-down "v") 103 | ("S-" windmove-left "<") 104 | ("S-" windmove-right ">") 105 | ("M-" buf-move-up "Move up") 106 | ("M-" buf-move-down "Move down") 107 | ("M-" buf-move-left "Move left") 108 | ("M-" buf-move-right "Move right") 109 | ;; Jumping 110 | ("\\" ace-window "Jump to window" :color blue) 111 | ;; Arranging 112 | ("_" window-shaper-mode "Resize windows" :color blue) 113 | ("+" se2/window-toggle-split-direction "Horizontal<>Vertical") 114 | ;; Misc 115 | ("q" nil "Cancel")) 116 | 117 | ;;; Key-chords 118 | 119 | (key-chord-define-global "~~" 'se2/hydra-toggles/body) 120 | (key-chord-define-global "[[" 'se2/hydra-tools/body) 121 | (key-chord-define-global "]]" 'se2/hydra-editing/body) 122 | (key-chord-define-global "\\\\" 'se2/hydra-windows/body) 123 | 124 | ;;; Regular key-bindings 125 | 126 | (se2/bind-keys '( 127 | ;; Buffer/Window management 128 | ("C-x b" . ivy-switch-buffer) 129 | ("C-c p" . se2/switch-to-previous-buffer) 130 | ("C-c b" . ivy-push-view) 131 | ("C-x C-f" . counsel-find-file) 132 | ("C-x C-r" . counsel-recentf) 133 | ("C-x k" . se2/kill-this-buffer) 134 | ;; Text-editing 135 | ("C-|" . undo-tree-visualize) 136 | ("M-%" . anzu-query-replace) 137 | ("C-}" . mc/mark-next-like-this) 138 | ("C-{" . mc/mark-previous-like-this) 139 | ("C-\"" . mc/mark-all-like-this) 140 | ("M-y" . counsel-yank-pop) 141 | ("M-" . se2/move-line-down) 142 | ("M-" . se2/move-line-up) 143 | ("C-" . se2/delete-word-backward) 144 | ("C-c s" . swiper) 145 | ;; Misc 146 | ("C-=" . se2/eval-and-replace) 147 | ("M-x" . counsel-M-x)) 148 | global-map) 149 | 150 | (se2/bind-keys '( 151 | ;; dired-narrow 152 | ("/" . dired-narrow-fuzzy) 153 | ;; dired-subtree 154 | ("]" . dired-subtree-toggle) 155 | ("[" . dired-subtree-cycle) 156 | ("C-" . dired-subtree-beginning) 157 | ("C-" . dired-subtree-end) 158 | ("C-" . dired-subtree-up) 159 | ("C-" . dired-subtree-down) 160 | ("M-" . dired-subtree-previous-sibling) 161 | ("M-" . dired-subtree-next-sibling) 162 | ("M-" . dired-subtree-mark-subtree) 163 | ("M-" . dired-subtree-unmark-subtree) 164 | ;; dired-ranger 165 | ("M-c" . dired-ranger-copy) 166 | ("M-m" . dired-ranger-move) 167 | ("M-v" . dired-ranger-paste)) 168 | dired-mode-map) 169 | 170 | (se2/bind-keys '( 171 | ;; quickrun 172 | ("C-c e" . quickrun) 173 | ("C-c r" . quickrun-region) 174 | ("C-c t" . quickrun-replace-region)) 175 | prog-mode-map) 176 | 177 | ;;; Augmentations to company-mode 178 | ;; TODO: Find a better way to do this 179 | (add-hook 'company-mode-hook 180 | (lambda () 181 | (define-key company-active-map 182 | (kbd "RET") 183 | 'company-abort) 184 | (define-key company-active-map 185 | [return] 186 | 'company-abort) 187 | (define-key company-active-map 188 | (kbd "") 189 | 'company-complete-selection))) 190 | -------------------------------------------------------------------------------- /.emacs.d/configs/basic-05-hooks.el: -------------------------------------------------------------------------------- 1 | (add-hook 'after-init-hook 2 | 'global-company-mode) 3 | 4 | (add-hook 'dired-mode-hook 5 | 'auto-revert-mode) 6 | 7 | (add-hook 'prog-mode-hook 8 | 'display-line-numbers-mode) 9 | (add-hook 'prog-mode-hook 10 | 'electric-pair-local-mode) 11 | (add-hook 'prog-mode-hook 12 | 'outer-spaces-mode) 13 | 14 | (add-hook 'text-mode-hook 15 | 'electric-pair-local-mode) 16 | (add-hook 'text-mode-hook 17 | 'flyspell-mode) 18 | 19 | (add-hook 'yas-minor-mode 20 | (lambda () 21 | (yas-activate-extra-mode 'fundamental-mode))) 22 | -------------------------------------------------------------------------------- /.emacs.d/configs/basic-custom.el: -------------------------------------------------------------------------------- 1 | ;; Place your personal configs for "basic" mode here in this file. 2 | ;; This file will be loaded after all the "basic-*.el" files. 3 | -------------------------------------------------------------------------------- /.emacs.d/configs/standard-01-misc.el: -------------------------------------------------------------------------------- 1 | (setq frame-title-format "%b - super-emacs" 2 | use-dialog-box nil 3 | visible-bell t) 4 | (tool-bar-mode 0) 5 | (scroll-bar-mode 0) 6 | (set-face-attribute 'mode-line 7 | nil 8 | :box nil) 9 | 10 | (setq org-pretty-entities t 11 | org-hide-emphasis-markers t 12 | org-startup-with-inline-images t 13 | org-image-actual-width '(640)) 14 | 15 | (if (find-font (font-spec :name se2/variable/font-default-family)) 16 | (set-face-attribute 'default nil 17 | :font se2/variable/font-default-family 18 | :height se2/variable/font-default-height)) 19 | 20 | (set-frame-size (selected-frame) 21 | (car se2/variable/frame-dimensions) 22 | (cdr se2/variable/frame-dimensions)) 23 | -------------------------------------------------------------------------------- /.emacs.d/configs/standard-02-packages.el: -------------------------------------------------------------------------------- 1 | (defvar se2/packages-standard 2 | '(;; Language modes 3 | (latex-preview-pane github "jsinglet/latex-preview-pane" nil) 4 | ;; Programming tools 5 | (diff-hl github "dgutov/diff-hl" t) 6 | (skewer-mode github "skeeto/skewer-mode" t) 7 | ;; Color themes 8 | (material-theme github "cpaulik/emacs-material-theme" t) 9 | (hemisu-theme github "andrzejsliwa/hemisu-theme" nil) 10 | (green-phosphor-theme github "aalpern/emacs-color-theme-green-phosphor" nil) 11 | (overcast-theme github "myTerminal/overcast-theme" nil) 12 | ;; Visual tweaks 13 | (telephone-line github "dbordak/telephone-line" nil) 14 | (fira-code-mode github "jming422/fira-code-mode" nil) 15 | (theme-looper github "myTerminal/theme-looper" nil) 16 | )) 17 | 18 | (mapc 'se2/install-package-with-quelpa 19 | se2/packages-standard) 20 | 21 | (global-diff-hl-mode) 22 | 23 | (require 'telephone-line) 24 | (setq telephone-line-lhs '((evil . (telephone-line-hud-segment 25 | telephone-line-position-segment)) 26 | (accent . (telephone-line-buffer-modified-segment 27 | telephone-line-buffer-name-segment 28 | telephone-line-perspective-segment)) 29 | (nil . (telephone-line-minor-mode-segment))) 30 | telephone-line-rhs '((nil . (telephone-line-process-segment 31 | telephone-line-projectile-segment 32 | telephone-line-vc-segment 33 | telephone-line-erc-modified-channels-segment)) 34 | (accent . (telephone-line-major-mode-segment)) 35 | (evil . (telephone-line-atom-eol-segment 36 | telephone-line-atom-encoding-segment 37 | telephone-line-filesize-segment))) 38 | telephone-line-primary-left-separator telephone-line-gradient 39 | telephone-line-primary-right-separator telephone-line-gradient) 40 | (telephone-line-mode t) 41 | 42 | (theme-looper-enable-theme se2/variable/color-theme) 43 | -------------------------------------------------------------------------------- /.emacs.d/configs/standard-03-file-associations.el: -------------------------------------------------------------------------------- 1 | ;; Nothing here yet 2 | -------------------------------------------------------------------------------- /.emacs.d/configs/standard-04-key-bindings.el: -------------------------------------------------------------------------------- 1 | (se2/bind-keys '( 2 | ;; Misc 3 | ("C-c )" . theme-looper-enable-next-theme) 4 | ("C-c (" . theme-looper-enable-previous-theme)) 5 | global-map) 6 | -------------------------------------------------------------------------------- /.emacs.d/configs/standard-05-hooks.el: -------------------------------------------------------------------------------- 1 | (add-hook 'dired-mode-hook 2 | 'diff-hl-dired-mode) 3 | 4 | (add-hook 'prog-mode-hook 5 | 'fira-code-mode) 6 | (add-hook 'prog-mode-hook 7 | 'diff-hl-flydiff-mode) 8 | (add-hook 'prog-mode-hook 9 | 'diff-hl-show-hunk-mouse-mode) 10 | 11 | (add-hook 'text-mode-hook 12 | 'diff-hl-flydiff-mode) 13 | (add-hook 'text-mode-hook 14 | 'diff-hl-show-hunk-mouse-mode) 15 | 16 | (add-hook 'prog-mode-hook 17 | (lambda () 18 | (if (find-font (font-spec :name se2/variable/font-family-for-programming)) 19 | (progn 20 | (setq buffer-face-mode-face `(:family ,se2/variable/font-family-for-programming)) 21 | (buffer-face-mode))))) 22 | -------------------------------------------------------------------------------- /.emacs.d/configs/standard-custom.el: -------------------------------------------------------------------------------- 1 | ;; Place your personal configs for "standard" mode here in this file. 2 | ;; This file will be loaded after all the "standard-*.el" files. 3 | -------------------------------------------------------------------------------- /.emacs.d/configs/variables.el: -------------------------------------------------------------------------------- 1 | (defvar se2/variable/color-theme 2 | 'overcast) 3 | 4 | (defvar se2/variable/font-default-family 5 | "Liberation Mono") 6 | (defvar se2/variable/font-default-height 7 | 150) 8 | (defvar se2/variable/font-family-for-programming 9 | "Fira Code") 10 | 11 | ;; TODO: Improve this, turn it into a simpler form 12 | (defvar se2/variable/frame-dimensions 13 | '(100 . 30)) 14 | 15 | (defvar se2/variable/configured-irc-connections 16 | #s(hash-table 17 | size 3 18 | test equal 19 | data ( 20 | "LiberaChat" (lambda (password) 21 | (erc-tls :server "irc.libera.chat" 22 | :port 6697 23 | :nick "shepard" 24 | :full-name "Commander Shepard" 25 | :password password)) 26 | "Freenode" (lambda (password) 27 | (erc-tls :server "irc.freenode.net" 28 | :port 6697 29 | :nick "shepard" 30 | :full-name "Commander Shepard" 31 | :password password))))) 32 | -------------------------------------------------------------------------------- /.emacs.d/init.el: -------------------------------------------------------------------------------- 1 | (require 'cl-lib) 2 | 3 | ;; Record startup timestamp 4 | (defvar se2/invokation-time 5 | (current-time)) 6 | 7 | ;; Initialize root 8 | (defvar se2/se-root 9 | (file-name-directory load-file-name)) 10 | 11 | ;; Determine config root 12 | (defvar se2/config-root 13 | (file-name-directory user-init-file)) 14 | 15 | (defun se2/load-config (config-name) 16 | "Loads all the config files for the specified config." 17 | (mapc 'load (file-expand-wildcards (concat se2/se-root 18 | "configs/" 19 | config-name 20 | "-*.el")))) 21 | 22 | (defun se2/start () 23 | "Loads core and then conditionally loads configs." 24 | (load (expand-file-name "lib" 25 | se2/se-root)) 26 | (load (expand-file-name "variables" 27 | (concat se2/se-root 28 | "configs"))) 29 | (se2/load-config "basic") 30 | (if (display-graphic-p) 31 | (se2/load-config "standard")) 32 | (se2/show-welcome-screen)) 33 | 34 | ;; Start 35 | (se2/start) 36 | -------------------------------------------------------------------------------- /.emacs.d/lib.el: -------------------------------------------------------------------------------- 1 | (define-derived-mode super-emacs-welcome-mode 2 | special-mode 3 | "super-emacs" 4 | :abbrev-table nil 5 | :syntax-table nil 6 | (setq cursor-type nil)) 7 | 8 | (defun se2/show-welcome-screen () 9 | "Prints welcome message and more to the current buffer." 10 | (cl-flet* ((get-ellapsed-time () 11 | (propertize (number-to-string (cadr (time-subtract (current-time) 12 | se2/invokation-time))) 13 | 'face '(:slant italic))) 14 | (get-formatted-time () 15 | (format-time-string "%B %d, %Y")) 16 | (get-operating-system () 17 | (cond 18 | ((string-equal system-type "windows-nt") "Microsoft Windows") 19 | ((string-equal system-type "darwin") "Mac OS X") 20 | ((string-equal system-type "gnu/linux") "Linux") 21 | (t "Unknown"))) 22 | (get-bold-text (text) 23 | (propertize text 'face '(:weight bold))) 24 | (set-key-bindings () 25 | (local-set-key (kbd "z") 26 | 'persp-state-load) 27 | (local-set-key (kbd "?") 28 | 'ellama-chat) 29 | (local-set-key (kbd "q") 30 | (lambda () 31 | (interactive) 32 | (kill-buffer (get-buffer-create " *Welcome*")))))) 33 | (with-current-buffer (get-buffer-create " *Welcome*") 34 | (set-window-buffer (get-buffer-window) (current-buffer)) 35 | (insert (concat (propertize "super-emacs" 'face '(:height 2.0 :weight bold)) "\n" 36 | "(Started in " (get-ellapsed-time) " seconds)" "\n" 37 | "\n" 38 | "Today is " (get-bold-text (get-formatted-time)) "\n" 39 | "\n" 40 | "Emacs version: " (get-bold-text emacs-version) "\n" 41 | "Logged in as: " (get-bold-text user-login-name) "\n" 42 | "Host: " (get-bold-text system-name) " (" (get-bold-text (get-operating-system)) ")" "\n" 43 | "Init file: " (get-bold-text user-init-file) "\n" 44 | "\n" 45 | (get-bold-text "[z]") " to resume session" 46 | "\n" 47 | (get-bold-text "[?]") " to start a chat with Ellama" 48 | "\n" 49 | (get-bold-text "[q]") " to dismiss")) 50 | (super-emacs-welcome-mode) 51 | (set-key-bindings)))) 52 | 53 | (defun se2/install-package-with-quelpa (p) 54 | "Installs the supplied package with quelpa, if not already installed" 55 | (unless (package-installed-p (car p)) 56 | (cond ((eq (cadr p) 'melpa) (quelpa (car p) 57 | :stable (cadddr p))) 58 | ((eq (cadr p) 'github) (if (null (cadddr (cdr p))) 59 | (quelpa `(,(car p) 60 | :fetcher ,(cadr p) 61 | :repo ,(caddr p) 62 | :stable ,(cadddr p))) 63 | (quelpa `(,(car p) 64 | :fetcher ,(cadr p) 65 | :repo ,(caddr p) 66 | :files ,(cadddr (cdr p)) 67 | :stable ,(cadddr p))))) 68 | (t (quelpa `(,(car p) 69 | :fetcher ,(cadr p) 70 | :url ,(caddr p) 71 | :stable ,(cadddr p))))))) 72 | 73 | (defun se2/bind-keys (bindings keymap) 74 | "Applies supplied key-bindings for a particular keymap" 75 | (mapc (lambda (b) 76 | (define-key keymap 77 | (kbd (car b)) 78 | (cdr b))) 79 | bindings)) 80 | 81 | (defun se2/set-zoning () 82 | "Sets zoning timeout" 83 | (interactive) 84 | (zone-when-idle 60) 85 | (message "Zoning set")) 86 | 87 | (defun se2/change-line-endings-to-unix () 88 | "Changes line-endings of current file to utf-8-unix." 89 | (interactive) 90 | (set-buffer-file-coding-system 91 | 'utf-8-unix)) 92 | 93 | (defun se2/move-line-up () 94 | "Moves the current line up by one step." 95 | (interactive) 96 | (transpose-lines 1) 97 | (forward-line -2)) 98 | 99 | (defun se2/move-line-down () 100 | "Moves the current line down by one step." 101 | (interactive) 102 | (forward-line 1) 103 | (transpose-lines 1) 104 | (forward-line -1)) 105 | 106 | (defun se2/delete-word-backward () 107 | "Deletes the word on the left of the cursor." 108 | (interactive) 109 | (set-mark-command nil) 110 | (backward-word) 111 | (backward-delete-char-untabify 1)) 112 | 113 | (defun se2/eval-and-replace () 114 | "Replaces expression to the left with it's value in the current buffer." 115 | (interactive) 116 | (backward-kill-sexp) 117 | (prin1 (eval (read (current-kill 0))) 118 | (current-buffer))) 119 | 120 | (defun se2/remove-formatting (text) 121 | "Removes formatting of the supplied text." 122 | (interactive "sEnter text: ") 123 | (kill-new text) 124 | (message "Formatting removed, text copied to clipboard!")) 125 | 126 | (defun se2/switch-to-previous-buffer () 127 | "Switch to most recent buffer." 128 | (interactive) 129 | (switch-to-buffer (other-buffer (current-buffer) 1))) 130 | 131 | (defun se2/kill-this-buffer () 132 | "Kill the current buffer." 133 | (interactive) 134 | (kill-buffer (current-buffer))) 135 | 136 | (defun se2/reload-current-file () 137 | "Reload the file loaded in current buffer from the disk." 138 | (interactive) 139 | (cond (buffer-file-name (progn (find-alternate-file buffer-file-name) 140 | (message "File reloaded"))) 141 | (t (message "You're not editing a file!")))) 142 | 143 | (defun se2/prompt-to-connect-to-irc () 144 | "Prompts with a list of ERC connections and then connects to the chosen one." 145 | (interactive) 146 | (cl-flet* ((se2/connect-to-irc (connection) 147 | (let ((password (read-passwd "Enter password: "))) 148 | (funcall connection password)))) 149 | (if (featurep 'ivy) 150 | (let* ((ivy-wrap t)) 151 | (ivy-read "Choose an IRC server: " 152 | (hash-table-keys se2/variable/configured-irc-connections) 153 | :action (lambda (server) 154 | (let ((connection (gethash server 155 | se2/variable/configured-irc-connections))) 156 | (if connection 157 | (se2/connect-to-irc connection) 158 | (message "Please specify a valid server!"))))))))) 159 | 160 | ;; Credit: https://github.com/jonathanj 161 | (defun se2/window-toggle-split-direction () 162 | "Switches window split from horizontally to vertically, or vice versa." 163 | (interactive) 164 | (require 'windmove) 165 | (let ((done)) 166 | (dolist (dirs '((right . down) (down . right))) 167 | (unless done 168 | (let* ((win (selected-window)) 169 | (nextdir (car dirs)) 170 | (neighbour-dir (cdr dirs)) 171 | (next-win (windmove-find-other-window nextdir win)) 172 | (neighbour1 (windmove-find-other-window neighbour-dir win)) 173 | (neighbour2 (if next-win (with-selected-window next-win 174 | (windmove-find-other-window 175 | neighbour-dir next-win))))) 176 | 177 | (setq done (and (eq neighbour1 neighbour2) 178 | (not (eq (minibuffer-window) next-win)))) 179 | (if done 180 | (let* ((other-buf (window-buffer next-win))) 181 | (delete-window next-win) 182 | (if (eq nextdir 'right) 183 | (split-window-vertically) 184 | (split-window-horizontally)) 185 | (set-window-buffer (windmove-find-other-window neighbour-dir) 186 | other-buf)))))))) 187 | 188 | (defun se2/toggle-super-kill () 189 | "Toggles whether or not to kill the carriage return at the end of the line 190 | when killing a line." 191 | (interactive) 192 | (setq kill-whole-line 193 | (not kill-whole-line))) 194 | 195 | (defun se2/toggle-line-spacing () 196 | "Toggles line-spacing between 0 and 10." 197 | (interactive) 198 | (if line-spacing 199 | (setq line-spacing nil) 200 | (setq line-spacing 10))) 201 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | !/.gitignore 4 | 5 | !/.emacs.d 6 | /.emacs.d/* 7 | !/.emacs.d/configs 8 | !/.emacs.d/lib.el 9 | !/.emacs.d/init.el 10 | 11 | !/docs 12 | !/setup 13 | !/LICENSE 14 | !/README.md 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | 676 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # super-emacs 2 | 3 | [![License](https://img.shields.io/badge/LICENSE-GPL%20v3.0-blue.svg)](https://www.gnu.org/licenses/gpl.html) 4 | [![Join the chat at https://gitter.im/myTerminal/super-emacs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/myTerminal/super-emacs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 5 | [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Y8Y5E5GL7) 6 | 7 | An out-of-the-box Emacs configuration with superpowers 8 | 9 | ## A few highlights 10 | 11 | - Minimal interface with a more readable font size and a dark theme 12 | - Dual configuration for text-based and graphical modes 13 | - Easier buffer and window navigation and text edits with a range of configured key bindings 14 | - A custom mode-line with more info 15 | - Key bindings arranged under a few keys to keep the rest of the keys free 16 | - Several tweaks and settings for a better programming experience in multiple languages and to work with projects and named workspaces 17 | - More control over package versioning using [quelpa](https://github.com/quelpa/quelpa) 18 | - Statistical computing with [R Markdown](https://rmarkdown.rstudio.com) files 19 | - Interaction with large language models from within buffers 20 | - More in [the docs](docs)! 21 | 22 | ## Documentation 23 | 24 | Visit [the docs](docs) for comprehensive documentation about obtaining, setting up, features, and more. 25 | -------------------------------------------------------------------------------- /docs/README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: super-emacs 2 | 3 | *super-emacs* is an out-of-the-box Emacs configuration with *superpowers*. 4 | 5 | * Overview 6 | 7 | (coming soon...) 8 | 9 | * Setting up 10 | 11 | Using *super-emacs* as your Emacs config involves just a little more than linking the provided [[../.emacs.d][.emacs.d]] directory to your local filesystem and it can be done either using the automatic setup or doing it manually. 12 | 13 | ** Automatic setup (does not work for Windows) 14 | 15 | Simply execute the following command in a terminal: 16 | 17 | #+NAME: command_install_automatic 18 | #+BEGIN_SRC bash 19 | /bin/bash -c "$(curl https://raw.githubusercontent.com/myTerminal/super-emacs/master/setup)" 20 | #+END_SRC 21 | 22 | If everything goes as planned, the next time you start Emacs, *super-emacs* will be automatically configured. 23 | 24 | _PS:_ For macOS, the shell needs to be changed from Zsh to Bash and there needs to be a ~sudo xcode-select --install~ before anything else. 25 | 26 | ** Manual setup 27 | 28 | Clone this project on your local workspace like: 29 | 30 | #+NAME: command_install_manual_1 31 | #+BEGIN_SRC bash 32 | git clone https://github.com/myTerminal/super-emacs.git 33 | #+END_SRC 34 | 35 | Create a soft link to [[../.emacs.d][.emacs.d]] under the user's home directory. 36 | 37 | #+NAME: command_install_manual_2 38 | #+BEGIN_SRC bash 39 | ln -s /super-emacs/.emacs.d ~/.emacs.d 40 | #+END_SRC 41 | 42 | If your file system does not support soft links for operating systems like Windows, you may create a copy of [[../.emacs.d][.emacs.d]] under your home directory. An obvious problem with this method would be that updates to *super-emacs* would need much more than a ~git pull~. 43 | 44 | Once done, start Emacs to enjoy new superpowers. The first startup will take a little while to fetch packages from their respective sources. 45 | 46 | *** XDG support in Emacs 27+ 47 | 48 | Emacs 27 [[https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4118297ae2fab4886b20d193ba511a229637aea3][comes with XDG support]] and hence will also work with ~~/.config/emacs~. To be able to use *super-emacs* that way, you can link it in the following way: 49 | 50 | #+NAME: command_install_manual_3 51 | #+BEGIN_SRC bash 52 | ln -s /super-emacs/.emacs.d ~/.config/emacs 53 | #+END_SRC 54 | 55 | * Optional external dependencies 56 | 57 | ** Fonts 58 | 59 | The below two fonts have been configured by default: 60 | 61 | 1. [[https://www.fontsquirrel.com/fonts/liberation-mono][Liberation Mono]] for text modes 62 | 2. [[https://github.com/tonsky/FiraCode][Fira Code]] for programming modes 63 | 64 | ** [[http://aspell.net][aspell]] 65 | 66 | For spell-check, you need to have ~aspell~ installed on the system for it to work with ~ispell~. Refer to [[http://aspell.net][the official site]] for instructions on how to install it on your operating system. 67 | 68 | ** [[https://github.com/ollama/ollama][ollama]] along with a model like [[https://ollama.com/library/zephyr][zephyr]] 69 | 70 | To be able to interact with LLMs from within *super-emacs*. 71 | 72 | ** [[https://www.r-project.org][R]] 73 | 74 | To be able to work with R Markdown files, *super-emacs* comes pre-configured with all the required packages except for an external dependency on [[https://www.r-project.org][R]] which needs to be installed on the system. 75 | 76 | * Features 77 | 78 | ** Interface 79 | 80 | *** Cleaner frames 81 | 82 | *super-emacs* provides the user with a cleaner interface which is most noticeable when running Emacs in a graphical environment where elements like the menubar, the toolbar, and the scrollbar are hidden from sight to provide more space to work with what's more important: the text. This barely loses any functionality as most of it is still accessible from within Emacs through other alternate means. 83 | 84 | *** No dialogues 85 | 86 | When running inside a graphical environment, especially when using the mouse to navigate around, Emacs often uses graphical dialog boxes for prompts and confirmations. *super-emacs* has this behavior disabled and all user interaction happens through the keyboard. 87 | 88 | *** Color themes 89 | 90 | *super-emacs* comes with a set of five color themes consisting of light, dark and monochromatic colors. There's also *theme-looper* that can help you switch through those themes with the following set of key bindings: 91 | 92 | #+BEGIN_QUOTE 93 | Packages used: [[https://github.com/myTerminal/theme-looper][theme-looper]], [[https://github.com/cpaulik/emacs-material-theme][material-theme]], [[https://github.com/andrzejsliwa/hemisu-theme][hemisu-theme]], [[https://github.com/aalpern/emacs-color-theme-green-phosphor][green-phosphor]], [[https://github.com/myTerminal/overcast-theme][overcast-theme]] 94 | #+END_QUOTE 95 | 96 | |-------+--------------------------------------------| 97 | | Keys | Action | 98 | |-------+--------------------------------------------| 99 | | C-c ( | Switches to the previous theme in the list | 100 | | C-c ) | Switches to the next theme in the list | 101 | |-------+--------------------------------------------| 102 | 103 | *** Completion system 104 | 105 | Whether you're finding a file, switching between buffers or executing a command from the minibuffer, *super-emacs* has you covered with a smart completion system that prompts you with a list of possible candidates filtered as you type. This is implemented using a suite of three utilities: *ivy*, *counsel* and *swiper*. 106 | 107 | #+BEGIN_QUOTE 108 | Package used: [[https://github.com/abo-abo/swiper][counsel]] 109 | #+END_QUOTE 110 | 111 | *** Modeline 112 | 113 | The default modeline in Emacs is replaced with a custom (and arguably more functional) modeline using a package named *telephone-line*. It attempts to display as much information as possible while hiding status symbols for most minor modes. 114 | 115 | This modeline is not available when Emacs is not run inside a graphical environment. 116 | 117 | #+BEGIN_QUOTE 118 | Packages used: [[https://github.com/dbordak/telephone-line][telephone-line]], [[https://github.com/alezost/dim.el][dim]] 119 | #+END_QUOTE 120 | 121 | *** Nested key-bindings 122 | 123 | In order to keep key bindings easier to access and remember, they have been organized into four groups. The keys corresponding to the groups have to be pressed twice quickly in order to bring up the respective menus. 124 | 125 | #+BEGIN_QUOTE 126 | Packages used: [[https://github.com/abo-abo/hydra][hydra]], [[https://github.com/emacsorphanage/key-chord][key-chord]] 127 | #+END_QUOTE 128 | 129 | |------+--------------------------| 130 | | Keys | Action | 131 | |------+--------------------------| 132 | | ~~ | Toggles menu | 133 | | [[ | Tools menu | 134 | | ]] | Editing menu | 135 | | \\ | Buffers and Windows menu | 136 | |------+--------------------------| 137 | 138 | *** Quick toggles 139 | 140 | There is a set of quick toggles available at the quick double-press. 141 | 142 | #+BEGIN_QUOTE 143 | Package used: [[https://github.com/emacsorphanage/key-chord][key-chord]] 144 | #+END_QUOTE 145 | 146 | From the toggles menu: 147 | |------+------------------------------------------------------------------| 148 | | Keys | Action | 149 | |------+------------------------------------------------------------------| 150 | | l | Toggles line numbers in the current buffer | 151 | | w | Toggles word-wrap in the current buffer | 152 | | k | Toggles whether to kill line-endings when killing lines with ~C-k~ | 153 | | s | Toggles extra line-spacing in the current buffer | 154 | |------+------------------------------------------------------------------| 155 | 156 | *** Help with key-bindings 157 | 158 | Pausing in-between executing commands shows contextual help in the minibuffer for all possible next keystrokes that can be used at that time alongside their associated commands. 159 | 160 | #+BEGIN_QUOTE 161 | Package used: [[https://github.com/justbur/emacs-which-key][which-key]] 162 | #+END_QUOTE 163 | 164 | *** Zoning 165 | 166 | Calling the function ~zone-quotes-set-quotes~ and passing it a list of quotes displays a random quote one at a time while zoning. You can activate or deactivate zoning with the mentioned key bindings: 167 | 168 | #+BEGIN_QUOTE 169 | Package used: [[https://github.com/myTerminal/zone-quotes][zone-quotes]] 170 | #+END_QUOTE 171 | 172 | From the tools menu: 173 | |------+-----------------------------------------------| 174 | | Keys | Action | 175 | |------+-----------------------------------------------| 176 | | x | Disables zoning | 177 | | z | Enables zoning | 178 | |------+-----------------------------------------------| 179 | 180 | ** Text-editing 181 | 182 | *** Fonts 183 | 184 | Fonts for text and programming modes are different, more specifically Liberation Mono and Fira Code. Liberation Mono is easier to read regular text, while Fira code provides a few unique features that can be really helpful while writing and especially reading programs. One of the biggest of them is programming ligatures that combine two or more characters into a single symbol that is more easily identifiable in between other text. 185 | 186 | These fonts are also configurable using the file [[../.emacs.d/configs/variables.el][variables.el]]. 187 | 188 | #+BEGIN_QUOTE 189 | Package used: [[https://github.com/jming422/fira-code-mode][fira-code]] 190 | #+END_QUOTE 191 | 192 | *** Column numbers 193 | 194 | Just as the line number for the cursor position is displayed on the modeline, column numbers are displayed too. While editing files that follow a strict column limit, ~column-enforce-mode~ can be used. 195 | 196 | #+BEGIN_QUOTE 197 | Package used: [[https://github.com/jordonbiondo/column-enforce-mode][column-enforce-mode]] 198 | #+END_QUOTE 199 | 200 | *** Matching parentheses 201 | 202 | While typing text, all kinds of brackets (~(~, ~[~, and ~{~) and quotes (~'~, ~"~, and ~`~) are automatically closed. This is implemented using *electric-pairs* which is included with Emacs since the recent versions. 203 | 204 | Visual feedback is also while stepping on balanced and unbalanced brackets. 205 | 206 | *** Indenting with tabs 207 | 208 | Text indentation is only performed with spaces instead of tabs, and each indent is made up of four spaces. 209 | 210 | *** White spaces 211 | 212 | Leading and trailing white spaces can be highlighted in a buffer using ~outer-spaces-mode~. It is available under the toggles menu. 213 | 214 | #+BEGIN_QUOTE 215 | Package used: [[https://github.com/myTerminal/outer-spaces][outer-spaces]] 216 | #+END_QUOTE 217 | 218 | From the toggles menu: 219 | |-------+---------------------------| 220 | | Keys | Action | 221 | |-------+---------------------------| 222 | | SPACE | Toggles ~outer-spaces-mode~ | 223 | |-------+---------------------------| 224 | 225 | *** Searching and replacing text 226 | 227 | **** Interactive search 228 | 229 | Unlike a regular search that takes the cursor through the points of occurrences, *super-emacs* provides an interactive search using *swiper*. This feature starts with a list of all the lines of text in the current buffer, letting you type in your search criteria to narrow the list down. Selecting a search result takes you to the point of occurrence. 230 | 231 | #+BEGIN_QUOTE 232 | Package used: [[https://github.com/abo-abo/swiper][counsel]] 233 | #+END_QUOTE 234 | 235 | From the toggles menu: 236 | |-------+------------------------------------------------| 237 | | Keys | Action | 238 | |-------+------------------------------------------------| 239 | | C-c s | Starts ~swiper~ to provide an interactive search | 240 | |-------+------------------------------------------------| 241 | 242 | **** Interactive replace 243 | 244 | Replacing text is interactive too with the help of *anzu*, which displays the number of search results found for the current search criteria. Furthermore, while typing the new text to be used in place of searched term, it also displays the new text beside the old one for all occurrences in the buffer. 245 | 246 | #+BEGIN_QUOTE 247 | Package used: [[https://github.com/emacsorphanage/anzu][anzu]] 248 | #+END_QUOTE 249 | 250 | |------+-------------------------------------| 251 | | Keys | Action | 252 | |------+-------------------------------------| 253 | | M-% | Starts search and replace with *anzu* | 254 | |------+-------------------------------------| 255 | 256 | *** Autocomplete 257 | 258 | In most modes, a popup menu is presented at the position of the cursor when three or more characters are typed. The list contains auto-completion candidates matching the text that is being typed. This is achieved using *company-mode*. 259 | 260 | #+BEGIN_QUOTE 261 | Package used: [[https://github.com/company-mode/company-mode][company-mode]] 262 | #+END_QUOTE 263 | 264 | Out of the many features the package provides, a few basic ones include scrolling down the list of presented options and selecting one for completion. 265 | 266 | |------------+-----------------------------------------------| 267 | | Keys | Action | 268 | |------------+-----------------------------------------------| 269 | | TAB or RET | Chooses the only suggested completion | 270 | | M-p | Scrolls up the list of suggestions | 271 | | M-n | Scrolls down the list of suggestions | 272 | | RET | Chooses the selected suggestion from the list | 273 | |------------+-----------------------------------------------| 274 | 275 | *** Multiple cursors 276 | 277 | When editing text of repetitive nature, repeating the same edit multiple times can get tiring. For such a scenario, one can use *multiple-cursors* to literally spawn multiple cursors in the current buffer according to the selected pattern. Once started, all edits made to the current line are replicated to the other lines with the temporary cursors and pressing ~RET~ brings it back to the original cursor. 278 | 279 | #+BEGIN_QUOTE 280 | Package used: [[https://github.com/magnars/multiple-cursors.el][multiple-cursors]] 281 | #+END_QUOTE 282 | 283 | |------+------------------------------------------------------------------------------| 284 | | Keys | Action | 285 | |------+------------------------------------------------------------------------------| 286 | | C-} | Spawns an additional cursor for the next text matching the current selection | 287 | | C-{ | Spawns an additional cursor for previous text matching the current selection | 288 | | C-" | Spawns cursors for all text matching the current selection | 289 | |------+------------------------------------------------------------------------------| 290 | 291 | *** Deletion of selected text 292 | 293 | Unlike the regular Emacs behavior where when some text is selected and the user starts typing, the text starts getting inserted at the point of the cursor, clearing the selection, in *super-emacs* one can start typing over a selection to replace it with the text being typed. 294 | 295 | *** Undo tree 296 | 297 | Imagine being able to visualize a historical graph of your undo operations. *undo-tree* does just that by rendering a tree with nodes in another buffer, letting you move between the nodes. When you're done moving back/forward, pressing ~q~ takes it to the default condition. 298 | 299 | #+BEGIN_QUOTE 300 | Package used: [[https://github.com/emacsmirror/undo-tree][undo-tree]] 301 | #+END_QUOTE 302 | 303 | |--------------+-----------------------------------------------| 304 | | Keys | Action | 305 | |--------------+-----------------------------------------------| 306 | | C-\vert | Shows a graph of states in the current buffer | 307 | | | Move through the states | 308 | | q | Dismisses the undo tree | 309 | |--------------+-----------------------------------------------| 310 | 311 | Another quick way to access the kill ring while yanking text is to use *counsel*. 312 | 313 | #+BEGIN_QUOTE 314 | Package used: [[https://github.com/abo-abo/swiper][counsel]] 315 | #+END_QUOTE 316 | 317 | |------+-----------------------------------------| 318 | | Keys | Action | 319 | |------+-----------------------------------------| 320 | | M-y | Shows a list of items previously yanked | 321 | |------+-----------------------------------------| 322 | 323 | *** Spelling checks 324 | 325 | All text buffers are automatically checked for spelling. This is implemented with *ispell*, so if the external dependency *aspell* is installed, spellings will be automatically checked as you type. 326 | 327 | *** Working with colors 328 | 329 | When working with colors in a buffer, one can enable *rainbow-mode*, which will paint all text representing colors in their respective colors. 330 | 331 | #+BEGIN_QUOTE 332 | Package used: [[https://github.com/emacsmirror/rainbow-mode][rainbow-mode]] 333 | #+END_QUOTE 334 | 335 | *** Text snippets 336 | 337 | One can provide text snippets for text and programming constructs and use tab completion to save keystrokes. This has been implemented using *yasnippet*, so you may refer to the [[https://github.com/joaotavora/yasnippet][project's repo]] to know about its comprehensive usage documentation. The snippets should be placed in the directory ~~/.emacs.d/snippets~. 338 | 339 | #+BEGIN_QUOTE 340 | Package used: [[https://github.com/joaotavora/yasnippet][yasnippet]] 341 | #+END_QUOTE 342 | 343 | *** LaTex preview 344 | 345 | While working with LaTex documents, a live preview can be achieved right within Emacs using *latex-preview-pane*. 346 | 347 | #+BEGIN_QUOTE 348 | Package used: [[https://github.com/jsinglet/latex-preview-pane][latex-preview-pane]] 349 | #+END_QUOTE 350 | 351 | ** Navigation 352 | 353 | *** General buffer and window management 354 | 355 | With *counsel* in place, the regular commands to work with buffers and windows are significantly better. 356 | 357 | #+BEGIN_QUOTE 358 | Package used: [[https://github.com/abo-abo/swiper][counsel]] 359 | #+END_QUOTE 360 | 361 | |---------+--------------------------------------------------------------| 362 | | Keys | Action | 363 | |---------+--------------------------------------------------------------| 364 | | C-x b | Uses *ivy* to provide a list of buffers to switch to one from | 365 | | C-x C-f | Uses *counsel* to find a file | 366 | | C-x C-r | Uses *counsel* to look for a recent file | 367 | | C-c b | Uses *ivy* to push the current window layout as a buffer entry | 368 | |---------+--------------------------------------------------------------| 369 | 370 | *** Window layout history 371 | 372 | ~winner-mode~ allows moving back and forth between window layouts. 373 | 374 | |-------------+---------------------------------------| 375 | | Keys | Action | 376 | |-------------+---------------------------------------| 377 | | C-c | Moves back to previous windows layout | 378 | | C-c | Moves to the next windows layout | 379 | |-------------+---------------------------------------| 380 | 381 | *** Moving within the buffer, quickly 382 | 383 | One has at least three key bindings to quickly move around specific parts of a buffer using *avy*. 384 | 385 | #+BEGIN_QUOTE 386 | Package used: [[https://github.com/abo-abo/avy][avy]] 387 | #+END_QUOTE 388 | 389 | From the editing menu: 390 | |------+---------------------------------------------------| 391 | | Keys | Action | 392 | |------+---------------------------------------------------| 393 | | k | Jump to a specific character in the buffer | 394 | | j | Jump to a word starting with a specific character | 395 | | l | Jump to a specified line | 396 | | [ | Go back to where you started from | 397 | |------+---------------------------------------------------| 398 | 399 | *** Jumping between windows 400 | 401 | Quickly moving focus between windows has been implemented using *ace-window*. When invoked, it distributes numbers to all the visible windows across all open frames. As it goes without saying, pressing the number corresponding to a window takes focus to that window. 402 | 403 | #+BEGIN_QUOTE 404 | Package used: [[https://github.com/abo-abo/ace-window][ace-window]] 405 | #+END_QUOTE 406 | 407 | From the buffers & windows menu: 408 | |-----------+--------------------------------------------------| 409 | | Keys | Action | 410 | |-----------+--------------------------------------------------| 411 | | \ | Shows a menu of all visible windows with numbers | 412 | | S- | Moves to the window to the left | 413 | | S- | Moves to the window to the right | 414 | | S- | Moves to the window above | 415 | | S- | Moves to the window below | 416 | |-----------+--------------------------------------------------| 417 | 418 | *** Moving buffers around 419 | 420 | If you'd like to re-arrange buffers among windows, *buffer-move* can help do that fairly easily. 421 | 422 | #+BEGIN_QUOTE 423 | Package used: [[https://github.com/lukhas/buffer-move][buffer-move]] 424 | #+END_QUOTE 425 | 426 | From the buffers & windows menu: 427 | |-----------+----------------------------------------------| 428 | | Keys | Action | 429 | |-----------+----------------------------------------------| 430 | | M- | Swap buffer with the one in the left window | 431 | | M- | Swap buffer with the one in the right window | 432 | | M- | Swap buffer with the one in the window above | 433 | | M- | Swap buffer with the one in the window below | 434 | |-----------+----------------------------------------------| 435 | 436 | *** Resizing windows 437 | 438 | **** Manual 439 | 440 | If you'd like to resize windows without moving away from the keyboard, you can use *window-shaper*. 441 | 442 | #+BEGIN_QUOTE 443 | Package used: [[https://github.com/myTerminal/window-shaper][window-shaper]] 444 | #+END_QUOTE 445 | 446 | From the buffers & windows menu: 447 | |------+-----------------------------------------------------------------------------------------------------------------| 448 | | Keys | Action | 449 | |------+-----------------------------------------------------------------------------------------------------------------| 450 | | \under | Starts ~window-shaper-mode~ to allow resizing the current window vertically or horizontally using the scroll keys | 451 | |------+-----------------------------------------------------------------------------------------------------------------| 452 | 453 | **** Automatic 454 | 455 | There's also the ~golden-ratio-mode~ that resizes windows on focus. Every window you move focus to becomes larger than the rest. 456 | 457 | #+BEGIN_QUOTE 458 | Package used: [[https://github.com/roman/golden-ratio.el][golden-ratio]] 459 | #+END_QUOTE 460 | 461 | *** Workspaces 462 | 463 | Working with multiple workspaces is made possible using *perspective*. 464 | 465 | #+BEGIN_QUOTE 466 | Package used: [[https://github.com/nex3/perspective-el][perspective]] 467 | #+END_QUOTE 468 | 469 | |---------+-------------------------------------------| 470 | | Keys | Action | 471 | |---------+-------------------------------------------| 472 | | M-s | Switch to a named workspace or create one | 473 | | M-c | Close a specified workspace | 474 | | M-z C-s | Store all workspaces to disk | 475 | | M-z C-l | Load previously-stored workspace | 476 | |---------+-------------------------------------------| 477 | 478 | There are many more commands for you to explore. 479 | 480 | ** File system 481 | 482 | *** Directory tree 483 | 484 | A simple directory tree is available using *ztree*, and it allows to expand and collapse directories to view their contents. One can view a tree using the command ~ztree-dir~ and supplying a directory to start at. 485 | 486 | #+BEGIN_QUOTE 487 | Package used: [[https://github.com/fourier/ztree][ztree]] 488 | #+END_QUOTE 489 | 490 | From the tools menu: 491 | |------+----------------------------------------------| 492 | | Keys | Action | 493 | |------+----------------------------------------------| 494 | | . | Starts *ztree* at the specified directory | 495 | |------+----------------------------------------------| 496 | 497 | *** dired add-ons 498 | 499 | Dired has been supplemented with a set of three add-ons: *dired-narrow*, *dired-subtree*, and *dired-ranger*. One can access any of these from within a dired buffer. 500 | 501 | #+BEGIN_QUOTE 502 | Packages used: [[https://github.com/Fuco1/dired-narrow][dired-narrow]], [[https://github.com/Fuco1/dired-subtree][dired-subtree]], [[https://github.com/Fuco1/dired-ranger][dired-ranger]] 503 | #+END_QUOTE 504 | 505 | From a dired buffer: 506 | |-----------+---------------------------------------------------------------| 507 | | Keys | Action | 508 | |-----------+---------------------------------------------------------------| 509 | | \slash | Helps filter the directory listing | 510 | | ] | Toggles a subtree under the current item if it is a directory | 511 | | [ | Cycles a subtree through various expansion states | 512 | | C- | Navigates to the beginning of a subtree | 513 | | C- | Navigates to the end of a subtree | 514 | | C- | Navigates one level up from the subtree | 515 | | C- | Navigates one level down in the subtree | 516 | | M- | Navigates to the previous sibling in the subtree | 517 | | M- | Navigates to the next sibling in the subtree | 518 | | M- | Mark all items under the current subtree | 519 | | M- | Unmarks all items under the current subtree | 520 | | M-c | Mark the current selection for copy | 521 | | M-m | Move the previously selected items for copy | 522 | | M-v | Paste the previously selected items for copy | 523 | |-----------+---------------------------------------------------------------| 524 | 525 | ** Package sources 526 | 527 | *super-emacs* has been configured with three package sources in the following priority: 528 | 529 | |----------+----------------------------------| 530 | | Priority | Package archive | 531 | |----------+----------------------------------| 532 | | 1 | GNU ELPA | 533 | | 2 | MELPA Stable | 534 | | 3 | MELPA | 535 | |----------+----------------------------------| 536 | 537 | Even with this in place, packages are installed directly from [[https://github.com][GitHub]] using a package named *quelpa*. 538 | 539 | ** Projects 540 | 541 | *** Working with projects 542 | 543 | Using *projectile*, working with software projects is made easy with all IDE-like features right within Emacs. One can find files, search for text within all files, and do much more with a few easy-to-remember key bindings. 544 | 545 | Listing down all the features of a package like *projectile* would be beyond the scope of this document, so you are suggested to refer to its own official documentation. There are also a few external dependencies that can be installed in order to improve the functionality of *projectile*. 546 | 547 | #+BEGIN_QUOTE 548 | Packages used: [[https://github.com/bbatsov/projectile][projectile]], [[https://github.com/ericdanan/counsel-projectile][counsel-projectile]], [[https://github.com/myTerminal/projectile-extras][projectile-extras]] 549 | #+END_QUOTE 550 | 551 | |------+----------------------------| 552 | | Keys | Action | 553 | |------+----------------------------| 554 | | C-\ | Starts the *projectile* menu | 555 | |------+----------------------------| 556 | 557 | From editing menu: 558 | |------+-----------------------------------------------------------| 559 | | Keys | Action | 560 | |------+-----------------------------------------------------------| 561 | | s | Prompts for a text to search in the current project | 562 | | r | Searches for the term under cursor in the current project | 563 | |------+-----------------------------------------------------------| 564 | 565 | *** Supported languages 566 | 567 | Along with the other languages supported by default in Emacs, a few other packages have been installed to add (and sometimes improve) support for more languages. Some of them include *markdown-mode*, *web-mode* (for more than just HTML), *js2-mode* (as an improvement over the default JavaScript mode), *less-css-mode*, *scss-mode*, *sass-mode*, *yaml-mode*, *vue-mode*, *typescript-mode*, *rust-mode*, and *csharp-mode*. 568 | 569 | #+BEGIN_QUOTE 570 | Packages used: [[https://github.com/jrblevin/markdown-mode][markdown-mode]], [[https://github.com/fxbois/web-mode][web-mode]], [[https://github.com/mooz/js2-mode][js2-mode]], [[https://github.com/purcell/less-css-mode][less-css-mode]], [[https://github.com/antonj/scss-mode][scss-mode]], [[https://github.com/nex3/sass-mode][sass-mode]], [[https://github.com/yoshiki/yaml-mode][yaml-mode]], [[https://github.com/AdamNiederer/vue-mode][vue-mode]], [[https://github.com/emacs-typescript/typescript.el][typescript-mode]], [[https://github.com/rust-lang/rust-mode][rust-mode]], [[https://github.com/emacs-csharp/csharp-mode][csharp-mode]] 571 | #+END_QUOTE 572 | 573 | **** Common Lisp interface 574 | 575 | Specifically for Common Lisp, *slime* provides a development environment with a REPL and more. 576 | 577 | #+BEGIN_QUOTE 578 | Package used: [[https://github.com/slime/slime][slime]] 579 | #+END_QUOTE 580 | 581 | *** Programming tools 582 | 583 | **** Definitions and references 584 | 585 | A "dumb" alternative to *projectile* is *dumb-jump*, at least for jumping to references to symbols within a software project and returning back to its reference. 586 | 587 | #+BEGIN_QUOTE 588 | Package used: [[https://github.com/jacktasia/dumb-jump][dumb-jump]] 589 | #+END_QUOTE 590 | 591 | From the editing menu: 592 | |------+--------------------------------------------------------| 593 | | Keys | Action | 594 | |------+--------------------------------------------------------| 595 | | > | Jumps to the definition of the symbol under the cursor | 596 | | < | Returns back to the reference of the symbol | 597 | |------+--------------------------------------------------------| 598 | 599 | **** Working with language server 600 | 601 | For a better programming experience, *super-emacs* comes with *eglot*, a language server client that can connect to the language server for a particular language being worked on. *eglot* is another such package that has a massive list of features that you can learn about at its official documentation. 602 | 603 | Basically running ~eglot~ in a buffer lets you start a connection to the language server, if one is installed. 604 | 605 | #+BEGIN_QUOTE 606 | Package used: [[https://github.com/joaotavora/eglot][eglot]] 607 | #+END_QUOTE 608 | 609 | **** Quickrun 610 | 611 | When needing to evaluate snippets from a buffer, *quickrun* could be of help. It supports more than just evaluating expressions. 612 | 613 | #+BEGIN_QUOTE 614 | Package used: [[https://github.com/emacsorphanage/quickrun][quickrun]] 615 | #+END_QUOTE 616 | 617 | In a programming buffer: 618 | |-------+-----------------------------------------------------------------------------| 619 | | Keys | Action | 620 | |-------+-----------------------------------------------------------------------------| 621 | | C-c e | Evaluates the expression to the left of the cursor | 622 | | C-c r | Evaluates the selected region | 623 | | C-c t | Evaluates the selected region and replaces it with the result in the buffer | 624 | |-------+-----------------------------------------------------------------------------| 625 | 626 | **** Restclient 627 | 628 | *restclient* allows testing REST APIs from Emacs. One can edit requests on the left and see the results from the response on the right. 629 | 630 | #+BEGIN_QUOTE 631 | Package used: [[https://github.com/pashky/restclient.el][restclient]] 632 | #+END_QUOTE 633 | 634 | **** Live development 635 | 636 | *skewer-mode* provides live interaction with *JavaScript*, *CSS*, and *HTML* in a web browser. 637 | 638 | #+BEGIN_QUOTE 639 | Package used: [[https://github.com/skeeto/skewer-mode][skewer-mode]] 640 | #+END_QUOTE 641 | 642 | *** Source versioning 643 | 644 | **** Git interface 645 | 646 | *magit* provides a fully-featured text-based interface to *git*. The menus are very user-friendly, and you can do pretty much everything from a single command named ~magit-status~. 647 | 648 | #+BEGIN_QUOTE 649 | Package used: [[https://github.com/magit/magit][magit]] 650 | #+END_QUOTE 651 | 652 | |-------+-----------------------------------------------------------------------------------------------------| 653 | | Keys | Action | 654 | |-------+-----------------------------------------------------------------------------------------------------| 655 | | C-x g | Shows ~magit-status~ and waits for a command. Pressing ~h~ or ~?~ shows help around all possible commands | 656 | |-------+-----------------------------------------------------------------------------------------------------| 657 | 658 | **** Change highlights in buffers and dired buffers 659 | 660 | Information about file changes is displayed in the file buffer or within a dired buffer. This has been implemented using *diff-hl*, requiring no user interaction for basic features. 661 | 662 | #+BEGIN_QUOTE 663 | Package used: [[https://github.com/dgutov/diff-hl][diff-hl]] 664 | #+END_QUOTE 665 | 666 | ** Internet 667 | 668 | *** Email client 669 | 670 | *super-emacs* also comes with an email client: *mew*. Feel free to refer to the official documentation for information on how to configure it for your account and about usage. 671 | 672 | #+BEGIN_QUOTE 673 | Package used: [[https://github.com/kazu-yamamoto/Mew][mew]] 674 | #+END_QUOTE 675 | 676 | ** Statistical computing 677 | 678 | *super-emacs* provides access to statistical computing with *ess* and *polymode*. 679 | 680 | #+BEGIN_QUOTE 681 | Packages used: [[https://github.com/emacs-ess/ESS][ess]], [[https://github.com/polymode/polymode][polymode]], [[https://github.com/polymode/poly-R][poly-R]], [[https://github.com/polymode/poly-markdown][poly-markdown]] 682 | #+END_QUOTE 683 | 684 | ** Large language models 685 | 686 | *super-emacs* has an integration with large language models that you can interact with in quite a lot of ways. 687 | 688 | #+BEGIN_QUOTE 689 | Packages used: [[https://github.com/s-kostyaev/ellama][ellama]] 690 | #+END_QUOTE 691 | 692 | From tools menu: 693 | 694 | |------+-----------------------------| 695 | | Keys | Action | 696 | |------+-----------------------------| 697 | | ? | Starts a chat with Ellama | 698 | | l | Prompt for an Ellama action | 699 | |------+-----------------------------| 700 | 701 | ** Misc 702 | 703 | *** Auto-save and backup 704 | 705 | Automatic backups are disabled so that your directories are no polluted with temporary files ending with a "~". 706 | 707 | *** Informative startup screen 708 | 709 | The startup screen displays some useful information about the current Emacs version, date, active config file, etc. 710 | 711 | The following actions are available on the startup screen: 712 | 713 | |------+---------------------------------------------------------------| 714 | | Keys | Action | 715 | |------+---------------------------------------------------------------| 716 | | z | Shows a prompt to load a previously saved ~perspective~ session | 717 | | ? | Starts a chat with Ellama | 718 | | q | Dismisses the startup screen | 719 | |------+---------------------------------------------------------------| 720 | 721 | *** Interaction with hardware 722 | 723 | **** Battery information 724 | 725 | For portable machines with a battery as a power source, the current remaining battery level is displayed in the modeline. 726 | 727 | **** Sound volume 728 | 729 | With the right sound volume backend, the volume level can be controlled using *volume.el*. 730 | 731 | #+BEGIN_QUOTE 732 | Package used: [[https://github.com/dbrock/volume.el][volume]] 733 | #+END_QUOTE 734 | 735 | *** Other miscellaneous tweaks 736 | 737 | There are the following minor tweaks: 738 | 739 | |---------------+-------------------------------------------------------------------------------------| 740 | | Keys | Action | 741 | |---------------+-------------------------------------------------------------------------------------| 742 | | C-c p | Switches to the previously viewed buffer | 743 | | C-x k | Kills the current buffer instead of prompting from a list | 744 | | M- | Moves the current line down a position | 745 | | M- | Moves the current line up a position | 746 | | C- | Deletes the word to the left of the cursor instead of killing it into the kill-ring | 747 | | C-= | Evaluates the expression to the left and replaces it with the result | 748 | |---------------+-------------------------------------------------------------------------------------| 749 | 750 | From tools menu: 751 | |------+-----------------------------------------| 752 | | Keys | Action | 753 | |------+-----------------------------------------| 754 | | \slash | Starts a terminal in the current window | 755 | | i | Prompts to connect to IRC | 756 | |------+-----------------------------------------| 757 | 758 | From editing menu: 759 | |------+----------------------------------------| 760 | | Keys | Action | 761 | |------+----------------------------------------| 762 | | f | Reloads the file in the current buffer | 763 | |------+----------------------------------------| 764 | 765 | From buffers & windows menu: 766 | |------+----------------------------------------------------| 767 | | Keys | Action | 768 | |------+----------------------------------------------------| 769 | | + | Toggles split direction of current pair of windows | 770 | |------+----------------------------------------------------| 771 | 772 | ** More... 773 | 774 | There are a lot of other minor tweaks that *super-emacs* comes with in order to make a complete system. 775 | 776 | * Configured key-bindings 777 | 778 | * Customizing 779 | 780 | The recommended way to customize *super-emacs* is to place your custom configuration scripts under [[../.emacs.d/configs/basic-custom.el]] and [[../.emacs.d/configs/standard-custom.el]] for text and graphical modes respectively. Configuration files will be loaded in the correct order so that your custom configuration will override the ones from *super-emacs*. This way, whenever there's an update to the original file, there will be no merge conflicts and life would be so much simpler! 781 | 782 | There are also variables in [[./..emacs.d/configs/variables.el]] that you can customize to alter certain things in *super-emacs*. 783 | 784 | * FAQs 785 | 786 | (coming soon...) 787 | 788 | # Local Variables: 789 | # eval: (visual-line-mode 1) 790 | # End: 791 | -------------------------------------------------------------------------------- /setup: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | project_remote_url="https://github.com/myTerminal/super-emacs.git" 4 | project_dir_name=".super-emacs" 5 | user_home_dir=$(cd "/home/$USER"; pwd -P) 6 | emacs_dir_old=$user_home_dir/.emacs.d 7 | emacs_dir_new=$user_home_dir/.config/emacs 8 | 9 | # Determine the platform and target directory 10 | platform=$(uname) 11 | if [ $platform = 'Linux' ]; then 12 | base_dir=$user_home_dir 13 | project_dir=$base_dir/$project_dir_name 14 | install_dir=$user_home_dir/.emacs.d 15 | elif [ $platform = 'Darwin' ]; then 16 | # TODO: Implement 17 | echo "macOS found." 18 | else 19 | # TODO: Implement 20 | echo "Unknown OS!" 21 | fi 22 | 23 | # Clone the git project at the appropriate path 24 | git clone $project_remote_url $project_dir 25 | 26 | # Check for existing Emacs config 27 | if [ -d $emacs_dir_old ] || [ -d $emacs_dir_new ]; then 28 | echo "Emacs config found. Setting up super-emacs will replace it. Are you sure? (y/n)?" 29 | read -n1 -r -p "> " temp_user_response 30 | if [ $temp_user_response == "y" ] || [ $temp_user_response == "Y" ]; then 31 | echo -e "\nExisting Emacs config removed." 32 | rm -rf $emacs_dir_old $emacs_dir_new 33 | else 34 | echo -e "\nSetup has ended without changes to your Emacs config." 35 | exit 0 36 | fi 37 | fi 38 | 39 | # Link Emacs directory to project directory 40 | echo "Creating links to super-emacs..." 41 | ln -s $project_dir/.emacs.d $emacs_dir_new 42 | ln -s $project_dir/.emacs.d $emacs_dir_old 43 | 44 | # Fetch crater-cli for temporary use 45 | git clone https://github.com/crater-space/cli /tmp/crater-cli 46 | 47 | # Install dependencies: fonts 48 | echo "Installing font Liberation..." 49 | mkdir -p ~/.local/share/fonts 50 | mkdir ~/_temp 51 | ( cd ~/_temp; wget https://github.com/liberationfonts/liberation-fonts/files/6418984/liberation-fonts-ttf-2.1.4.tar.gz; tar -xvf liberation-fonts-ttf-2.1.4.tar.gz ) 52 | mkdir ~/.local/share/fonts/Liberation 53 | mv ~/_temp/liberation-fonts-ttf-2.1.4/Liberation* ~/.local/share/fonts/Liberation/ 54 | rm -rf ~/_temp 55 | 56 | # Install dependencies: aspell 57 | echo "Install aspell for spell-check?" 58 | read -n1 -r -p "> " temp_user_response 59 | if [ $temp_user_response == "y" ] || [ $temp_user_response == "Y" ]; then 60 | /tmp/crater-cli/crater install aspell 61 | fi 62 | 63 | # Install dependencies: R 64 | echo "Install R for statistical computing?" 65 | read -n1 -r -p "> " temp_user_response 66 | if [ $temp_user_response == "y" ] || [ $temp_user_response == "Y" ]; then 67 | /tmp/crater-cli/crater install r 68 | fi 69 | 70 | # Remove temporary crater-cli 71 | rm -rf /tmp/crater-cli 72 | 73 | echo "Setup for super-emacs has ended." 74 | --------------------------------------------------------------------------------