diff options
| -rw-r--r-- | aliases | 2 | ||||
| -rw-r--r-- | black-theme.el | 306 | ||||
| -rw-r--r-- | config.org | 520 | ||||
| -rw-r--r-- | early-init.el | 1 | ||||
| -rw-r--r-- | init.el | 4 | ||||
| -rw-r--r-- | profile | 0 |
6 files changed, 833 insertions, 0 deletions
@@ -0,0 +1,2 @@ +alias ff find-file $1 +alias less view-file $1
\ No newline at end of file diff --git a/black-theme.el b/black-theme.el new file mode 100644 index 0000000..31928d9 --- /dev/null +++ b/black-theme.el @@ -0,0 +1,306 @@ +;;; black-theme.el --- Theme + +;; Copyright (C) 2026 , + +;; Author: +;; Version: 0.1 +;; Package-Requires: ((emacs "24.1")) +;; Created with ThemeCreator, https://github.com/mswift42/themecreator. + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <http://www.gnu.org/licenses/>. + +;; This file is not part of Emacs. + +;;; Commentary: +;;; black theme created by in 2026 + +;;; Code: + +(deftheme black) +(let ((class '((class color) (min-colors 89))) + (fg1 "#c0c0c0") + (fg2 "#b1b1b1") + (fg3 "#a1a1a1") + (fg4 "#929292") + (fg6 "#cfcfcf") + (bg1 "#000000") + (bg2 "#141414") + (bg3 "#292929") + (bg4 "#3d3d3d") + (builtin "#2eaaa0") + (keyword "#a855b5") + (const "#50d0c8") + (comment "#555555") + (func "#4a7eba") + (str "#52b352") + (type "#d4a017") + (var "#c0c0c0") + (selection "#333333") + (warning "#e05252") + (warning2 "#ff7070") + (unspec (when (>= emacs-major-version 29) 'unspecified))) + (custom-theme-set-faces + 'black + `(default ((,class (:background ,bg1 :foreground ,fg1)))) + `(font-lock-builtin-face ((,class (:foreground ,builtin)))) + `(font-lock-comment-face ((,class (:foreground ,comment)))) + `(font-lock-negation-char-face ((,class (:foreground ,const)))) + `(font-lock-reference-face ((,class (:foreground ,const)))) + `(font-lock-constant-face ((,class (:foreground ,const)))) + `(font-lock-doc-face ((,class (:foreground ,comment)))) + `(font-lock-function-name-face ((,class (:foreground ,func )))) + `(font-lock-keyword-face ((,class (:bold ,class :foreground ,keyword)))) + `(font-lock-string-face ((,class (:foreground ,str)))) + `(font-lock-type-face ((,class (:foreground ,type )))) + `(font-lock-variable-name-face ((,class (:foreground ,var)))) + `(font-lock-warning-face ((,class (:foreground ,warning :background ,bg2)))) + `(term-color-black ((,class (:foreground ,fg2 :background ,unspec)))) + ;; `(region ((,class (:background ,fg1 :foreground ,bg1)))) + `(region ((,class (:background ,selection)))) + `(highlight ((,class (:foreground ,fg3 :background ,bg3)))) + `(hl-line ((,class (:background ,bg2)))) + `(fringe ((,class (:background ,bg2 :foreground ,fg4)))) + `(cursor ((,class (:background ,fg4)))) + `(isearch ((,class (:bold t :foreground ,warning :background ,bg3)))) + `(mode-line ((,class (:box (:line-width 1 :color nil) :bold t :foreground ,fg4 :background ,bg2)))) + `(mode-line-inactive ((,class (:box (:line-width 1 :color nil :style pressed-button) :foreground ,var :background ,bg1 :weight normal)))) + `(mode-line-buffer-id ((,class (:bold t :foreground ,func :background ,unspec)))) + `(mode-line-highlight ((,class (:foreground ,keyword :box nil :weight bold)))) + `(mode-line-emphasis ((,class (:foreground ,fg1)))) + `(vertical-border ((,class (:foreground ,fg3)))) + `(minibuffer-prompt ((,class (:bold t :foreground ,keyword)))) + `(default-italic ((,class (:italic t)))) + `(link ((,class (:foreground ,const :underline t)))) + `(org-code ((,class (:foreground ,fg2)))) + `(org-hide ((,class (:foreground ,fg4)))) + `(org-level-1 ((,class (:bold t :foreground ,fg2 :height 1.1)))) + `(org-level-2 ((,class (:bold nil :foreground ,fg3)))) + `(org-level-3 ((,class (:bold t :foreground ,fg4)))) + `(org-level-4 ((,class (:bold nil :foreground ,bg4)))) + `(org-date ((,class (:underline t :foreground ,var) ))) + `(org-footnote ((,class (:underline t :foreground ,fg4)))) + `(org-link ((,class (:underline t :foreground ,type )))) + `(org-special-keyword ((,class (:foreground ,func)))) + `(org-block ((,class (:foreground ,fg3)))) + `(org-quote ((,class (:inherit org-block :slant italic)))) + `(org-verse ((,class (:inherit org-block :slant italic)))) + `(org-todo ((,class (:box (:line-width 1 :color ,fg3) :foreground ,keyword :bold t)))) + `(org-done ((,class (:box (:line-width 1 :color ,bg3) :bold t :foreground ,bg4)))) + `(org-warning ((,class (:underline t :foreground ,warning)))) + `(org-agenda-structure ((,class (:weight bold :foreground ,fg3 :box (:color ,fg4) :background ,bg3)))) + `(org-agenda-date ((,class (:foreground ,var :height 1.1 )))) + `(org-agenda-date-weekend ((,class (:weight normal :foreground ,fg4)))) + `(org-agenda-date-today ((,class (:weight bold :foreground ,keyword :height 1.4)))) + `(org-agenda-done ((,class (:foreground ,bg4)))) + `(org-scheduled ((,class (:foreground ,type)))) + `(org-scheduled-today ((,class (:foreground ,func :weight bold :height 1.2)))) + `(org-ellipsis ((,class (:foreground ,builtin)))) + `(org-verbatim ((,class (:foreground ,fg4)))) + `(org-document-info-keyword ((,class (:foreground ,func)))) + `(font-latex-bold-face ((,class (:foreground ,type)))) + `(font-latex-italic-face ((,class (:foreground ,var :italic t)))) + `(font-latex-string-face ((,class (:foreground ,str)))) + `(font-latex-match-reference-keywords ((,class (:foreground ,const)))) + `(font-latex-match-variable-keywords ((,class (:foreground ,var)))) + `(ido-only-match ((,class (:foreground ,warning)))) + `(org-sexp-date ((,class (:foreground ,fg4)))) + `(ido-first-match ((,class (:foreground ,keyword :bold t)))) + `(ivy-current-match ((,class (:foreground ,fg3 :inherit highlight :underline t)))) + `(gnus-header-content ((,class (:foreground ,keyword)))) + `(gnus-header-from ((,class (:foreground ,var)))) + `(gnus-header-name ((,class (:foreground ,type)))) + `(gnus-header-subject ((,class (:foreground ,func :bold t)))) + `(mu4e-view-url-number-face ((,class (:foreground ,type)))) + `(mu4e-cited-1-face ((,class (:foreground ,fg2)))) + `(mu4e-cited-7-face ((,class (:foreground ,fg3)))) + `(mu4e-header-marks-face ((,class (:foreground ,type)))) + `(ffap ((,class (:foreground ,fg4)))) + `(js2-private-function-call ((,class (:foreground ,const)))) + `(js2-jsdoc-html-tag-delimiter ((,class (:foreground ,str)))) + `(js2-jsdoc-html-tag-name ((,class (:foreground ,var)))) + `(js2-external-variable ((,class (:foreground ,type )))) + `(js2-function-param ((,class (:foreground ,const)))) + `(js2-jsdoc-value ((,class (:foreground ,str)))) + `(js2-private-member ((,class (:foreground ,fg3)))) + `(js3-warning-face ((,class (:underline ,keyword)))) + `(js3-error-face ((,class (:underline ,warning)))) + `(js3-external-variable-face ((,class (:foreground ,var)))) + `(js3-function-param-face ((,class (:foreground ,fg2)))) + `(js3-jsdoc-tag-face ((,class (:foreground ,keyword)))) + `(js3-instance-member-face ((,class (:foreground ,const)))) + `(warning ((,class (:foreground ,warning)))) + `(ac-completion-face ((,class (:underline t :foreground ,keyword)))) + `(info-quoted-name ((,class (:foreground ,builtin)))) + `(info-string ((,class (:foreground ,str)))) + `(icompletep-determined ((,class :foreground ,builtin))) + `(undo-tree-visualizer-current-face ((,class :foreground ,builtin))) + `(undo-tree-visualizer-default-face ((,class :foreground ,fg2))) + `(undo-tree-visualizer-unmodified-face ((,class :foreground ,var))) + `(undo-tree-visualizer-register-face ((,class :foreground ,type))) + `(slime-repl-inputed-output-face ((,class (:foreground ,type)))) + `(trailing-whitespace ((,class :foreground ,unspec :background ,warning))) + `(rainbow-delimiters-depth-1-face ((,class :foreground ,fg1))) + `(rainbow-delimiters-depth-2-face ((,class :foreground ,type))) + `(rainbow-delimiters-depth-3-face ((,class :foreground ,var))) + `(rainbow-delimiters-depth-4-face ((,class :foreground ,const))) + `(rainbow-delimiters-depth-5-face ((,class :foreground ,keyword))) + `(rainbow-delimiters-depth-6-face ((,class :foreground ,fg1))) + `(rainbow-delimiters-depth-7-face ((,class :foreground ,type))) + `(rainbow-delimiters-depth-8-face ((,class :foreground ,var))) + `(magit-item-highlight ((,class :background ,bg3))) + `(magit-section-heading ((,class (:foreground ,keyword :weight bold)))) + `(magit-hunk-heading ((,class (:background ,bg3)))) + `(magit-section-highlight ((,class (:background ,bg2)))) + `(magit-hunk-heading-highlight ((,class (:background ,bg3)))) + `(magit-diff-context-highlight ((,class (:background ,bg3 :foreground ,fg3)))) + `(magit-diffstat-added ((,class (:foreground ,type)))) + `(magit-diffstat-removed ((,class (:foreground ,var)))) + `(magit-process-ok ((,class (:foreground ,func :weight bold)))) + `(magit-process-ng ((,class (:foreground ,warning :weight bold)))) + `(magit-branch ((,class (:foreground ,const :weight bold)))) + `(magit-log-author ((,class (:foreground ,fg3)))) + `(magit-hash ((,class (:foreground ,fg2)))) + `(magit-diff-file-header ((,class (:foreground ,fg2 :background ,bg3)))) + `(lazy-highlight ((,class (:foreground ,fg2 :background ,bg3)))) + `(term ((,class (:foreground ,fg1 :background ,bg1)))) + `(term-color-black ((,class (:foreground ,bg3 :background ,bg3)))) + `(term-color-blue ((,class (:foreground ,func :background ,func)))) + `(term-color-red ((,class (:foreground ,keyword :background ,bg3)))) + `(term-color-green ((,class (:foreground ,type :background ,bg3)))) + `(term-color-yellow ((,class (:foreground ,var :background ,var)))) + `(term-color-magenta ((,class (:foreground ,builtin :background ,builtin)))) + `(term-color-cyan ((,class (:foreground ,str :background ,str)))) + `(term-color-white ((,class (:foreground ,fg2 :background ,fg2)))) + `(rainbow-delimiters-unmatched-face ((,class :foreground ,warning))) + `(helm-header ((,class (:foreground ,fg2 :background ,bg1 :underline nil :box nil)))) + `(helm-source-header ((,class (:foreground ,keyword :background ,bg1 :underline nil :weight bold)))) + `(helm-selection ((,class (:background ,bg2 :underline nil)))) + `(helm-selection-line ((,class (:background ,bg2)))) + `(helm-visible-mark ((,class (:foreground ,bg1 :background ,bg3)))) + `(helm-candidate-number ((,class (:foreground ,bg1 :background ,fg1)))) + `(helm-separator ((,class (:foreground ,type :background ,bg1)))) + `(helm-time-zone-current ((,class (:foreground ,builtin :background ,bg1)))) + `(helm-time-zone-home ((,class (:foreground ,type :background ,bg1)))) + `(helm-buffer-not-saved ((,class (:foreground ,type :background ,bg1)))) + `(helm-buffer-process ((,class (:foreground ,builtin :background ,bg1)))) + `(helm-buffer-saved-out ((,class (:foreground ,fg1 :background ,bg1)))) + `(helm-buffer-size ((,class (:foreground ,fg1 :background ,bg1)))) + `(helm-ff-directory ((,class (:foreground ,func :background ,bg1 :weight bold)))) + `(helm-ff-file ((,class (:foreground ,fg1 :background ,bg1 :weight normal)))) + `(helm-ff-executable ((,class (:foreground ,var :background ,bg1 :weight normal)))) + `(helm-ff-invalid-symlink ((,class (:foreground ,warning2 :background ,bg1 :weight bold)))) + `(helm-ff-symlink ((,class (:foreground ,keyword :background ,bg1 :weight bold)))) + `(helm-ff-prefix ((,class (:foreground ,bg1 :background ,keyword :weight normal)))) + `(helm-grep-cmd-line ((,class (:foreground ,fg1 :background ,bg1)))) + `(helm-grep-file ((,class (:foreground ,fg1 :background ,bg1)))) + `(helm-grep-finish ((,class (:foreground ,fg2 :background ,bg1)))) + `(helm-grep-lineno ((,class (:foreground ,fg1 :background ,bg1)))) + `(helm-grep-match ((,class (:foreground ,unspec :background ,unspec :inherit helm-match)))) + `(helm-grep-running ((,class (:foreground ,func :background ,bg1)))) + `(helm-moccur-buffer ((,class (:foreground ,func :background ,bg1)))) + `(helm-source-go-package-godoc-description ((,class (:foreground ,str)))) + `(helm-bookmark-w3m ((,class (:foreground ,type)))) + `(company-echo-common ((,class (:foreground ,bg1 :background ,fg1)))) + `(company-preview ((,class (:background ,bg1 :foreground ,var)))) + `(company-preview-common ((,class (:foreground ,bg2 :foreground ,fg3)))) + `(company-preview-search ((,class (:foreground ,type :background ,bg1)))) + `(company-scrollbar-bg ((,class (:background ,bg3)))) + `(company-scrollbar-fg ((,class (:foreground ,keyword)))) + `(company-tooltip ((,class (:foreground ,fg2 :background ,bg2 :bold t)))) + `(company-tooltop-annotation ((,class (:foreground ,const)))) + `(company-tooltip-common ((,class ( :foreground ,fg3)))) + `(company-tooltip-common-selection ((,class (:foreground ,str)))) + `(company-tooltip-mouse ((,class (:inherit highlight)))) + `(company-tooltip-selection ((,class (:background ,bg3 :foreground ,fg3)))) + `(company-template-field ((,class (:inherit region)))) + `(web-mode-builtin-face ((,class (:inherit ,font-lock-builtin-face)))) + `(web-mode-comment-face ((,class (:inherit ,font-lock-comment-face)))) + `(web-mode-constant-face ((,class (:inherit ,font-lock-constant-face)))) + `(web-mode-keyword-face ((,class (:foreground ,keyword)))) + `(web-mode-doctype-face ((,class (:inherit ,font-lock-comment-face)))) + `(web-mode-function-name-face ((,class (:inherit ,font-lock-function-name-face)))) + `(web-mode-string-face ((,class (:foreground ,str)))) + `(web-mode-type-face ((,class (:inherit ,font-lock-type-face)))) + `(web-mode-html-attr-name-face ((,class (:foreground ,func)))) + `(web-mode-html-attr-value-face ((,class (:foreground ,keyword)))) + `(web-mode-warning-face ((,class (:inherit ,font-lock-warning-face)))) + `(web-mode-html-tag-face ((,class (:foreground ,builtin)))) + `(jde-java-font-lock-package-face ((t (:foreground ,var)))) + `(jde-java-font-lock-public-face ((t (:foreground ,keyword)))) + `(jde-java-font-lock-private-face ((t (:foreground ,keyword)))) + `(jde-java-font-lock-constant-face ((t (:foreground ,const)))) + `(jde-java-font-lock-modifier-face ((t (:foreground ,fg2)))) + `(jde-jave-font-lock-protected-face ((t (:foreground ,keyword)))) + `(jde-java-font-lock-number-face ((t (:foreground ,var)))) + `(yas-field-highlight-face ((t (:background ,selection))))) + ;; Legacy + (if (< emacs-major-version 22) + (custom-theme-set-faces + 'black + `(show-paren-match-face ((,class (:background ,warning))))) ;; obsoleted in 22.1, removed 2016 + (custom-theme-set-faces + 'black + `(show-paren-match ((,class (:foreground ,bg1 :background ,str)))) + `(show-paren-mismatch ((,class (:foreground ,bg1 :background ,warning)))))) + ;; emacs >= 26.1 + (when (>= emacs-major-version 26) + (custom-theme-set-faces + 'black + `(line-number ((t (:inherit fringe)))) + `(line-number-current-line ((t (:inherit fringe :foreground ,fg6 :weight bold)))))) + + ;; emacs >= 27.1 + (when (>= emacs-major-version 27) + (custom-theme-set-faces + 'black + `(tab-line ((,class (:background ,bg2 :foreground ,fg4)))) + `(tab-line-tab ((,class (:inherit tab-line)))) + `(tab-line-tab-inactive ((,class (:background ,bg2 :foreground ,fg4)))) + `(tab-line-tab-current ((,class (:background ,bg1 :foreground ,fg1)))) + `(tab-line-highlight ((,class (:background ,bg1 :foreground ,fg2)))))) + (when (>= emacs-major-version 28) + (custom-theme-set-faces + 'black + `(line-number ((t (:inherit fringe)))) + `(line-number-current-line ((t (:inherit fringe :foreground ,fg6 :weight bold)))))) +;; emacs >= 27.1 +(when (>= emacs-major-version 27) + (custom-theme-set-faces + 'black + `(tab-line ((,class (:background ,bg2 :foreground ,fg4)))) + `(tab-line-tab ((,class (:inherit tab-line)))) + `(tab-line-tab-inactive ((,class (:background ,bg2 :foreground ,fg4)))) + `(tab-line-tab-current ((,class (:background ,bg1 :foreground ,fg1)))) + `(tab-line-highlight ((,class (:background ,bg1 :foreground ,fg2)))))) + (when (>= emacs-major-version 28) + (custom-theme-set-faces + 'black + `(tab-line-tab-modified ((,class (:foreground ,warning2 :weight bold)))))) + (when (boundp 'font-lock-regexp-face) + (custom-theme-set-faces + 'black + `(font-lock-regexp-face ((,class (:inherit font-lock-string-face :underline t))))))) + +;;;###autoload +(when load-file-name + (add-to-list 'custom-theme-load-path + (file-name-as-directory (file-name-directory load-file-name)))) + +(provide-theme 'black) + +;; Local Variables: +;; no-byte-compile: t +;; End: + +;;; black-theme.el ends here diff --git a/config.org b/config.org new file mode 100644 index 0000000..70cbd9f --- /dev/null +++ b/config.org @@ -0,0 +1,520 @@ +#+TITLE: Cori's GNU Emacs Config +#+AUTHOR: Cori Barker +#+DESCRIPTION: Cori's personal Emacs config. +#+STARTUP: showeverything +#+OPTIONS: toc:2 + +* TABLE OF CONTENTS :toc: +- [[#important-programs-to-load-first][IMPORTANT PROGRAMS TO LOAD FIRST]] + - [[#elpaca-package-manager][Elpaca Package Manager]] + - [[#load-evil-mode][Load Evil Mode]] + - [[#general-keybindings][General Keybindings]] +- [[#all-the-icons][ALL THE ICONS]] +- [[#fonts][FONTS]] + - [[#setting-the-font-face][Setting The Font Face]] + - [[#zooming-inout][Zooming In/Out]] +- [[#gui-tweaks][GUI TWEAKS]] + - [[#disable-menubar-toolbars-and-scrollbars][Disable Menubar, Toolbars and Scrollbars]] + - [[#display-line-numbers-and-disable-truncated-lines][Display Line Numbers and Disable Truncated Lines]] +- [[#org-mode][ORG MODE]] + - [[#enabling-table-of-contents][Enabling Table of Contents]] + - [[#enabling-org-bullets][Enabling Org Bullets]] + - [[#source-code-block-tag-expansion][Source Code Block Tag Expansion]] +- [[#sudo-edit][SUDO EDIT]] +- [[#which-key][WHICH-KEY]] +- [[#ivy-counsel][IVY (COUNSEL)]] + +* IMPORTANT PROGRAMS TO LOAD FIRST +** Elpaca Package Manager +#+begin_src emacs-lisp + (defvar elpaca-installer-version 0.12) + (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) + (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) + (defvar elpaca-sources-directory (expand-file-name "sources/" elpaca-directory)) + (defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" + :ref nil :depth 1 :inherit ignore + :files (:defaults "elpaca-test.el" (:exclude "extensions")) + :build (:not elpaca-activate))) + (let* ((repo (expand-file-name "elpaca/" elpaca-sources-directory)) + (build (expand-file-name "elpaca/" elpaca-builds-directory)) + (order (cdr elpaca-order)) + (default-directory repo)) + (add-to-list 'load-path (if (file-exists-p build) build repo)) + (unless (file-exists-p repo) + (make-directory repo t) + (when (<= emacs-major-version 28) (require 'subr-x)) + (condition-case-unless-debug err + (if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) + ((zerop (apply #'call-process `("git" nil ,buffer t "clone" + ,@(when-let* ((depth (plist-get order :depth))) + (list (format "--depth=%d" depth) "--no-single-branch")) + ,(plist-get order :repo) ,repo)))) + ((zerop (call-process "git" nil buffer t "checkout" + (or (plist-get order :ref) "--")))) + (emacs (concat invocation-directory invocation-name)) + ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" + "--eval" "(byte-recompile-directory \".\" 0 'force)"))) + ((require 'elpaca)) + ((elpaca-generate-autoloads "elpaca" repo))) + (progn (message "%s" (buffer-string)) (kill-buffer buffer)) + (error "%s" (with-current-buffer buffer (buffer-string)))) + ((error) (warn "%s" err) (delete-directory repo 'recursive)))) + (unless (require 'elpaca-autoloads nil t) + (require 'elpaca) + (elpaca-generate-autoloads "elpaca" repo) + (let ((load-source-file-function nil)) (load "./elpaca-autoloads")))) + (add-hook 'after-init-hook #'elpaca-process-queues) + (elpaca `(,@elpaca-order)) +#+end_src + +** Load Evil Mode +#+begin_src emacs-lisp + ;; Install a package via the elpaca macro + ;; See the "recipes" section of the manual for more details. + + ;; (elpaca example-package) + + ;; Install use-package support + (elpaca elpaca-use-package + ;; Enable use-package :ensure support for Elpaca. + (elpaca-use-package-mode) + (setq use-package-always-ensure t)) + + ;;When installing a package used in the init file itself, + ;;e.g. a package which adds a use-package key word, + ;;use the :wait recipe keyword to block until that package is installed/configured. + ;;For example: + ;;(use-package general :ensure (:wait t) :demand t) + + ;; Expands to: (elpaca evil (use-package evil :demand t)) + (use-package evil + :ensure t + :init + (setq evil-want-integration t) + (setq evil-want-keybinding nil) + (setq evil-vsplit-window-right t) + (setq evil-split-window-below t) + (evil-mode)) + (use-package evil-collection + :ensure t + :after evil + :config + (setq evil-collection-mode-list '(dashboard dired ibuffer)) + (evil-collection-init)) + (use-package evil-tutor :ensure t) + + ;;Turns off elpaca-use-package-mode current declaration + ;;Note this will cause evaluate the declaration immediately. It is not deferred. + ;;Useful for configuring built-in emacs features. + (use-package emacs :ensure nil :config (setq ring-bell-function #'ignore)) +#+end_src + +** General Keybindings +#+begin_src emacs-lisp + (use-package general + :ensure t + :config + (general-evil-setup) + + ;; setup SPACE as the global leader key + (general-create-definer cb/leader-keys + :states '(normal insert visual emacs) + :keymaps 'override + :prefix "SPC" ;; set leader + :global-prefix "M-SPC") ;; access leader in insert mode + + (cb/leader-keys + "." '(find-file :wk "Find file") + "fc" '((lambda () (interactive) (find-file "~/.config/emacs/config.org")) :wk "Edit emacs config") + "fr" '(counsel-recentf :wk "Find recent files") + "TAB TAB" '(comment-line :wk "Comment lines")) + + (cb/leader-keys + "b" '(:ignore t :wk "Buffer") + "bb" '(switch-to-buffer :wk "Switch buffer") + "bi" '(ibuffer :wk "Ibuffer") + "bk" '(kill-this-buffer :wk "Kill this buffer") + "bn" '(next-buffer :wk "Next buffer") + "bp" '(previous-buffer :wk "Previous buffer") + "br" '(revert-buffer :wk "Reload buffer")) + + (cb/leader-keys + "e" '(:ignore t :wk "Eshell/Evaluate") + "eb" '(eval-buffer :wk "Evaluate elisp in buffer") + "ed" '(eval-defun :wk "Evaluate defun containing or after point") + "ee" '(eval-expression :wk "Evaluate elisp expression") + "el" '(eval-last-sexp :wk "Evaluate elisp expression before point") + "er" '(eval-region :wk "Evaluate elisp in region") + "es" '(eshell :wk "Eshell") + "eh" '(counsel-esh-history :wk "Eshell history")) + + (cb/leader-keys + "h" '(:ignore t :wk "Help") + "hf" '(describe-function :wk "Describe function") + "hv" '(describe-variable :wk "Describe variable") + "hrr" '((lambda () (interactive) (load-file "~/.config/emacs/init.el")) :wk "Reload emacs config")) + + (cb/leader-keys + "t" '(:ignore t :wk "Toggle") + "tl" '(display-line-numbers-mode :wk "Toggle line numbers") + "tt" '(visual-line-mode :wk "Toggle truncated lines") + "tv" '(vterm-toggle :wk "Toggle vterm")) + + (cb/leader-keys + "w" '(:ignore t :wk "Windows") + ;; Window splits + "wc" '(evil-window-delete :wk "Close window") + "wn" '(evil-window-new :wk "New window") + "ws" '(evil-window-split :wk "Horizontal split window") + "wv" '(evil-window-vsplit :wk "Vertical split window") + ;; Window motions + "wh" '(evil-window-left :wk "Window left") + "wj" '(evil-window-down :wk "Window down") + "wk" '(evil-window-up :wk "Window up") + "wl" '(evil-window-right :wk "Window right") + "ww" '(evil-window-next :wk "Goto next window") + ;; Move windows + "wH" '(buf-move-left :wk "Buffer move left") + "wJ" '(buf-move down :wk "Buffer move down") + "wK" '(buf-move-up :wk "Buffer move up") + "wL" '(buf-move-right :wk "Buffer move right")) + ) +#+end_src + +* ALL THE ICONS +#+begin_src emacs-lisp + (use-package all-the-icons + :ensure t + :defer t + :hook (server-after-make-frame . (lambda () + (when (display-graphic-p) + (require 'all-the-icons))))) + + (use-package all-the-icons-dired + :ensure t + :hook (dired-mode . (lambda () (all-the-icons-dired-mode t)))) +#+end_src + +* BUFFER MOVE +#+begin_src emacs-lisp +(require 'windmove) + +;;;###autoload +(defun buf-move-up () + "Swap the current buffer and the buffer above the split. +If there is no split, ie now window above the current one, an +error is signaled." +;; "Switches between the current buffer, and the buffer above the +;; split, if possible." + (interactive) + (let* ((other-win (windmove-find-other-window 'up)) + (buf-this-buf (window-buffer (selected-window)))) + (if (null other-win) + (error "No window above this one") + ;; swap top with this one + (set-window-buffer (selected-window) (window-buffer other-win)) + ;; move this one to top + (set-window-buffer other-win buf-this-buf) + (select-window other-win)))) + +;;;###autoload +(defun buf-move-down () +"Swap the current buffer and the buffer under the split. +If there is no split, ie now window under the current one, an +error is signaled." + (interactive) + (let* ((other-win (windmove-find-other-window 'down)) + (buf-this-buf (window-buffer (selected-window)))) + (if (or (null other-win) + (string-match "^ \\*Minibuf" (buffer-name (window-buffer other-win)))) + (error "No window under this one") + ;; swap top with this one + (set-window-buffer (selected-window) (window-buffer other-win)) + ;; move this one to top + (set-window-buffer other-win buf-this-buf) + (select-window other-win)))) + +;;;###autoload +(defun buf-move-left () +"Swap the current buffer and the buffer on the left of the split. +If there is no split, ie now window on the left of the current +one, an error is signaled." + (interactive) + (let* ((other-win (windmove-find-other-window 'left)) + (buf-this-buf (window-buffer (selected-window)))) + (if (null other-win) + (error "No left split") + ;; swap top with this one + (set-window-buffer (selected-window) (window-buffer other-win)) + ;; move this one to top + (set-window-buffer other-win buf-this-buf) + (select-window other-win)))) + +;;;###autoload +(defun buf-move-right () +"Swap the current buffer and the buffer on the right of the split. +If there is no split, ie now window on the right of the current +one, an error is signaled." + (interactive) + (let* ((other-win (windmove-find-other-window 'right)) + (buf-this-buf (window-buffer (selected-window)))) + (if (null other-win) + (error "No right split") + ;; swap top with this one + (set-window-buffer (selected-window) (window-buffer other-win)) + ;; move this one to top + (set-window-buffer other-win buf-this-buf) + (select-window other-win)))) +#+end_src + +* FONTS +** Setting The Font Face +Defining the fonts that Emacs will use. +#+begin_src emacs-lisp + (defun cb/set-fonts () + (set-face-attribute 'default nil + :font "FiraMono Nerd Font" + :height 100 + :weight 'medium) + (set-face-attribute 'variable-pitch nil + :font "Hack" + :height 110 + :weight 'medium) + (set-face-attribute 'fixed-pitch nil + :font "FiraMono Nerd Font" + :height 100 + :weight 'medium)) + + (add-hook 'after-make-frame-functions + (lambda (frame) + (with-selected-frame frame + (cb/set-fonts)))) + + (add-to-list 'default-frame-alist '(font . "FiraMono Nerd Font-11")) + (setq-default line-spacing 0.12) +#+end_src + +** Zooming In/Out +#+begin_src emacs-lisp + (global-set-key (kbd "C-=") 'text-scale-increase) + (global-set-key (kbd "C--") 'text-scale-decrease) + (global-set-key (kbd "<C-wheel-up>") 'text-scale-increase) + (global-set-key (kbd "<C-wheel-down>") 'text-scale-decrease) +#+end_src + +* GUI TWEAKS +Make GNU Emacs look better. + +** Disable Menubar, Toolbars and Scrollbars +#+begin_src emacs-lisp + (menu-bar-mode -1) + (tool-bar-mode -1) + (scroll-bar-mode -1) +#+end_src + +** Display Line Numbers and Disable Truncated Lines +#+begin_src emacs-lisp + (global-display-line-numbers-mode 1) + (global-visual-line-mode -1) +#+end_src + +* ORG MODE +** Enabling Table of Contents +#+begin_src emacs-lisp + (use-package toc-org + :ensure t + :commands toc-org-enable + :init (add-hook 'org-mode-hook 'toc-org-enable)) +#+end_src + +** Enabling Org Bullets +#+begin_src emacs-lisp + (add-hook 'org-mode-hook 'org-indent-mode) + (use-package org-bullets :ensure t) + (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))) +#+end_src + +** Source Code Block Tag Expansion +Type "<s" followed by TAB to expand to a begin_src tag. +#+begin_src emacs-lisp + (require 'org-tempo) +#+end_src + +* SHELLS AND TERMINALS +** Eshell +#+begin_src emacs-lisp + (use-package eshell-syntax-highlighting + :ensure t + :after esh-mode + :config + (eshell-syntax-highlighting-global-mode +1)) + + (setq eshell-rc-script (concat user-emacs-directory "eshell/profile") + eshell-aliases-file (concat user-emacs-directory "eshell/aliases") + eshell-history-size 5000 + eshell-buffer-maximum-lines 5000 + eshell-hist-ignoredups t + eshell-scroll-to-bottom-on-input t + eshell-destroy-buffer-when-process-dies t + eshell-visual-commands '("bash" "fish" "htop" "ssh" "top" "zsh")) +#+end_src + +** Vterm +#+begin_src emacs-lisp + (use-package vterm + :ensure t + :config + (setq shell-file-name "/bin/bash" + vterm-max-scrollback 5000)) +#+end_src + +** Vterm-Toggle +#+begin_src emacs-lisp + (use-package vterm-toggle + :ensure t + :after vterm + :config + (setq vterm-toggle-fullscreen-p nil) + (setq vterm-toggle-scope 'project) + (add-to-list 'display-buffer-alist + '((lambda (buffer-or-name _) + (let ((buffer (get-buffer buffer-or-name))) + (with-current-buffer buffer + (or (equal major-mode 'vterm-mode) + (string-prefix-p vterm-buffer-name (buffer-name buffer)))))) + (display-buffer-reuse-window display-buffer-at-bottom) + (reusable-frames . visible) + (window-height . 0.3)))) +#+end_src + +* RAINBOW MODE +#+begin_src emacs-lisp + (use-package rainbow-mode + :ensure t + :hook org-mode prog-mode) +#+end_src + +* SUDO EDIT +#+begin_src emacs-lisp + (use-package sudo-edit + :ensure t + :config + (cb/leader-keys + "fu" '(sudo-edit-find-file :wk "Sudo find file") + "fU" '(sudo-edit :wk "Sudo edit file"))) +#+end_src + +* THEME +#+begin_src emacs-lisp + (add-to-list 'custom-theme-load-path "~/.config/emacs/themes/") + (load-theme 'black t) +#+end_src + +* PDF TOOLS + +#+begin_src emacs-lisp + (use-package pdf-tools + :ensure t + :defer t + :magic ("%PDF" . pdf-view-mode) + :config (pdf-tools-install :no-query)) +#+end_src + +* AUCTEX +#+begin_src emacs-lisp + (use-package auctex + :ensure t + :defer t + :hook + (LaTeX-mode . LaTeX-math-mode) + (LaTeX-mode . flyspell-mode) + (LaTeX-mode . visual-line-mode) + :custom + (TeX-auto-save t) + (TeX-parse-self t) + (TeX-save-query nil) + (TeX-PDF-mode t) + (TeX-source-correlate-mode t) + (TeX-source-correlate-method 'synctex) + (TeX-view-program-selection '((output-pdf "Zathura"))) + (TeX-view-program-list '(("Zathura" "zathura --synctex-forward %n:0:%b %o")))) + + ;; CDLaTeX — fast math input with tab completion + (use-package cdlatex + :ensure t + :hook (LaTeX-mode . cdlatex-mode)) + +(use-package preview-latex + :ensure nil + :hook (LaTeX-mode . LaTeX-preview-setup) + :custom + (preview-auto-cache-preamble t) + (preview-image-type 'svg)) + + (use-package company-auctex + :ensure t + :hook (LaTeX-mode . company-auctex-init)) +#+end_src + + +* WHICH-KEY +#+begin_src emacs-lisp + (use-package which-key + :ensure t + :init + (which-key-mode 1) + :config + (setq which-key-side-window-location 'bottom + which-key-sort-order #'which-key-key-order-alpha + which-key-sort-uppercase-first nil + which-key-add-column-padding 1 + which-key-max-display-columns nil + which-key-min-display-lines 6 + which-key-side-window-slot -10 + which-key-side-window-max-height 0.25 + which-key-idle-delay 0.8 + which-key-max-description-length 25 + which-key-allow-imprecise-window-fit t + which-key-seperator " → " )) +#+end_src + +* IVY (COUNSEL) ++ Ivy, a generic completion mechanism for Emacs. ++ Counsel, a collection of Ivy-enhanced versions of common Emacs commands. ++ Ivy-rich allows you to add descriptions alongside the commands in M-x. + +#+begin_src emacs-lisp + (use-package counsel + :ensure t + :after ivy + :config (counsel-mode)) + + (use-package ivy + :ensure t + :bind + ;; ivy-resume resumes the last Ivy-based completion. + (("C-c C-r" . ivy-resume) + ("C-x B" . ivy-switch-buffer-other-window)) + :custom + (setq ivy-use-virtual-buffers t) + (setq ivy-count-format "(%d/%d) ") + (setq enable-recursive-minibuffers t) + :config + (ivy-mode)) + + (use-package all-the-icons-ivy-rich + :ensure t + :init (all-the-icons-ivy-rich-mode 1)) + + (use-package ivy-rich + :ensure t + :after ivy + :init (ivy-rich-mode 1) + :custom + (ivy-virtual-abbreviate 'full + ivy-rich-switch-buffer-align-virtual-buffer t + ivy-rich-path-style 'abbrev) + :config + (ivy-set-display-transformer 'ivy-switch-buffer + 'ivt-rich-switch-buffer-transformer)) +#+end_src diff --git a/early-init.el b/early-init.el new file mode 100644 index 0000000..512068a --- /dev/null +++ b/early-init.el @@ -0,0 +1 @@ +(setq package-enable-at-startup nil) @@ -0,0 +1,4 @@ +(org-babel-load-file + (expand-file-name + "config.org" + user-emacs-directory)) |
