general config update, small fixes

This commit is contained in:
janis 2026-08-25 21:34:07 +02:00
parent 54a1298000
commit be949bbc1e
Signed by: janis
SSH key fingerprint: SHA256:bB1qbbqmDXZNT0KKD5c2Dfjg53JGhj7B3CFcLIzSqq8

View file

@ -210,7 +210,8 @@ Add package repositories and rank them by priority
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq-default tab-width 4 (setq-default tab-width 4
fill-column 80 fill-column 80
indent-tabs-mode nil) indent-tabs-mode nil
lexical-binding t)
(setq use-short-answers t) (setq use-short-answers t)
(setq initial-major-mode 'org-mode) (setq initial-major-mode 'org-mode)
#+end_src #+end_src
@ -558,6 +559,7 @@ TODO: figure out how to get which-key to correctly display the ‘m‘ label
"i" '("Edit init.org" . nemo/edit-init-org) "i" '("Edit init.org" . nemo/edit-init-org)
"s" '("Save" . save-buffer) "s" '("Save" . save-buffer)
"r" '("Ripgrep" . consult-ripgrep) "r" '("Ripgrep" . consult-ripgrep)
"y" '("Yank Current Filename" . nemo/buffer-file-name-to-clipboard)
"R" '("Ripgrep in dir" . nemo/consult-ripgrep-dir)) "R" '("Ripgrep in dir" . nemo/consult-ripgrep-dir))
) )
#+end_src #+end_src
@ -952,7 +954,6 @@ Also use =undo-fu=, which evil can use.
(global-set-key (kbd "<escape>") 'nemo/abort-minibuffer-if-active) (global-set-key (kbd "<escape>") 'nemo/abort-minibuffer-if-active)
#+end_src #+end_src
* Writing * Writing
** Olivetti ** Olivetti
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -984,7 +985,7 @@ Use =ispell= with company mode for completion in text-modes
:straight t :straight t
:defer t :defer t
:config :config
(setq ispell-dictionary "en_GB")) (setq ispell-dictionary "/etc/profiles/per-user/user/share/hunspell/en_GB"))
#+end_src #+end_src
** LaTeX ** LaTeX
@ -1638,7 +1639,6 @@ Use =inheritenv= and =envrc= to load ~.envrc~ direnv files:
** Copilot 😭 ** Copilot 😭
*** Copilot.el *** Copilot.el
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package copilot (use-package copilot
:straight (:host github :repo "copilot-emacs/copilot.el" :files ("*.el")) :straight (:host github :repo "copilot-emacs/copilot.el" :files ("*.el"))
@ -1814,7 +1814,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
@ -1864,22 +1864,34 @@ Use =eglot= as an alternative to =lsp-mode=:
'eglot-server-programs 'eglot-server-programs
'(just-mode '(just-mode
"just-lsp")) "just-lsp"))
(add-to-list
'eglot-server-programs
'((kotlin-mode kotlin-ts-mode) .
("kotlin-lsp" "--stdio")))
(setq-default eglot-workspace-configuration (setq-default eglot-workspace-configuration
'(:rust-analyzer '(:rust-analyzer
(:cargo (:buildScripts (:enable t) (:cargo (:buildScripts (:enable t)
:allFeatures t :allFeatures t
:features "all" :features "all"
:extraEnv (:RUSTFLAGS "-Clinker=clang -Clink-arg=-fuse-ld=mold")) :extraEnv (:RUSTFLAGS "-Clinker=clang -Clink-arg=-fuse-ld=mold"))
:check (:command "clippy") :check (:command "clippy")
:completion (:autoimport (:enable t)) :completion (:autoimport (:enable t))
:inlayHints ( :inlayHints (
;; :maxLength 20 ;; :maxLength 20
:bindingModeHints (:enable t) :bindingModeHints (:enable t)
:closureReturnTypeHints (:enable t)) :closureReturnTypeHints (:enable t))
:procMacro (:enable t))) :procMacro (:enable t)))
) )
(setq eglot-code-action-indications '(margin mode-line) (setq eglot-code-action-indications '(margin mode-line)
eglot-extend-to-xref t eglot-extend-to-xref t
eglot-connect-timeout 60
eglot-request-timeout 60
eglot-extend-to-xref t
eglot-sync-connect 0
eglot-report-progress t
eglot-autoshutdown t
;; eglot-events-buffer-config '(:size 5000 :format short)
eglot-max-file-watches 5000
completion-category-overrides '((eglot (styles orderless)) completion-category-overrides '((eglot (styles orderless))
(eglot-capf (styles orderless))) (eglot-capf (styles orderless)))
flymake-show-diagnostics-at-end-of-line 'fancy flymake-show-diagnostics-at-end-of-line 'fancy
@ -1889,21 +1901,21 @@ Use =eglot= as an alternative to =lsp-mode=:
(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-def
:keymaps 'nemo/eglot-map :keymaps 'nemo/eglot-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)
"g d" '("Go to Definition" . xref-find-definitions) "g d" '("Go to Definition" . xref-find-definitions)
"g r" '("Go to References" . xref-find-references) "g r" '("Go to References" . xref-find-references)
"g g" '("Go to Declaration" . eglot-find-declaration) "g g" '("Go to Declaration" . eglot-find-declaration)
"g i" '("Go to Implementation" . eglot-find-implementation) "g i" '("Go to Implementation" . eglot-find-implementation)
"g t" '("Go to Type Definition" . eglot-find-typeDefinition) "g t" '("Go to Type Definition" . eglot-find-typeDefinition)
"h h" '("Help" . eldoc-box-help-at-point) "h h" '("Help" . eldoc-box-help-at-point)
"w r" '("Restart Server" . eglot-reconnect) "w r" '("Restart Server" . eglot-reconnect)
"w q" '("Shutdown Server" . eglot-shutdown) "w q" '("Shutdown Server" . eglot-shutdown)
"= =" '("Format Buffer" . eglot-format-buffer) "= =" '("Format Buffer" . eglot-format-buffer)
"= r" '("Format Region" . eglot-format-region) "= r" '("Format Region" . eglot-format-region)
) )
(leader-major-def (leader-major-def
:keymaps 'eglot-mode-map :keymaps 'eglot-mode-map
"l" '("Eglot" . nemo/eglot-map) "l" '("Eglot" . nemo/eglot-map)
@ -1920,11 +1932,11 @@ Use =eglot= as an alternative to =lsp-mode=:
(use-package consult-eglot (use-package consult-eglot
:straight t :straight t
:after (consult eglot) :after eglot
:config :config
(general-define-key (general-def
:prefix-map 'nemo/eglot-command-map :keymaps 'nemo/eglot-map
"c s" '("Symbols" . consult-eglot-symbols)) "c s" '("Symbols" . consult-eglot-symbols))
) )
(use-package breadcrumb (use-package breadcrumb
@ -2568,12 +2580,12 @@ Use =nix-mode= to edit nix files:
(add-to-list 'eglot-server-programs '(scheme-mode . ("guile-lsp-server")))) (add-to-list 'eglot-server-programs '(scheme-mode . ("guile-lsp-server"))))
(use-package geiser (use-package geiser
:deter t :defer t
:custom :custom
(geiser-active-implementations '(guile))) (geiser-active-implementations '(guile)))
(use-package geiser-guile (use-package geiser-guile
:deter t :defer t
:after geiser :after geiser
:custom :custom
(geiser-guile-binary "guile")) (geiser-guile-binary "guile"))
@ -2645,6 +2657,17 @@ Open the current file with a =sudo= tramp:
) )
#+end_src #+end_src
#+begin_src emacs-lisp
(defun nemo/buffer-file-name-to-clipboard ()
"Copy the current buffer's file name to the user's clipboard"
(interactive)
(let* ((filename buffer-file-name))
(message filename)
(if filename
(kill-new (file-truename filename))))
)
#+end_src
* Keybinds * Keybinds
#+begin_src emacs-lisp #+begin_src emacs-lisp
(define-key custom-bindings-map (kbd "C-c l") 'org-store-link) (define-key custom-bindings-map (kbd "C-c l") 'org-store-link)