Emacs config updates

This commit is contained in:
2024-04-09 12:09:23 -07:00
parent 1a0ee5f081
commit 3f5d0b0247
8 changed files with 118 additions and 129 deletions

View File

@@ -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 "<S-down>") (kbd "<S-up>")))
;; 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

View File

@@ -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)))

View File

@@ -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)

View File

@@ -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."))

View File

@@ -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))

View File

@@ -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"))