diff --git a/thoom-emacs/TODO.org b/thoom-emacs/TODO.org index 2357767..7a2a635 100644 --- a/thoom-emacs/TODO.org +++ b/thoom-emacs/TODO.org @@ -10,7 +10,7 @@ Can remap functions as well as keys (use-package unfill :bind ([remap fill-paragraph] . unfill-toggle)) #+end_src -** Supports repeat-map +** use-package supports repeat-map #+begin_src emacs-lisp (use-package git-gutter+ :bind @@ -22,6 +22,10 @@ Can remap functions as well as keys #+end_src ** shortdoc-display-group shows useful documentation summary on various categories of things +* High Priority +** persist scratch buffer +*** scratch keybind +** separate system clipboard and kill ring * mine for ideas https://github.com/daviwil/emacs-from-scratch/blob/9388cf6ecd9b44c430867a5c3dad5f050fdc0ee1/Emacs.org https://tony-zorman.com/posts/2022-10-22-emacs-potpourri.html @@ -33,75 +37,72 @@ https://www.reddit.com/r/emacs/comments/x43eie/heres_a_list_of_emacs_keyboard_sh better bindings for page up / page down / home / end center cursor after page up / page down https://karthinks.com/software/more-less-emacs/#bonus-half-screen-scrolling -** org-evil bindings -M-hjlk for moving headings -** meow -*** equivalent of gd/gu (use embark?) -*** disable completing-read for meow-visit -*** equivalent of r (replace character under point, don't enter insert mode) -*** equivalent of . for repeating edits -*** learn kmacros -ability to scrape recent history for new macro -** try alternatives to meow -*** boon -*** xah-fly-keys -*** god-mode -*** kakoune.el -*** back to evil +*** previous/next buffer ** dired https://github.com/alexluigit/dirvish *** toggle hidden files * read docs/configure -** magit +** when opening help buffer, focus it so I can q out ** eshell https://www.masteringemacs.org/article/complete-guide-mastering-eshell https://github.com/iostapyshyn/eshell-vterm ** tramp *** multi-hop -specifically ssh -> ssh -> docker +specifically ssh -> docker https://github.com/emacs-pe/docker-tramp.el https://www.emacswiki.org/emacs/TrampAndDocker ** whitespace cleanup https://batsov.com/articles/2011/11/25/emacs-tip-number-3-whitespace-cleanup/ -** straight -*** lockfile -** corfu -https://takeonrules.com/2022/01/17/switching-from-company-to-corfu-for-emacs-completion/ ** embark https://karthinks.com/software/fifteen-ways-to-use-embark/ -*** better binding for moving org subtrees -*** tagging org header -** vertico ** avy +https://karthinks.com/software/avy-can-do-anything/ +** xref +*** dumb-jump + +** yasnippet +** undo-tree +** vertico +** mwim ** marginalia +** treesit-auto + https://github.com/renzmann/treesit-auto ** orderless ** consult ** corfu -https://www.youtube.com/watch?v=Vx0bSKF4y78 +** cape +https://takeonrules.com/2022/01/17/switching-from-company-to-corfu-for-emacs-completion/ +*** complete files and lines ** org -*** C-RET should enter meow insert state -*** TAB should cycle sub-folds *** TAB should cycle when at end of folded header line *** keybind for narrow *** switch to use-package repeat-map for C-c C-n/p - +*** better binds for moving subtrees *** transclude https://github.com/nobiot/org-transclusion +*** roam *** beautify +https://zzamboni.org/post/beautifying-org-mode-in-emacs/ https://mstempl.netlify.app/post/beautify-org-mode/ https://github.com/Gavinok/emacs.d/blob/main/lisp/org-config.el https://github.com/minad/org-modern **** hide markup characters **** org-modern -** see if multiple-cursors works with meow at all +** magit +*** Fix magit invisible changes in terminal +** lsp-mode +*** lsp-booster +https://github.com/blahgeek/emacs-lsp-booster ** code folding -** symex -** rigpa -https://github.com/countvajhula/rigpa -* modeline -** diminish/delight +*** outli +** combobulate +** emacs-chrome +https://github.com/stsquad/emacs_chrome +** devdocs +https://github.com/astoff/devdocs.el +** vundo +https://github.com/casouri/vundo * port doom config.el -** set font to Fira Code ** reveal in finder #+begin_src emacs-lisp (defun first-executable (candidates) @@ -113,45 +114,17 @@ https://github.com/countvajhula/rigpa (call-process (first-executable '("xdg-open" "open")) nil nil nil ".")) - -(map! :leader - :desc "Reveal" - "o o" #'reveal-in-file-browser) #+end_src - * line wrapping https://elpa.gnu.org/packages/adaptive-wrap.html -* Fix magit invisible changes in terminal -* when opening help buffer, focus it so I can q out -* Deconflict Emacs and Kitty hotkeys * if nix in path, prefer nix versions of emacs packages don't use :straight t in use-package declarations instead, have section that conditionally runs straight-use-package directives if necessary -* install -** yasnippet/tempo -** mwim -** undo-tree -** parinfer -** eglot / lsp-mode * languages ** python +** rust ** nix https://github.com/elkowar/rnix-lsp -** typescript -** web-mode -* meow -** questions -*** Why does xy copy the newline but x;y doesn't? -*** Beacon mode -How does beacon mode decide whether a movement creates all possible cursors or just one? -How to express "insert before the second word of the line"? -Why doesn't visit work consistently in beacon mode? -*** defining C- keys in normal mode seems to fuck everything up for some reason -** sexp state -** try dot mode -https://github.com/wyrickre/dot-mode -** notes -*** r replaces selection with yank buffer * Notes from Mastering Emacs ** C-x # in emacsclient says "done with current buffer" ** C-x 8 RET (insert-char) for to insert weird characters diff --git a/thoom-emacs/init.el b/thoom-emacs/init.el index b945868..64d462a 100644 --- a/thoom-emacs/init.el +++ b/thoom-emacs/init.el @@ -1,4 +1,3 @@ - (defvar thoom/dir (file-name-directory load-file-name) "The root dir of the Thoom Emacs distribution.") (defvar thoom/modules-dir (expand-file-name "modules" thoom/dir) @@ -10,16 +9,13 @@ ;; Elpaca package manager (require 'thoom-elpaca) +;; OS-specific tweaks (require 'thoom-os) +;; Vertico, Embark, Corfu, etc (require 'thoom-completion) +;; Emacs appearance (require 'thoom-theme) (require 'thoom-tweaks) - -(use-package magit - :after seq - :ensure t - :custom (magit-save-repository-buffers 'dontask) - :bind (("C-x g" . magit-status) - :map magit-mode-map - (":" . execute-extended-command) - ("x" . magit-discard))) +(require 'thoom-org) +(require 'thoom-lisp) +(require 'thoom-git) diff --git a/thoom-emacs/modules/thoom-completion.el b/thoom-emacs/modules/thoom-completion.el index 3d0c569..80671a2 100644 --- a/thoom-emacs/modules/thoom-completion.el +++ b/thoom-emacs/modules/thoom-completion.el @@ -40,11 +40,9 @@ ;; Enable automatic preview at point in the *Completions* buffer. This is ;; relevant when you use the default completion UI. - :hook (completion-list-mode . consult-preview-at-point-mode) + ;; :hook (completion-list-mode . consult-preview-at-point-mode) - ;; The :init configuration is always executed (Not lazy) :init - ;; Optionally configure the register formatting. This improves the register ;; preview for `consult-register', `consult-register-load', ;; `consult-register-store' and the Emacs built-ins. @@ -59,29 +57,16 @@ (setq xref-show-xrefs-function #'consult-xref xref-show-definitions-function #'consult-xref) - ;; Configure other variables and modes in the :config section, - ;; after lazily loading the package. :config - - ;; Optionally configure preview. The default value - ;; is 'any, such that any key triggers the preview. - ;; (setq consult-preview-key 'any) - ;; (setq consult-preview-key (kbd "M-.")) - ;; (setq consult-preview-key (list (kbd "") (kbd ""))) ;; For some commands and buffer sources it is useful to configure the ;; :preview-key on a per-command basis using the `consult-customize' macro. (consult-customize consult-theme - :preview-key '(:debounce 0.2 any) + :preview-key '(:debounce 0.5 'any) consult-ripgrep consult-git-grep consult-grep consult-bookmark consult-recent-file consult-xref consult--source-bookmark consult--source-recent-file - consult--source-project-recent-file - ) - - ;; Optionally configure the narrowing key. - ;; Both < and C-+ work reasonably well. -) + consult--source-project-recent-file)) (use-package embark :ensure t @@ -98,9 +83,9 @@ :config ;; Hide the mode line of the Embark live/completions buffers (add-to-list 'display-buffer-alist - '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*") - nil - (window-parameters (mode-line-format . none)))) + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) ;; Consult users will also want the embark-consult package. (use-package embark-consult diff --git a/thoom-emacs/modules/thoom-git.el b/thoom-emacs/modules/thoom-git.el new file mode 100644 index 0000000..ce86518 --- /dev/null +++ b/thoom-emacs/modules/thoom-git.el @@ -0,0 +1,10 @@ +(provide 'thoom-git) + +(use-package magit + :after seq + :ensure t + :custom (magit-save-repository-buffers 'dontask) + :bind (("C-x g" . magit-status) + :map magit-mode-map + (":" . execute-extended-command) + ("x" . magit-discard))) diff --git a/thoom-emacs/modules/thoom-lisp.el b/thoom-emacs/modules/thoom-lisp.el new file mode 100644 index 0000000..c6c26e1 --- /dev/null +++ b/thoom-emacs/modules/thoom-lisp.el @@ -0,0 +1,15 @@ +(provide 'thoom-lisp) + +(use-package parinfer-rust-mode + ;; The latest version of parinfer-rust-mode is incompatible with x86 Macs, so fall back on an earlier commit + :ensure (:host github :repo "justinbarclay/parinfer-rust-mode" :ref "8df117a3b54d9e01266a3905b132a1d082944702") + :hook emacs-lisp-mode) + +;; (use-package parinfer-rust-mode +;; ;; The latest version of parinfer-rust-mode is incompatible with x86 Macs, so fall back on an earlier commit +;; :ensure +;; (if (string-match "x86_64-apple" system-configuration) +;; '(:host github :repo "justinbarclay/parinfer-rust-mode" :ref "8df117a3b54d9e01266a3905b132a1d082944702") +;; t) +;; :hook emacs-lisp-mode) + diff --git a/thoom-emacs/modules/thoom-org.el b/thoom-emacs/modules/thoom-org.el new file mode 100644 index 0000000..4a60da1 --- /dev/null +++ b/thoom-emacs/modules/thoom-org.el @@ -0,0 +1,23 @@ +(provide 'thoom-org) + +(use-package org + :bind (("C-c o ," . thoom/org-clear-all)) + :custom + (org-todo-keywords '((sequence "TODO(t)" "BLOCKED(b)" "|" "DONE(d)")))) + +(use-package org-bullets + :ensure t + :config + (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) + +;; Eagerly load org-mode +(with-temp-buffer (org-mode)) + +(defun thoom/org-clear-all () + (interactive) + (goto-char 0) + (org-map-entries + (lambda () + (org-todo ""))) + ;;(flush-lines "CLOSED") + (message "Entries cleared.")) diff --git a/thoom-emacs/modules/thoom-theme.el b/thoom-emacs/modules/thoom-theme.el index 42dffed..9a0e5ea 100644 --- a/thoom-emacs/modules/thoom-theme.el +++ b/thoom-emacs/modules/thoom-theme.el @@ -7,7 +7,7 @@ ;; Global settings (defaults) (setq doom-themes-enable-bold t ; if nil, bold is universally disabled doom-themes-enable-italic t) ; if nil, italics is universally disabled - (load-theme 'doom-one t) + (load-theme 'doom-dark+ t) ;; Enable flashing mode-line on errors (doom-themes-visual-bell-config) @@ -15,15 +15,22 @@ (doom-themes-org-config)) ;; Slightly transparent window -(set-frame-parameter (selected-frame) 'alpha '(99 98)) -(add-to-list 'default-frame-alist '(alpha 99 98)) +;; (set-frame-parameter (selected-frame) 'alpha '(99 98)) +(modify-all-frames-parameters '((alpha 99 98) + (top . 50) + (left . 100) + (width . 120) + (height . 60))) (setq thoom-font-candidates '("FiraCode Nerd Font Mono" "Menlo")) (defvar thoom-font (seq-find #'x-list-fonts thoom-font-candidates) "The default font to use.") -(add-to-list 'default-frame-alist `(font . ,thoom-font)) +(defvar thoom-font-size + 14 + "The default font size to use.") +(modify-all-frames-parameters `((font . ,(concat thoom-font "-" (number-to-string thoom-font-size))))) ;; Hide clutter (setq inhibit-startup-message t @@ -34,3 +41,4 @@ ;; On a Mac, the menu bar doesn't take up screen real-estate, so leave it on (unless ON-MAC (menu-bar-mode -1)) + diff --git a/thoom-emacs/modules/thoom-tweaks.el b/thoom-emacs/modules/thoom-tweaks.el index 4137e99..7386128 100644 --- a/thoom-emacs/modules/thoom-tweaks.el +++ b/thoom-emacs/modules/thoom-tweaks.el @@ -8,6 +8,7 @@ ;; Remember recent files (recentf-mode 1) +(setq recentf-max-menu-items 20) ;; Save what you enter into minibuffer prompts (setq history-length 25) @@ -19,23 +20,21 @@ ;; Enable repeat mode. Keymaps are defined through use-package's :repeat-map directive. (repeat-mode 1) -;; TODO - Decide whether to enable this -;; (defalias 'yes-or-no-p 'y-or-n-p) +;; Answer questions with y/n instead of yes/no +(defalias 'yes-or-no-p 'y-or-n-p) ;; tabs are for monsters (setq-default indent-tabs-mode nil) (setq-default tab-width 4) (setq-default sentence-end-double-space nil) - -;; TODO - keybindings +;; automatically cleanup whitespace on save +(add-hook 'before-save-hook 'whitespace-cleanup) (use-package hl-todo :ensure t :init (global-hl-todo-mode)) -;; TODO https://github.com/jdtsmith/outli - (use-package which-key :ensure t :init @@ -48,33 +47,10 @@ ;; ("h" . dired-up-directory) ;; ("l" . dired-find-file))) -;; Treesitter -;; TODO https://github.com/renzmann/treesit-auto - -;; LSP -;; TODO https://github.com/blahgeek/emacs-lsp-booster - ;; TODO Use right-option as regular option on Mac ;; (setq ns-alternate-modifier 'meta) ;; (setq ns-right-alternate-modifier 'none) -;; TODO https://github.com/stsquad/emacs_chrome - -;; TODO https://github.com/astoff/devdocs.el - -;; TODO https://github.com/casouri/vundo -; -;; TODO https://karthinks.com/software/avy-can-do-anything/ - -(defun thoom/org-clear-all () - (interactive) - (goto-char 0) - (org-map-entries - (lambda () - (org-todo ""))) - (flush-lines "CLOSED") - (message "Entries cleared.")) - ;; (use-package dumb-jump ;; :ensure t ;; :config @@ -85,3 +61,6 @@ :ensure t :config (direnv-mode)) + +(use-package explain-pause-mode + :ensure (:host github :repo "lastquestion/explain-pause-mode"))