diff options
| author | JackJ30 <jackqjamison@proton.me> | 2025-01-20 15:26:20 -0500 |
|---|---|---|
| committer | JackJ30 <jackqjamison@proton.me> | 2025-01-20 15:26:20 -0500 |
| commit | 726577cdd1ea4a3ae72358c46fef5f5ed5ea1491 (patch) | |
| tree | ff5555f0ad2531989f9d41ae742cb7c90863cbfc /.config | |
| parent | 768cf868eba6f8e3c236adb4d4969d6cc5ebae15 (diff) | |
big improvements
Diffstat (limited to '.config')
| -rw-r--r-- | .config/emacs/custom.el | 13 | ||||
| -rw-r--r-- | .config/emacs/init.el | 13 | ||||
| -rw-r--r-- | .config/emacs/settings.org | 283 |
3 files changed, 191 insertions, 118 deletions
diff --git a/.config/emacs/custom.el b/.config/emacs/custom.el new file mode 100644 index 0000000..d07408a --- /dev/null +++ b/.config/emacs/custom.el @@ -0,0 +1,13 @@ +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(package-selected-packages + '(nerd-icons-dired nerd-icons-corfu nerd-icons-completion nerd-icons dired-subtree yasnippet-snippets vertico rainbow-delimiters projectile orderless no-littering multiple-cursors marginalia magit lsp-ui glsl-mode flycheck expand-region evil-nerd-commenter embark-consult dracula-theme doom-themes diminish corfu color-identifiers-mode))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 5df6fab..2f567a3 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -3,16 +3,3 @@ (org-babel-load-file (expand-file-name "settings.org" user-emacs-directory)) -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(package-selected-packages - '(projectile embark-consult embark multiple-cursors diminish evil-nerd-commenter expand-region flycheck color-identifiers-mode consult doom-themes lsp-ui lsp-mode rainbow-delimiters yasnippet-snippets markdown-mode yasnippet no-littering vertico orderless marginalia vc-use-package miasma-theme kind-icon dracula-theme corfu))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - ) diff --git a/.config/emacs/settings.org b/.config/emacs/settings.org index bca450f..52a9b3f 100644 --- a/.config/emacs/settings.org +++ b/.config/emacs/settings.org @@ -1,4 +1,10 @@ -* Garbage Collection Improvement +* Initialization +** Customize in different file +#+BEGIN_SRC emacs-lisp + (setq custom-file (locate-user-emacs-file "custom.el")) + (load custom-file :no-error-if-file-is-missing) +#+END_SRC +** Garbage Collection Improvement #+BEGIN_SRC emacs-lisp (defun my-minibuffer-setup-hook () (setq gc-cons-threshold most-positive-fixnum)) @@ -15,25 +21,31 @@ (gc-idle-timer) #+END_SRC - -* Use Package +** Packages #+BEGIN_SRC emacs-lisp + ;; package lists (require 'package) (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) (package-initialize) - (unless (package-installed-p 'use-package) - (package-refresh-contents) - (package-install 'use-package)) - (eval-and-compile - (setq use-package-always-ensure t - use-package-expand-minimally t)) - (eval-when-compile (require 'use-package)) - + ;; use package + (when (< emacs-major-version 29) + (unless (package-installed-p 'use-package) + (unless package-archive-contents + (package-refresh-contents)) + (package-install 'use-package))) + + ;; remove stupid warnings + (add-to-list 'display-buffer-alist + '("\\`\\*\\(Warnings\\|Compile-Log\\)\\*\\'" + (display-buffer-no-window) + (allow-no-window . t))) + #+END_SRC -* Basic behaviours +* Basic changes +** Behaviour #+BEGIN_SRC emacs-lisp (use-package no-littering) @@ -46,128 +58,203 @@ (setq inhibit-startup-message t backup-inhibited t) - (setf dired-kill-when-opening-new-dired-buffer t) - (setq dired-listing-switches "-alh --group-directories-first") - (setq dired-dwim-target t) - #+END_SRC -* Basic UI Improvements +** UI #+BEGIN_SRC emacs-lisp - + (scroll-bar-mode -1) (tool-bar-mode -1) (tooltip-mode -1) (menu-bar-mode -1) + (column-number-mode +1) + (global-display-line-numbers-mode t) + (setq-default fill-column 80) + + (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) + (add-to-list 'default-frame-alist '(alpha . (90 . 90))) + +#+END_SRC +** Text Editing +#+BEGIN_SRC emacs-lisp + (use-package delsel + :ensure nil ; no need to install it as it is built-in + :hook (after-init . delete-selection-mode)) + + ;; scrolling (setq scroll-up-aggressively nil scroll-down-aggressively nil scroll-conservatively 101 display-line-numbers-type t) - (setq scroll-step 1) (setq scroll-margin 8) + (global-set-key (kbd "M-n") 'scroll-up-line) + (global-set-key (kbd "M-p") 'scroll-down-line) - (column-number-mode +1) - (global-display-line-numbers-mode t) - (setq-default fill-column 80) - + ;; electric pair (electric-pair-mode +1) - (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) - (add-to-list 'default-frame-alist '(alpha . (90 . 90))) + ;; improved C-g dwim + (defun prot/keyboard-quit-dwim () + (interactive) + (cond + ((region-active-p) + (keyboard-quit)) + ((derived-mode-p 'completion-list-mode) + (delete-completion-window)) + ((> (minibuffer-depth) 0) + (abort-recursive-edit)) + (t + (keyboard-quit)))) + (define-key global-map (kbd "C-g") #'prot/keyboard-quit-dwim) - (global-set-key (kbd "M-n") 'scroll-up-line) - (global-set-key (kbd "M-p") 'scroll-down-line) + (use-package expand-region + :bind("C-=" . er/expand-region)) + + (use-package multiple-cursors + :bind (:map global-map + ("C->" . 'mc/mark-next-like-this) + ("C-<" . 'mc/mark-previous-like-this) + ("C-c C->" . 'mc/mark-all-like-this) + :map mc/keymap + ("<return>" . nil))) + + (use-package evil-nerd-commenter + :bind ("M-;" . evilnc-comment-or-uncomment-lines)) #+END_SRC -* Diminish +** DIRED #+BEGIN_SRC emacs-lisp - (use-package diminish - :diminish flymake-mode - :diminish flycheck-mode - :diminish eldoc-mode) + (use-package dired + :ensure nil + :commands (dired) + :hook + ((dired-mode . dired-hide-details-mode) + (dired-mode . hl-line-mode)) + :config + (setq dired-recursive-copies 'always) + (setq dired-recursive-deletes 'always) + (setq dired-dwim-target t) + (setq dired-kill-when-opening-new-dired-buffer t) + (setq dired-listing-switches "-alh --group-directories-first")) + + (use-package dired-subtree + :ensure t + :after dired + :bind + ( :map dired-mode-map + ("<tab>" . dired-subtree-toggle) + ("TAB" . dired-subtree-toggle) + ("<backtab>" . dired-subtree-remove) + ("S-TAB" . dired-subtree-remove)) + :config + (setq dired-subtree-use-backgrounds nil)) +#+END_SRC +* Style +** Fonts +#+BEGIN_SRC emacs-lisp + (let ((mono-spaced-font "Monospace") + (proportionately-spaced-font "Sans")) + (set-face-attribute 'default nil :family mono-spaced-font :height 100) + (set-face-attribute 'fixed-pitch nil :family mono-spaced-font :height 1.0) + (set-face-attribute 'variable-pitch nil :family proportionately-spaced-font :height 1.0)) #+END_SRC -* Themeing +** Themes #+BEGIN_SRC emacs-lisp (use-package doom-themes - :config - (setq doom-themes-enable-bold t - doom-themes-enable-italic t) - (doom-themes-org-config)) + :config + (setq doom-themes-enable-bold t + doom-themes-enable-italic t) + (doom-themes-org-config)) - ;; load both themes lol (load-theme 'doom-dracula t) - (enable-theme 'sonokai) - - (set-face-attribute 'default nil - :font "DejaVu Sans Mono" - :family "Monospace" - :height 97) - (set-face-attribute 'variable-pitch nil - :font "DejaVu Sans" - :height 97) - (set-face-attribute 'fixed-pitch nil - :font "DejaVu Sans Mono" - :family "Monospace" - :height 97) - #+END_SRC +** Icons +#+BEGIN_SRC emacs-lisp + (use-package nerd-icons + :ensure t) + +(use-package nerd-icons-completion + :ensure t + :after marginalia + :config + (add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup)) + +(use-package nerd-icons-corfu + :ensure t + :after corfu + :config + (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter)) +(use-package nerd-icons-dired + :ensure t + :hook + (dired-mode . nerd-icons-dired-mode)) +#+END_SRC +** Diminish +#+BEGIN_SRC emacs-lisp + (use-package diminish + :diminish flymake-mode + :diminish flycheck-mode + :diminish eldoc-mode) +#+END_SRC * Completion #+BEGIN_SRC emacs-lisp (use-package vertico - :custom - (vertico-count 15) - :diminish vertico-mode - :bind (:map vertico-map - ("C-n" . vertico-next) - ("C-p" . vertico-previous)) - :init - (vertico-mode t)) + :custom + (vertico-count 15) + :diminish vertico-mode + :bind (:map vertico-map + ("C-n" . vertico-next) + ("C-p" . vertico-previous)) + :init + (vertico-mode t)) (use-package vertico-directory - :after vertico - :ensure nil - ;; More convenient directory navigation commands - :bind (:map vertico-map - ("RET" . vertico-directory-enter) - ("DEL" . vertico-directory-delete-char) - ("M-DEL" . vertico-directory-delete-word))) + :after vertico + :ensure nil + ;; More convenient directory navigation commands + :bind (:map vertico-map + ("RET" . vertico-directory-enter) + ("DEL" . vertico-directory-delete-char) + ("M-DEL" . vertico-directory-delete-word))) (use-package consult - :custom - ;; Disable preview - (consult-preview-key nil) - :bind - (("C-x b" . 'consult-buffer) ;; Switch buffer, including recentf and bookmarks - ("M-l" . 'consult-git-grep) ;; Search inside a project - ("M-y" . 'consult-yank-pop) ;; Paste by selecting the kill-ring - ("M-s" . 'consult-line) ;; Search current buffer, like swiper - ("C-c i" . 'consult-imenu) ;; Search the imenu - )) + :custom + ;; Disable preview + (consult-preview-key nil) + :bind + (("C-x b" . 'consult-buffer) ;; Switch buffer, including recentf and bookmarks + ("M-l" . 'consult-git-grep) ;; Search inside a project + ("M-y" . 'consult-yank-pop) ;; Paste by selecting the kill-ring + ("M-s" . 'consult-line) ;; Search current buffer, like swiper + ("C-c i" . 'consult-imenu) ;; Search the imenu + )) (use-package marginalia - :after vertico - :custom - (marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil)) - :config - (marginalia-mode)) + :after vertico + :custom + (marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil)) + :config + (marginalia-mode)) (use-package orderless - :config - (setq completion-styles '(orderless partial-completion basic) + :config + (setq completion-styles '(orderless partial-completion basic) completion-category-defaults nil completion-category-overrides '((file (styles . (partial-completion)))))) (use-package embark - :bind - (("C-." . embark-act) ;; Begin the embark process - ("C-;" . embark-dwim) ;; good alternative: M-. - ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings' - :config - (use-package embark-consult)) - + :bind + (("C-." . embark-act) ;; Begin the embark process + ("C-;" . embark-dwim) ;; good alternative: M-. + ("C-h B" . embark-bindings)) ;; alternative for `describe-bindings' + :config + (use-package embark-consult)) + (use-package savehist + :ensure nil ; it is built-in + :hook (after-init . savehist-mode)) #+END_SRC @@ -339,20 +426,6 @@ #+END_SRC ** Util and Keybinds #+BEGIN_SRC emacs-lisp - (use-package expand-region - :bind("C-=" . er/expand-region)) - - (use-package multiple-cursors - :bind (:map global-map - ("C->" . 'mc/mark-next-like-this) - ("C-<" . 'mc/mark-previous-like-this) - ("C-c C->" . 'mc/mark-all-like-this) - :map mc/keymap - ("<return>" . nil))) - - (use-package evil-nerd-commenter - :bind ("M-;" . evilnc-comment-or-uncomment-lines)) - (global-set-key (kbd "C-c e") 'consult-flymake) (global-set-key (kbd "C-c f") 'ff-find-other-file) |
