Compare commits
No commits in common. "54a1298000a0b701cd724e2e69b219472cb70178" and "8f13c0eef1cd3f9a061a153683e774aa23baaf57" have entirely different histories.
54a1298000
...
8f13c0eef1
424
init.org
424
init.org
|
|
@ -473,18 +473,7 @@ Honestly not very happy with this at the moment, but it's kind of hacked togethe
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Packages
|
* Packages
|
||||||
** COMMENT ESUP
|
** =general.el=
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package esup
|
|
||||||
:straight t
|
|
||||||
:config
|
|
||||||
(setopt esup-user-init-file "~/init.el"
|
|
||||||
esup-depth 1))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
** =general.el =
|
|
||||||
TODO: figure out how to get which-key to correctly display the ‘m‘ label
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defconst nemo/leader-evil "SPC")
|
(defconst nemo/leader-evil "SPC")
|
||||||
(defconst nemo/leader-global "C-c")
|
(defconst nemo/leader-global "C-c")
|
||||||
|
|
@ -495,244 +484,55 @@ TODO: figure out how to get which-key to correctly display the ‘m‘ label
|
||||||
|
|
||||||
(use-package general
|
(use-package general
|
||||||
:straight t
|
:straight t
|
||||||
:init
|
|
||||||
(define-prefix-command 'nemo/xref-command 'nemo/xref-map "xref")
|
|
||||||
(define-prefix-command 'nemo/buffers-command 'nemo/buffers-map "Buffers..")
|
|
||||||
(define-prefix-command 'nemo/windows-command 'nemo/windows-map "Windows..")
|
|
||||||
(define-prefix-command 'nemo/files-command 'nemo/files-map "Files..")
|
|
||||||
:config
|
:config
|
||||||
(general-define-key
|
(general-define-key
|
||||||
:states '(emacs normal)
|
:states '(emacs normal)
|
||||||
:prefix-map 'nemo/leader-prefix-map
|
:prefix-map 'nemo/leader-prefix-map
|
||||||
|
:prefix-command 'nemo/leader-prefix-command
|
||||||
:global-prefix nemo/leader-global
|
:global-prefix nemo/leader-global
|
||||||
:prefix nemo/leader-evil)
|
:prefix nemo/leader-evil)
|
||||||
|
|
||||||
;; `leader-def` binds with prefix "SPC" into `nemo/leader-prefix-map`
|
|
||||||
(general-create-definer leader-def
|
(general-create-definer leader-def
|
||||||
:keymaps 'nemo/leader-prefix-map)
|
:prefix-command 'nemo/leader-prefix-command
|
||||||
|
:prefix-map 'nemo/leader-prefix-map)
|
||||||
|
(general-create-definer leader-other-def
|
||||||
|
:states '(emacs normal)
|
||||||
|
:prefix-map 'nemo/leader-prefix-map
|
||||||
|
:prefix-command 'nemo/leader-prefix-command
|
||||||
|
:global-prefix nemo/leader-global
|
||||||
|
:prefix nemo/leader-evil
|
||||||
|
)
|
||||||
(general-create-definer leader-major-def
|
(general-create-definer leader-major-def
|
||||||
:states '(emacs normal)
|
:states '(emacs normal)
|
||||||
|
:global-prefix nemo/leader-global
|
||||||
:prefix nemo/leader-evil
|
:prefix nemo/leader-evil
|
||||||
:global-prefix nemo/leader-global)
|
)
|
||||||
|
|
||||||
;; magit uses with-editor-mode to spawn the git process
|
;; magit uses with-editor-mode to spawn the git process
|
||||||
;; in with the emacs client as the $EDITOR
|
;; in with the emacs client as the $EDITOR
|
||||||
(general-def '(emacs normal) :keymaps 'with-editor-mode-map
|
(general-def '(emacs normal) 'with-editor-mode-map ",," 'with-editor-finish)
|
||||||
",," 'with-editor-finish
|
(general-def '(emacs normal) 'with-editor-mode-map ",k" 'with-editor-cancel)
|
||||||
",k" 'with-editor-cancel)
|
|
||||||
|
|
||||||
(leader-def
|
(leader-def
|
||||||
"<TAB>" '("Switch to last buffer" . nemo/switch-to-last-buffer)
|
"<TAB>" #'nemo/switch-to-last-buffer
|
||||||
"<SPC>" '("Completion at point" . completion-at-point)
|
"<SPC>" #'completion-at-point
|
||||||
"d" '("Duplicate line" . duplicate-line)
|
"d" #'duplicate-line
|
||||||
"g" '("xref" . nemo/xref-command)
|
"gb" #'xref-go-back
|
||||||
"b" '("Buffers" . nemo/buffers-command)
|
"gf" #'xref-go-forward
|
||||||
"w" '("Windows" . nemo/windows-command)
|
"bk" #'switch-to-prev-buffer
|
||||||
"f" '("Files" . nemo/files-command))
|
"bp" #'switch-to-prev-buffer
|
||||||
|
"bj" #'switch-to-next-buffer
|
||||||
(general-def
|
"bn" #'switch-to-next-buffer
|
||||||
:keymaps 'nemo/xref-map
|
"bb" #'consult-buffer
|
||||||
"b" '("Go back" . xref-go-back)
|
"bd" #'kill-current-buffer
|
||||||
"f" '("Go forward" . xref-go-forward)
|
"bs" #'scratch-buffer
|
||||||
"r" '("Find references" . xref-find-references))
|
"wd" #'delete-window
|
||||||
|
"wo" #'delete-other-windows
|
||||||
(general-def
|
"ff" #'find-file
|
||||||
:keymaps 'nemo/buffers-map
|
"fi" '("Edit init.org" . nemo/edit-init-org)
|
||||||
"k" '("Switch to previous buffer" . switch-to-prev-buffer)
|
"fs" '("Save" . save-buffer)
|
||||||
"p" '("Switch to previous buffer" . switch-to-prev-buffer)
|
"fr" '("rg" . consult-ripgrep)
|
||||||
"j" '("Switch to next buffer" . switch-to-next-buffer)
|
"fR" '("rg in dir" . nemo/consult-ripgrep-dir)
|
||||||
"n" '("Switch to next buffer" . switch-to-next-buffer)
|
)
|
||||||
"b" '("Consult buffer" . consult-buffer)
|
|
||||||
"d" '("Kill current buffer" . kill-current-buffer)
|
|
||||||
"s" '("Scratch buffer" . scratch-buffer))
|
|
||||||
|
|
||||||
(general-def
|
|
||||||
:keymaps 'nemo/windows-map
|
|
||||||
"d" '("Delete window" . delete-window)
|
|
||||||
"o" '("Delete other windows" . delete-other-windows))
|
|
||||||
|
|
||||||
(general-def
|
|
||||||
:keymaps 'nemo/files-map
|
|
||||||
"f" '("Find file" . find-file)
|
|
||||||
"i" '("Edit init.org" . nemo/edit-init-org)
|
|
||||||
"s" '("Save" . save-buffer)
|
|
||||||
"r" '("Ripgrep" . consult-ripgrep)
|
|
||||||
"R" '("Ripgrep in dir" . nemo/consult-ripgrep-dir))
|
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
** =dired=
|
|
||||||
Inspiration taken from [[https://eugene-andrienko.com/2026-07-05-my-emacs-configuration-dired.html][this post]] from hacker news.
|
|
||||||
|
|
||||||
Todo: figure out how best to use =image-dired=.
|
|
||||||
#+begin_src emacs-lisp :tangle local-lisp/dired-hide-dotfiles.el
|
|
||||||
;;; dired-hide-dotfiles.el --- Hide dotfiles in dired buffers -*- lexical-binding: t; -*-
|
|
||||||
|
|
||||||
(require 'dired)
|
|
||||||
|
|
||||||
(defgroup dired-hide-dotfiles nil
|
|
||||||
:group 'dired)
|
|
||||||
|
|
||||||
(define-minor-mode dired-hide-dotfiles-mode
|
|
||||||
:init-value nil
|
|
||||||
:group 'dired
|
|
||||||
(if dired-hide-dotfiles-mode
|
|
||||||
(progn
|
|
||||||
(add-hook 'dired-after-readin-hook #'dired-hide-dotfiles)
|
|
||||||
(dired-hide-dotfiles))
|
|
||||||
(remove-hook 'dired-after-readin-hook #'dired-hide-dotfiles)
|
|
||||||
(revert-buffer))
|
|
||||||
|
|
||||||
(defun dired-hide-dotfiles ()
|
|
||||||
"Hide dotfiles in dired buffer."
|
|
||||||
(let ((inhibit-message t))
|
|
||||||
(dired-mark-files-regexp "^\\.|^.*/\\.")
|
|
||||||
(dired-do-kill-lines nil "Hid %d dotfiles."))))
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'dired-hide-dotfiles)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(defun nemo/dired-create-file-or-directory (path)
|
|
||||||
"Create a file or directory with NAME in the current dired buffer."
|
|
||||||
(interactive "sEnter name for new file/directory: ")
|
|
||||||
(if (or (file-exists-p path) (file-directory-p path))
|
|
||||||
(message "'%s' already exists." path)
|
|
||||||
(if (string-suffix-p "/" path)
|
|
||||||
(dired-create-directory path)
|
|
||||||
(dired-create-empty-file path))))
|
|
||||||
|
|
||||||
(defun nemo/dired-toggle-mark ()
|
|
||||||
"Toggle the mark on the current file in dired."
|
|
||||||
(interactive)
|
|
||||||
(when dired-get-filename nil t)
|
|
||||||
(let ((inhibit-read-only t))
|
|
||||||
(save-excursion
|
|
||||||
(dired-move-to-filename)
|
|
||||||
(beginning-of-line)
|
|
||||||
(if (looking-at dired-marker-char)
|
|
||||||
(dired-unmark 1)
|
|
||||||
(dired-mark 1)))))
|
|
||||||
|
|
||||||
(use-package dired
|
|
||||||
:straight nil
|
|
||||||
:hook (dired-mode . hl-line-mode)
|
|
||||||
:hook (dired-mode . dired-hide-details-mode)
|
|
||||||
:hook (dired-mode . auto-revert-mode)
|
|
||||||
:hook (dired-mode . dired-omit-mode)
|
|
||||||
:bind (:map dired-mode-map
|
|
||||||
("<backspace>" . dired-up-directory)
|
|
||||||
("<tab>" . dired-subtree-toggle)
|
|
||||||
("TAB" . dired-subtree-toggle)
|
|
||||||
("C-TAB" . dired-subtree-remove)
|
|
||||||
("#" . dired-omit-mode)
|
|
||||||
("+" . nemo/dired-create-file-or-directory))
|
|
||||||
:general
|
|
||||||
(general-def
|
|
||||||
:states '(normal visual)
|
|
||||||
:keymaps 'override
|
|
||||||
:major-modes 'dired-mode
|
|
||||||
"#" '("Toggle Dotfiles" . dired-omit-mode)
|
|
||||||
"+" '("Create File/Directory" . nemo/dired-create-file-or-directory))
|
|
||||||
:init
|
|
||||||
(define-prefix-command 'nemo/dired-map)
|
|
||||||
(leader-major-def :keymaps 'dired-mode-map
|
|
||||||
"m" '("Dired" . nemo/dired-map))
|
|
||||||
:config
|
|
||||||
(general-def
|
|
||||||
:keymaps 'nemo/dired-map
|
|
||||||
"p" '("Preview Files" . dired-preview-mode)
|
|
||||||
"+" '("Create File/Directory" . nemo/dired-create-file-or-directory)
|
|
||||||
"#" '("Toggle Dotfiles" . dired-omit-mode))
|
|
||||||
|
|
||||||
(setopt dired-compress-directory-default-suffix ".tar.zst"
|
|
||||||
dired-create-destination-dirs 'always
|
|
||||||
dired-filename-display-length 'window
|
|
||||||
dired-hide-details-hide-symlink-targets nil
|
|
||||||
dired-kill-when-opening-new-dired-buffer t
|
|
||||||
dired-listing-switches "-alh --group-directories-first"
|
|
||||||
dired-mouse-drag-files t
|
|
||||||
dired-movement-style 'bounded
|
|
||||||
dired-recursive-copies 'always
|
|
||||||
dired-recursive-deletes 'top)
|
|
||||||
|
|
||||||
:custom
|
|
||||||
(dired-omit-files (rx (seq bol ".")))
|
|
||||||
)
|
|
||||||
|
|
||||||
(use-package dired-subtree
|
|
||||||
:straight t
|
|
||||||
:after dired
|
|
||||||
:hook (dired-subtree-after-insert . (lambda ()
|
|
||||||
(if
|
|
||||||
(bound-and-true-p dired-omit-mode)
|
|
||||||
(dired-omit-expunge))))
|
|
||||||
:config
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
(use-package dired-open
|
|
||||||
:straight t
|
|
||||||
:after dired
|
|
||||||
:config
|
|
||||||
(setopt dired-open-extensions '(("png" . "sxiv")
|
|
||||||
("jpg" . "sxiv")
|
|
||||||
("jpeg" . "sxiv")
|
|
||||||
("pdf" . "zathura")
|
|
||||||
("mp4" . "mpv")
|
|
||||||
("mkv" . "mpv")
|
|
||||||
("webm" . "mpv")
|
|
||||||
("epub" . "zathura")
|
|
||||||
("mp3" . "mpv")
|
|
||||||
("wav" . "mpv"))))
|
|
||||||
|
|
||||||
(use-package image-dired
|
|
||||||
:straight t
|
|
||||||
:after dired
|
|
||||||
:config
|
|
||||||
(setopt image-dired-thumb-margin 5
|
|
||||||
image-dired-thumb-size 256
|
|
||||||
image-dired-track-movement t
|
|
||||||
image-dired-thumbnail-storage 'standard-large))
|
|
||||||
|
|
||||||
(defun nemo/dired-preview--file-ignored-p (orig-fun file &rest args)
|
|
||||||
"Return t if FILE should be ignored by dired-preview."
|
|
||||||
(if-let* (((stringp dired-preview-ignored-extensions-regexp))
|
|
||||||
((not (file-directory-p file)))
|
|
||||||
(file-nondir (file-name-nondirectory file)))
|
|
||||||
(string-match-p dired-preview-ignored-extensions-regexp file-nondir)
|
|
||||||
t))
|
|
||||||
|
|
||||||
(use-package dired-preview
|
|
||||||
:straight t
|
|
||||||
:after dired
|
|
||||||
:config
|
|
||||||
(setopt
|
|
||||||
dired-preview-display-action-alist #'dired-preview-display-action-alist-dwim
|
|
||||||
dired-preview-delay 0.1
|
|
||||||
dired-preview-ignored-extensions-regexp
|
|
||||||
(concat
|
|
||||||
(default-value 'dired-preview-ignored-extensions-regexp)))
|
|
||||||
|
|
||||||
(advice-add 'dired-preview--file-ignored-p :around
|
|
||||||
#'nemo/dired-preview--file-ignored-p)
|
|
||||||
|
|
||||||
(cl-defmethod dired-preview--get-buffer ((file (head ignore)))
|
|
||||||
(let* ((file (s-chop-suffix "/" (cdr file)))
|
|
||||||
(buffer-name (format "%s (no preview)" (file-name-nondirectory file))))
|
|
||||||
(or (get-buffer buffer-name)
|
|
||||||
(with-current-buffer (get-buffer-create buffer-name)
|
|
||||||
(set-visited-file-name file t)
|
|
||||||
(rename-buffer buffer-name)
|
|
||||||
(set-buffer-modified-p nil)
|
|
||||||
(setq-local dired-preview--placeholder-buffer-p t)
|
|
||||||
(setq buffer-read-only t)
|
|
||||||
(current-buffer)))))
|
|
||||||
)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
** Web Search
|
** Web Search
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package engine-mode
|
(use-package engine-mode
|
||||||
|
|
@ -843,12 +643,12 @@ Used by Spacemacs as well.
|
||||||
|
|
||||||
Evil key-binds, documentation for how this works is [[https://evil.readthedocs.io/en/latest/keymaps.html][here]]:
|
Evil key-binds, documentation for how this works is [[https://evil.readthedocs.io/en/latest/keymaps.html][here]]:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(general-def
|
(leader-def
|
||||||
:keymaps 'nemo/windows-map
|
"wj" 'evil-window-down
|
||||||
"j" '("Move Down" . evil-window-down)
|
"wk" 'evil-window-up
|
||||||
"k" '("Move Up" . evil-window-up)
|
"wh" 'evil-window-left
|
||||||
"h" '("Move Left" . evil-window-left)
|
"wl" 'evil-window-right
|
||||||
"l" '("Move Right" . evil-window-right))
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Advice =evil-search-forward= (bound to =/=) to push the current marker onto the xref stack to allow for returning to where I started searching from:
|
Advice =evil-search-forward= (bound to =/=) to push the current marker onto the xref stack to allow for returning to where I started searching from:
|
||||||
|
|
@ -1009,27 +809,18 @@ PDF tools for latex previewing:
|
||||||
:straight t
|
:straight t
|
||||||
:defer t
|
:defer t
|
||||||
:mode ("\\.pdf\\'" . pdf-view-mode)
|
:mode ("\\.pdf\\'" . pdf-view-mode)
|
||||||
:init
|
|
||||||
(define-prefix-command 'nemo/pdf-map)
|
|
||||||
:config
|
:config
|
||||||
(leader-major-def
|
|
||||||
:keymaps 'pdf-view-mode-map
|
|
||||||
"g" '("Navigate" . nemo/pdf-map))
|
|
||||||
|
|
||||||
(general-def
|
|
||||||
:keymaps 'nemo/pdf-map
|
|
||||||
"b" '("Back" . pdf-history-backward)
|
|
||||||
"f" '("Forward" . pdf-history-forward))
|
|
||||||
(general-def
|
|
||||||
:modes '(normal emacs)
|
|
||||||
:keymaps 'pdf-view-mode-map
|
|
||||||
"j" `("Scroll Up" . ,(lambda() (interactive) (pdf-view-scroll-up-or-next-page 20)))
|
|
||||||
"k" `("Scroll Down" . ,(lambda() (interactive) (pdf-view-scroll-down-or-previous-page 20))))
|
|
||||||
|
|
||||||
(pdf-loader-install)
|
(pdf-loader-install)
|
||||||
(setq-default pdf-view-display-size 'fit-height)
|
(setq-default pdf-view-display-size 'fit-height)
|
||||||
(setq pdf-view-continuous t)
|
(setq pdf-view-continuous t)
|
||||||
(setq +latex-viewers '(pdf-tools))
|
(setq +latex-viewers '(pdf-tools))
|
||||||
|
(leader-major-def
|
||||||
|
:keymaps 'pdf-view-mode-map
|
||||||
|
"g b" #'pdf-history-backward
|
||||||
|
"g f" #'pdf-history-forward)
|
||||||
|
(general-def :keymaps 'pdf-view-mode-map
|
||||||
|
"j" (lambda() (interactive) (pdf-view-scroll-up-or-next-page 20))
|
||||||
|
"k" (lambda() (interactive) (pdf-view-scroll-down-or-previous-page 20)))
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -1122,7 +913,6 @@ End =:config=
|
||||||
Install various export packages:
|
Install various export packages:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package ox-epub
|
(use-package ox-epub
|
||||||
:defer t
|
|
||||||
:straight t)
|
:straight t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -1135,7 +925,7 @@ Use org-bullets for fancy headline markers
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Use typo-mode in org-mode for en and em dashes:
|
Use typo-mode in org-mode for en and em dashes:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(use-package typo
|
(use-package typo
|
||||||
:straight t
|
:straight t
|
||||||
:hook (org-mode . typo-mode)
|
:hook (org-mode . typo-mode)
|
||||||
|
|
@ -1326,12 +1116,11 @@ Use =vertico-posframe= to make the =vertico= buffer floating in the centre of th
|
||||||
;; Ensure posframe is always restored when exiting a minibuffer
|
;; Ensure posframe is always restored when exiting a minibuffer
|
||||||
:hook (minibuffer-exit . (lambda () (vertico-posframe-mode 1)))
|
:hook (minibuffer-exit . (lambda () (vertico-posframe-mode 1)))
|
||||||
:config
|
:config
|
||||||
;; (vertico-posframe-mode 1)
|
(vertico-posframe-mode 1)
|
||||||
(setq vertico-posframe-height vertico-count
|
(setq vertico-posframe-height vertico-count
|
||||||
vertico-multiform-commands
|
vertico-multiform-commands
|
||||||
'((consult-line (:not posframe))
|
'((consult-line (:not posframe))
|
||||||
(consult-ripgrep (:not posframe))
|
(consult-ripgrep (:not posframe))
|
||||||
(xref-find-references (:not posframe))
|
|
||||||
(nemo/consult-ripgrep (:not posframe))
|
(nemo/consult-ripgrep (:not posframe))
|
||||||
(nemo/consult-ripgrep-dir (:not posframe))
|
(nemo/consult-ripgrep-dir (:not posframe))
|
||||||
;; (lsp-find-references (:not posframe))
|
;; (lsp-find-references (:not posframe))
|
||||||
|
|
@ -1380,8 +1169,7 @@ Use =consult-xref= for =lsp-xref= and =xref-find-references=.
|
||||||
"Call consult-ripgrep in a user-specified directory."
|
"Call consult-ripgrep in a user-specified directory."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((dir (read-directory-name "Ripgrep directory: ")))
|
(let ((dir (read-directory-name "Ripgrep directory: ")))
|
||||||
(let ((this-command 'consult-ripgrep))
|
(consult-ripgrep dir))
|
||||||
(consult-ripgrep dir)))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
(bind-key "C-s" 'consult-line custom-bindings-map)
|
(bind-key "C-s" 'consult-line custom-bindings-map)
|
||||||
|
|
@ -1644,16 +1432,12 @@ Use =inheritenv= and =envrc= to load ~.envrc~ direnv files:
|
||||||
:straight (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))
|
:straight (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))
|
||||||
:ensure t
|
:ensure t
|
||||||
:hook ((prog-mode markdown-mode conf-toml-mode) . copilot-mode)
|
:hook ((prog-mode markdown-mode conf-toml-mode) . copilot-mode)
|
||||||
:bind (("TAB" . 'copilot-accept-completion)
|
:bind (
|
||||||
("M-<tab>" . 'copilot-accept-completion-by-word)
|
("TAB" . 'copilot-accept-completion)
|
||||||
("C-<tab>" . 'copilot-accept-completion)
|
("C-<tab>" . 'copilot-accept-completion)
|
||||||
("C-M-<tab>" . 'copilot-accept-completion-by-line))
|
("M-<tab>" . 'copilot-accept-completion-by-word)
|
||||||
:bind (:map copilot-completion-map
|
("C-S-<tab>" . 'copilot-accept-completion-by-line)
|
||||||
("<tab>" . 'copilot-accept-completion)
|
)
|
||||||
("TAB" . 'copilot-accept-completion)
|
|
||||||
("C-<tab>" . 'copilot-accept-completion)
|
|
||||||
("M-<tab>" . 'copilot-accept-completion-by-word)
|
|
||||||
("C-M-<tab>" . 'copilot-accept-completion-by-line))
|
|
||||||
:config
|
:config
|
||||||
(setq copilot-indent-offset-warning-disable t
|
(setq copilot-indent-offset-warning-disable t
|
||||||
copilot-max-char-warning-disable t)
|
copilot-max-char-warning-disable t)
|
||||||
|
|
@ -1670,30 +1454,24 @@ Use =inheritenv= and =envrc= to load ~.envrc~ direnv files:
|
||||||
(use-package copilot-chat
|
(use-package copilot-chat
|
||||||
:straight (:host github :repo "chep/copilot-chat.el" :files ("*.el"))
|
:straight (:host github :repo "chep/copilot-chat.el" :files ("*.el"))
|
||||||
:after (org markdown-mode)
|
:after (org markdown-mode)
|
||||||
:init
|
:general
|
||||||
(define-prefix-command 'nemo/copilot-map)
|
|
||||||
:general-config
|
|
||||||
(leader-def
|
(leader-def
|
||||||
"c" '("Copilot" . nemo/copilot-map))
|
"cg" '("Generate commit message" . copilot-chat-insert-commit-message)
|
||||||
(general-def
|
"cG" '("Regenerate commit message" . copilot-chat-regenerate-commit-message)
|
||||||
:keymaps 'nemo/copilot-map
|
"cC" '("Open Copilot Chat" . copilot-chat-display)
|
||||||
"g" '("Generate commit message" . copilot-chat-insert-commit-message)
|
"cba" '("Add Buffer to Copilot" . copilot-chat-add-current-buffer)
|
||||||
"G" '("Regenerate commit message" . copilot-chat-regenerate-commit-message)
|
"cbd" '("Remove Buffer from Copilot" . copilot-chat-del-current-buffer)
|
||||||
"C" '("Open Copilot Chat" . copilot-chat-display)
|
"cbw" '("Add Workspace to Copilot" . copilot-chat-add-workspace)
|
||||||
"b" '(:ignore t :wk "Copilot (Chat) Buffers")
|
"cbf" #'copilot-chat-add-file
|
||||||
"ba" '("Add Buffer to Copilot Chat" . copilot-chat-add-current-buffer)
|
"cbb" '("List Buffers visible to Copilot" . copilot-chat-list)
|
||||||
"bd" '("Remove Buffer from Copilot Chat" . copilot-chat-del-current-buffer)
|
"cch" #'copilot-chat-hide
|
||||||
"bw" '("Add Workspace to Copilot Chat" . copilot-chat-add-workspace)
|
"ccx" #'copilot-chat-reset
|
||||||
"bf" '("Add File to Copilot Chat" . copilot-chat-add-file)
|
"ccb" #'copilot-chat-switch-to-buffer
|
||||||
"bb" '("List Buffers visible to Copilot Chat" . copilot-chat-list)
|
"ccd" #'copilot-chat-doc
|
||||||
"c" '("Copilot Chat" . nil)
|
"ccr" #'copilot-chat-review
|
||||||
"ch" '("Hide Copilot Chat" . copilot-chat-hide)
|
"ccm" #'copilot-chat-set-model
|
||||||
"cx" '("Reset Copilot Chat" . copilot-chat-reset)
|
"cy" '("Past latest code block" . copilot-chat-yank)
|
||||||
"cb" '("Switch to Copilot Chat buffer" . copilot-chat-switch-to)
|
)
|
||||||
"cd" '("Open Copilot Chat doc" . copilot-chat-doc)
|
|
||||||
"cr" '("Open Copilot Chat review" . copilot-chat-review)
|
|
||||||
"cm" '("Set Copilot Chat model" . copilot-chat-set-model)
|
|
||||||
"y" '("Paste latest code block" . copilot-chat-yank))
|
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -1814,7 +1592,7 @@ I feel so bad for this.. but its not awful..
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** COMMENT Yasnippet
|
** Yasnippet
|
||||||
Auto-completion requires yasnippet for some competions, such as function arguments and parens.
|
Auto-completion requires yasnippet for some competions, such as function arguments and parens.
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package yasnippet
|
(use-package yasnippet
|
||||||
|
|
@ -1823,7 +1601,6 @@ Auto-completion requires yasnippet for some competions, such as function argumen
|
||||||
:hook ((prog-mode text-mode) . yas-minor-mode))
|
:hook ((prog-mode text-mode) . yas-minor-mode))
|
||||||
|
|
||||||
(use-package yasnippet-snippets
|
(use-package yasnippet-snippets
|
||||||
:defer t
|
|
||||||
:straight t)
|
:straight t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
|
@ -1853,8 +1630,6 @@ Use =eglot= as an alternative to =lsp-mode=:
|
||||||
(use-package eglot
|
(use-package eglot
|
||||||
:straight t
|
:straight t
|
||||||
:hook ((rust-mode nix-mode prog-mode) . eglot-ensure)
|
:hook ((rust-mode nix-mode prog-mode) . eglot-ensure)
|
||||||
:init
|
|
||||||
(define-prefix-command 'nemo/eglot-map)
|
|
||||||
:config
|
:config
|
||||||
(add-to-list
|
(add-to-list
|
||||||
'eglot-server-programs
|
'eglot-server-programs
|
||||||
|
|
@ -1888,8 +1663,8 @@ Use =eglot= as an alternative to =lsp-mode=:
|
||||||
(setq completion-category-defaults nil))
|
(setq completion-category-defaults nil))
|
||||||
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
|
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster)
|
||||||
:general-config
|
:general-config
|
||||||
(general-def
|
(general-define-key
|
||||||
:keymaps 'nemo/eglot-map
|
:prefix-map 'nemo/eglot-command-map
|
||||||
"r r" '("Rename" . eglot-rename)
|
"r r" '("Rename" . eglot-rename)
|
||||||
"a a" '("Code Action" . eglot-code-action-quickfix)
|
"a a" '("Code Action" . eglot-code-action-quickfix)
|
||||||
"a A" '("Code Action (all)" . eglot-code-actions)
|
"a A" '("Code Action (all)" . eglot-code-actions)
|
||||||
|
|
@ -1906,7 +1681,7 @@ Use =eglot= as an alternative to =lsp-mode=:
|
||||||
)
|
)
|
||||||
(leader-major-def
|
(leader-major-def
|
||||||
:keymaps 'eglot-mode-map
|
:keymaps 'eglot-mode-map
|
||||||
"l" '("Eglot" . nemo/eglot-map)
|
"l" '(:keymap nemo/eglot-command-map :wk "Eglot")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -2150,12 +1925,11 @@ Make lsp use plists instead of hash-tables:
|
||||||
#+end_src
|
#+end_src
|
||||||
hlsl-mode:
|
hlsl-mode:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package hlsl-mode
|
(require 'hlsl-mode)
|
||||||
:straight nil
|
(with-eval-after-load 'hlsl-mode
|
||||||
:defer t
|
|
||||||
:config
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.hlsl\\'" . hlsl-mode))
|
(add-to-list 'auto-mode-alist '("\\.hlsl\\'" . hlsl-mode))
|
||||||
(add-to-list 'auto-mode-alist '("\\.frag\\'" . hlsl-mode)))
|
(add-to-list 'auto-mode-alist '("\\.frag\\'" . hlsl-mode))
|
||||||
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** =slang-mode=:
|
*** =slang-mode=:
|
||||||
|
|
@ -2427,15 +2201,14 @@ delimiters < and >'s."
|
||||||
:after (inheritenv envrc)
|
:after (inheritenv envrc)
|
||||||
;; :after (rust-mode)
|
;; :after (rust-mode)
|
||||||
:hook(rustic-mode . nemo/lsp-format-on-save-mode)
|
:hook(rustic-mode . nemo/lsp-format-on-save-mode)
|
||||||
:init
|
|
||||||
(define-prefix-command 'nemo/rust-map)
|
|
||||||
:general-config
|
:general-config
|
||||||
(general-def
|
(general-define-key
|
||||||
:keymaps 'nemo/rust-map
|
:prefix-map 'nemo/rust-map
|
||||||
"c" '("Cargo" . nil)
|
"c" '("Cargo" . nil)
|
||||||
"c v" '("Check" . rustic-cargo-check)
|
"c v" '("Check" . rustic-cargo-check)
|
||||||
"c c" '("Compile" . rustic-compile)
|
"c c" '("Compile" . rustic-compile)
|
||||||
"c b" '("Build" . rustic-cargo-build)
|
"c b" '("Build" . rustic-cargo-build)
|
||||||
|
;;"c B" '("Build" . rust-cargo-relea)
|
||||||
"c c" '("Clean" . rustic-cargo-clean)
|
"c c" '("Clean" . rustic-cargo-clean)
|
||||||
"c x" '("Run" . rustic-cargo-run)
|
"c x" '("Run" . rustic-cargo-run)
|
||||||
"c f" '("Format Buffer" . rustic-format-buffer)
|
"c f" '("Format Buffer" . rustic-format-buffer)
|
||||||
|
|
@ -2451,7 +2224,8 @@ delimiters < and >'s."
|
||||||
)
|
)
|
||||||
(leader-major-def
|
(leader-major-def
|
||||||
:keymaps 'rustic-mode-map
|
:keymaps 'rustic-mode-map
|
||||||
"m" '("Rust" . nemo/rust-map))
|
"m" '(:keymap nemo/rust-map :wk "Cargo")
|
||||||
|
)
|
||||||
:config
|
:config
|
||||||
(setq rust-mode-treesitter-derive t
|
(setq rust-mode-treesitter-derive t
|
||||||
rustic-format-on-save nil
|
rustic-format-on-save nil
|
||||||
|
|
@ -2557,32 +2331,6 @@ Use =nix-mode= to edit nix files:
|
||||||
)
|
)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Guile
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package scheme
|
|
||||||
:straight nil
|
|
||||||
:mode ("\\.scm\\'" . scheme-mode)
|
|
||||||
:hook (scheme-mode . eglot-ensure)
|
|
||||||
|
|
||||||
:config
|
|
||||||
(add-to-list 'eglot-server-programs '(scheme-mode . ("guile-lsp-server"))))
|
|
||||||
|
|
||||||
(use-package geiser
|
|
||||||
:deter t
|
|
||||||
:custom
|
|
||||||
(geiser-active-implementations '(guile)))
|
|
||||||
|
|
||||||
(use-package geiser-guile
|
|
||||||
:deter t
|
|
||||||
:after geiser
|
|
||||||
:custom
|
|
||||||
(geiser-guile-binary "guile"))
|
|
||||||
|
|
||||||
(use-package paredit
|
|
||||||
:hook ((scheme-mode . enable-paredit-mode)
|
|
||||||
(geiser-repl-mode . enable-paredit-mode)))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
* User Functions
|
* User Functions
|
||||||
=PascalCase= to =snake_case=:
|
=PascalCase= to =snake_case=:
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue