Compare commits

..

No commits in common. "6511ef9860b86536b3c19daa94799130bd51f5f9" and "7fdcfa458ca6cfa8108449d04654fd0390061457" have entirely different histories.

2 changed files with 19 additions and 172 deletions

View File

@ -101,7 +101,7 @@
(buffer-size) (buffer-size)
(erase-buffer) (erase-buffer)
(goto-char (point-min)) (goto-char (point-min))
(insert-image (create-image (expand-file-name "Emacs@256.png" user-emacs-directory))) (insert-image (create-image "/home/joe/.config/emacs/Emacs@256.png"))
(insert "\n\n\n") (insert "\n\n\n")
(insert "Welcome to Emacs!\n\n") (insert "Welcome to Emacs!\n\n")
;; (dashboard-insert-center "testing this thing out\n\n") ;; (dashboard-insert-center "testing this thing out\n\n")

View File

@ -269,7 +269,7 @@ need to benchmark slow init times later.
** Misc Stuff ** Misc Stuff
#+begin_SRC emacs-lisp #+begin_SRC emacs-lisp
(setq default-directory (expand-file-name "~")) (setq default-directory "/home/joe/")
(setq vc-follow-symlinks t) ; Visit real file when editing a symlink without prompting. (setq vc-follow-symlinks t) ; Visit real file when editing a symlink without prompting.
(global-auto-revert-mode t) ; Revert buffer's file when the file changes on disk (global-auto-revert-mode t) ; Revert buffer's file when the file changes on disk
@ -531,8 +531,8 @@ Setup other stuff
;; TODO Likely not needed anymore ;; TODO Likely not needed anymore
(dolist (mode '(dired-mode-hook lsp-help-mode-hook fundamental-mode-hook)) ;; (dolist (mode '(dired-mode-hook lsp-help-mode-hook fundamental-mode-hook))
(add-hook mode (lambda () (setq truncate-lines t)))) ;; (add-hook mode (lambda () (setq truncate-lines t))))
#+end_src #+end_src
Ligatures... are they that useful? Ligatures... are they that useful?
@ -639,7 +639,7 @@ Emacs is an great operating system, if only it had a good text editor...
(global-set-key (kbd "M-o") #'joe/insert-line-below) (global-set-key (kbd "M-o") #'joe/insert-line-below)
(global-set-key (kbd "M-O") #'joe/insert-line-above) (global-set-key (kbd "M-O") #'joe/insert-line-above)
(setq-default truncate-lines t) ;; (setq-default truncate-lines nil)
(setq-default truncate-partial-width-windows nil) (setq-default truncate-partial-width-windows nil)
(defun joe/backward-kill-word-or-kill-region () (defun joe/backward-kill-word-or-kill-region ()
@ -844,13 +844,6 @@ Fill region is great, except when you don't need it...
(setq evil-goggles-pulse t) (setq evil-goggles-pulse t)
(setq evil-goggles-async-duration 0.55) (setq evil-goggles-async-duration 0.55)
(defun joe/evil-search-symbol-forward ()
(interactive)
(evil-search-word t nil t))
(evil-global-set-key 'normal "*" #'joe/evil-search-symbol-forward)
(evil-global-set-key 'normal "#" #'evil-search-word-forward)
;; Recenter lines after mark jump ;; Recenter lines after mark jump
;; (defun joe/recenter-after-goto-mark () ;; (defun joe/recenter-after-goto-mark ()
;; (interactive) ;; (interactive)
@ -945,18 +938,6 @@ Fill region is great, except when you don't need it...
(keymap-set smartparens-mode-map "M-(" 'sp-wrap-round) (keymap-set smartparens-mode-map "M-(" 'sp-wrap-round)
(keymap-set smartparens-mode-map "M-[" 'sp-wrap-square) (keymap-set smartparens-mode-map "M-[" 'sp-wrap-square)
(keymap-set smartparens-mode-map "M-{" 'sp-wrap-curly) (keymap-set smartparens-mode-map "M-{" 'sp-wrap-curly)
(defun sp-wrap-single-quote ()
(interactive)
(sp-wrap-with-pair "'"))
(defun sp-wrap-double-quote ()
(interactive)
(sp-wrap-with-pair "\""))
(keymap-set smartparens-mode-map "M-'" 'sp-wrap-single-quote)
(keymap-set smartparens-mode-map "M-\"" 'sp-wrap-double-quote)
#+end_src #+end_src
*** expand-region *** expand-region
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -1031,7 +1012,6 @@ Fill region is great, except when you don't need it...
(switch-to-buffer (other-buffer))) (switch-to-buffer (other-buffer)))
(global-set-key (kbd "C-x l") 'joe/switch-other-buffer) (global-set-key (kbd "C-x l") 'joe/switch-other-buffer)
(global-set-key (kbd "C-x C-l") 'joe/switch-other-buffer)
(save-place-mode t) (save-place-mode t)
(setq save-place-file (expand-file-name "places" user-emacs-directory)) (setq save-place-file (expand-file-name "places" user-emacs-directory))
@ -1071,78 +1051,6 @@ Harpoon lets you quickly switch between bookmarked buffers
#+end_src #+end_src
*** Centaur Tabs
#+begin_src emacs-lisp
;; (require 'centaur-tabs)
(setq centaur-tabs-set-bar 'under)
(setq x-underline-at-descent-line t)
(setq centaur-tabs-set-close-button nil)
(setq centaur-tabs-set-icons t)
(setq centaur-tabs-show-navigation-buttons nil)
(setq centaur-tabs-set-modified-marker nil)
(setq centaur-tabs-show-new-tab-button nil)
(setq centaur-tabs-label-fixed-length 0)
(setq centaur-tabs-label-rename-function
(lambda (buf) (if (> (length (buffer-name buf)) 20)
(concat (substring (buffer-name buf) 0 17) "...")
(buffer-name buf))))
(global-set-key (kbd "s-n") #'centaur-tabs-forward-tab)
(global-set-key (kbd "s-p") #'centaur-tabs-backward-tab)
(global-set-key (kbd "C-s-p") #'centaur-tabs-forward-group)
(global-set-key (kbd "C-s-n") #'centaur-tabs-backward-group)
(global-set-key (kbd "s-P") #'centaur-tabs-move-current-tab-to-left)
(global-set-key (kbd "s-N") #'centaur-tabs-move-current-tab-to-right)
(let ((modes '(magit-status-mode
dired-mode
mu4e-main-mode
mu4e-headers-mode
mu4e-view-mode)))
(dolist (mode modes)
(add-hook (intern (concat (symbol-name mode) "-hook"))
(lambda () (centaur-tabs-local-mode -1)))))
(with-eval-after-load 'centaur-tabs
(defun joe/fix-centaur-tabs (THEME)
(centaur-tabs-mode -1)
(centaur-tabs-mode))
(advice-add 'consult-theme :after #'joe/fix-centaur-tabs)
(defun centaur-tabs-buffer-groups ()
(list
(cond
;; Work buffers: REPLs, Claude, Chat, eww, cider-repl
((or (derived-mode-p 'comint-mode)
(derived-mode-p 'sql-interactive-mode)
(derived-mode-p 'compilation-mode)
(derived-mode-p 'compilation-mode)
(string-match "^\\*HTTP" (buffer-name))
(string-match "^\\*cider-repl" (buffer-name))
(bound-and-true-p gptel-mode)
(derived-mode-p 'eww-mode))
"Work")
;; Special *buffers* (scratch, Messages, etc.)
((and (string-equal "*" (substring (buffer-name) 0 1))
(not (string-match "^\\*Org Src" (buffer-name))))
"*Buffers*")
;; Everything else in one group
(t
"Emacs")))))
(global-set-key (kbd "M-1") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-2") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-3") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-4") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-5") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-6") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-7") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-8") 'centaur-tabs-select-visible-tab)
(global-set-key (kbd "M-9") 'centaur-tabs-select-visible-tab)
(centaur-tabs-mode +1)
#+end_src
*** Window Management *** Window Management
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -1533,64 +1441,21 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
;; (require 'consult-lsp) ;; (require 'consult-lsp)
(defvar consult-map (make-sparse-keymap)) (global-set-key (kbd "M-s l") #'consult-line)
(global-set-key (kbd "C-;") consult-map) (global-set-key (kbd "M-s g") #'consult-ripgrep)
(define-key consult-map (kbd "a") 'command-a) (global-set-key (kbd "M-s f") #'consult-find)
;; Bind the prefix (global-set-key (kbd "M-s y") #'consult-yank-from-kill-ring)
(define-key consult-map (kbd "l") #'consult-line) (global-set-key (kbd "M-s r") #'consult-recent-file)
(define-key consult-map (kbd "C-l") #'consult-line-multi) (global-set-key (kbd "M-s i") #'consult-imenu)
(define-key consult-map (kbd "F") #'consult-find)
(define-key consult-map (kbd "g") #'consult-ripgrep)
(define-key consult-map (kbd "y") #'consult-yank-from-kill-ring)
(define-key consult-map (kbd "r") #'consult-recent-file)
(define-key consult-map (kbd "i") #'consult-imenu)
(define-key consult-map (kbd "t") #'consult-theme)
(defun joe/evil-search-symbol-forward ()
(interactive)
(evil-search-word-forward 1 t))
(evil-global-set-key 'normal "*" #'joe/evil-search-symbol-forward)
(evil-global-set-key 'normal "#" #'evil-search-word-forward)
(defun joe/consult-line-symbol-at-point ()
"Search for a line matching the symbol found near point."
(interactive)
(consult-line
(or (thing-at-point 'symbol))))
(defun joe/consult-line-word-at-point ()
"Search for a line matching the word found near point."
(interactive)
(consult-line
(or (thing-at-point 'word))))
(defun joe/consult-ripgrep-symbol-at-point ()
"Run consult-ripgrep with the symbol at point as the initial search term."
(interactive)
(let* ((term (thing-at-point 'symbol))
(search-term (if term term "")))
(consult-ripgrep nil search-term)))
(defun joe/consult-ripgrep-word-at-point ()
"Run consult-ripgrep with the word at point as the initial search term."
(interactive)
(let* ((term (thing-at-point 'symbol))
(search-term (if term term "")))
(consult-ripgrep default-directory search-term)))
(define-key consult-map (kbd ".") #'joe/consult-line-symbol-at-point)
(define-key consult-map (kbd "C-.") #'joe/consult-line-word-at-point)
(define-key consult-map (kbd ",") #'joe/consult-ripgrep-symbol-at-point)
(define-key consult-map (kbd "C-,") #'joe/consult-ripgrep-word-at-point)
#+end_src #+end_src
*** Orderless *** Orderless
#+begin_src emacs-lisp #+begin_src emacs-lisp
(require 'orderless) (require 'orderless)
(setq completion-styles '(orderless basic) (setq completion-styles '(orderless basic)
completion-category-overrides '((file (styles basic partial-completion)))) completion-category-overrides '((file (styles basic partial-completion))))
#+end_src #+end_src
** App Launcher ** App Launcher
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -1658,7 +1523,7 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
(kbd "M-l") #'dirvish-ls-switches-menu (kbd "M-l") #'dirvish-ls-switches-menu
(kbd "M-m") #'dirvish-mark-menu (kbd "M-m") #'dirvish-mark-menu
(kbd "M-t") #'dirvish-layout-toggle (kbd "M-t") #'dirvish-layout-toggle
(kbd "M-<return>") #'dirvish-setup-menu (kbd "M-s") #'dirvish-setup-menu
(kbd "M-e") #'dirvish-emerge-menu (kbd "M-e") #'dirvish-emerge-menu
(kbd "M-j") #'dirvish-fd-jump))) (kbd "M-j") #'dirvish-fd-jump)))
@ -1796,7 +1661,7 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
(require 'avy) (require 'avy)
(setq avy-case-fold-search nil) (setq avy-case-fold-search nil)
(setq avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l ?q ?w ?e ?r ?u ?i ?o ?p ?z ?x ?c ?v ?n ?m)) (setq avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l ?q ?w ?e ?r ?u ?i ?o ?p ?z ?x ?c ?v ?n ?m))
(global-set-key (kbd "M-s") #'avy-goto-char) ;; I use this most frequently (global-set-key (kbd "C-;") #'avy-goto-char) ;; I use this most frequently
;; (define-key global-map (kbd "C-'") 'avy-goto-line) ;; Consistent with ivy-avy ;; (define-key global-map (kbd "C-'") 'avy-goto-line) ;; Consistent with ivy-avy
(define-key global-map (kbd "M-g c") 'avy-goto-char) (define-key global-map (kbd "M-g c") 'avy-goto-char)
(define-key global-map (kbd "M-g e") 'avy-goto-word-0) ;; lots of candidates (define-key global-map (kbd "M-g e") 'avy-goto-word-0) ;; lots of candidates
@ -2030,7 +1895,6 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
(setq lsp-modeline-diagnostics-enable nil) (setq lsp-modeline-diagnostics-enable nil)
(setq lsp-modeline-code-actions-enable nil) (setq lsp-modeline-code-actions-enable nil)
(setq lsp-lens-enable nil) (setq lsp-lens-enable nil)
(setq lsp-ui-doc-show-with-mouse nil)
(setq lsp-signature-auto-activate nil) (setq lsp-signature-auto-activate nil)
(setq lsp-eldoc-enable-hover nil) (setq lsp-eldoc-enable-hover nil)
(setq eldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit) (setq eldoc-echo-area-use-multiline-p 'truncate-sym-name-if-fit)
@ -2106,7 +1970,6 @@ start it, so go through all existing buffers that match the mode and belong to t
(defun joe/flycheck-buffer-and-previous () (interactive) (flycheck-buffer) (flycheck-previous-error)) (defun joe/flycheck-buffer-and-previous () (interactive) (flycheck-buffer) (flycheck-previous-error))
(defun joe/flycheck-clear-if-active () (defun joe/flycheck-clear-if-active ()
(interactive)
(when (bound-and-true-p flycheck-mode) (when (bound-and-true-p flycheck-mode)
(flycheck-clear))) (flycheck-clear)))
@ -2186,9 +2049,6 @@ start it, so go through all existing buffers that match the mode and belong to t
(gptel-make-anthropic "Claude" :stream t :key (with-temp-buffer (gptel-make-anthropic "Claude" :stream t :key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-key" user-emacs-directory)) (insert-file-contents (expand-file-name "gptel-key" user-emacs-directory))
(buffer-string))) (buffer-string)))
(gptel-make-openai "ChatGPT" :stream t :key (with-temp-buffer
(insert-file-contents (expand-file-name "gptel-gpt-key" user-emacs-directory))
(buffer-string)))
(setq gptel-model 'claude-sonnet-4-6) (setq gptel-model 'claude-sonnet-4-6)
(setq gptel-backend (gptel-get-backend "Claude")) (setq gptel-backend (gptel-get-backend "Claude"))
@ -2196,30 +2056,17 @@ start it, so go through all existing buffers that match the mode and belong to t
(setq gptel-prompt-prefix-alist '((markdown-mode . "### ") (setq gptel-prompt-prefix-alist '((markdown-mode . "### ")
(org-mode . "* ") (org-mode . "* ")
(text-mode . "### "))) (text-mode . "### ")))
(setq gptel-cache '(system message))
;; (setq gptel-log-level 'debug)
(define-prefix-command 'joe/gptel-map) (define-prefix-command 'joe/gptel-map)
(global-set-key (kbd "C-c a") 'joe/gptel-map) (global-set-key (kbd "C-c a") 'joe/gptel-map)
(define-key joe/gptel-map (kbd "a") #'gptel) (define-key joe/gptel-map (kbd "a") #'gptel)
;; (define-key joe/gptel-map (kbd "RET") #'gptel-ask) (define-key joe/gptel-map (kbd "RET") #'gptel-ask)
(define-key joe/gptel-map (kbd "m") #'gptel-mode) (define-key joe/gptel-map (kbd "m") #'gptel-mode)
(define-key joe/gptel-map (kbd "RET") #'gptel-add) (define-key joe/gptel-map (kbd "c") #'gptel-add)
(define-key joe/gptel-map (kbd "q") #'gptel-abort) (define-key joe/gptel-map (kbd "q") #'gptel-abort)
(define-key joe/gptel-map (kbd "<backspace>") #'joe/gptel-context-remove-all) (define-key joe/gptel-map (kbd "<backspace>") #'joe/gptel-context-remove-all)
(define-key joe/gptel-map (kbd "r") #'gptel-rewrite) (define-key joe/gptel-map (kbd "r") #'gptel-rewrite)
(defun gptel-mark-region-role (start end role)
"Mark region from START to END with the llm or user role."
(interactive (list (region-beginning) (region-end)
(completing-read "Mark region role as: " '(response prompt))))
(if (or (not transient-mark-mode)
(use-region-p))
(with-silent-modifications
(put-text-property start end 'gptel (and (equal role "response") 'response))
(message "Region marked as %s" role))
(message "No region specified, action canceled")))
#+end_src #+end_src
gptel-context-remove-all without confirmation gptel-context-remove-all without confirmation
@ -2871,7 +2718,7 @@ TODO: We need to create a var for a project based base branch
** Initial Buffer ** Initial Buffer
#+begin_src emacs-lisp #+begin_src emacs-lisp
(load-file (expand-file-name "elisp/welcome.el" user-emacs-directory)) (load-file "/home/joe/.config/emacs/elisp/welcome.el")
#+end_src #+end_src
* COMMENT Local variables * COMMENT Local variables
;; Local Variables: ;; Local Variables: