This commit is contained in:
Mateusz Słodkowicz 2024-12-05 16:00:58 +01:00
parent a69bbcbf6a
commit 730482c98b
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
3 changed files with 113 additions and 48 deletions

View File

@ -131,6 +131,11 @@ let
embark embark
embark-consult embark-consult
ef-themes ef-themes
pdf-tools
minimap
geiser-guile
fennel-mode
paredit
# Completions & Minibuffer # Completions & Minibuffer
corfu corfu
corfu-terminal corfu-terminal
@ -144,6 +149,12 @@ let
emacsEnv = pkgs.buildEnv { emacsEnv = pkgs.buildEnv {
name = "emacs-env"; name = "emacs-env";
paths = with pkgs; [ paths = with pkgs; [
luaformatter
(luajit.withPackages (p: [p.fennel p.lua-lsp]))
fennel-ls
fnlfmt
guile
plantuml plantuml
mermaid-cli mermaid-cli
pyright pyright
@ -153,7 +164,6 @@ let
gnumake gnumake
nixfmt-rfc-style nixfmt-rfc-style
python3Full python3Full
lua
multimarkdown multimarkdown
git git
emacs-lsp-booster emacs-lsp-booster
@ -169,7 +179,7 @@ let
fpc fpc
nodejs nodejs
omnisharp-roslyn omnisharp-roslyn
texlive.combined.scheme-basic texlive.combined.scheme-full
]; ];
}; };

View File

@ -43,7 +43,7 @@ My emacs config, tangled file is [[file:etc/materus/emacs-config.el][there]]
- [[#projectile][Projectile]] - [[#projectile][Projectile]]
- [[#treemacs][Treemacs]] - [[#treemacs][Treemacs]]
- [[#magit][Magit]] - [[#magit][Magit]]
- [[#dirvish][Dirvish]] - [[#dirvish--dired][Dirvish / Dired]]
- [[#perspective][Perspective]] - [[#perspective][Perspective]]
- [[#programming][Programming]] - [[#programming][Programming]]
- [[#lsp][LSP]] - [[#lsp][LSP]]
@ -518,6 +518,19 @@ Org mode settings
:hook :hook
((org-mode . toc-org-mode ) ((org-mode . toc-org-mode )
(markdown-mode . toc-org-mode))) (markdown-mode . toc-org-mode)))
(setq org-latex-pdf-process '("latexmk -xelatex -quiet -shell-escape -f -output-directory=%o %f"))
(org-babel-do-load-languages
'org-babel-load-languages
'((latex . t)
(emacs-lisp . t)
(shell . t)
(css . t)
(C . t)
(calc . t)
(awk . t)
(sql . t)
(sqlite . t)))
#+end_SRC #+end_SRC
** Completions ** Completions
*** Style *** Style
@ -668,10 +681,12 @@ Other configs
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package magit) (use-package magit)
#+end_src #+end_src
*** Dirvish *** Dirvish / Dired
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq dired-mouse-drag-files t)
(use-package dirvish (use-package dirvish
:config (dirvish-override-dired-mode 1) :config
(dirvish-override-dired-mode 1)
(setq dirvish-attributes (setq dirvish-attributes
'(vc-state '(vc-state
subtree-state subtree-state
@ -684,7 +699,8 @@ Other configs
*** Perspective *** Perspective
#+begin_src emacs-lisp #+begin_src emacs-lisp
(require 'perspective) (require 'perspective)
(customize-set-variable 'persp-mode-prefix-key (kbd "C-c M-p")) (setq persp-mode-prefix-key (kbd "C-c M-p"))
(setq persp-modestring-short t)
(persp-mode 1) (persp-mode 1)
#+end_src #+end_src
@ -695,6 +711,7 @@ Other configs
:custom :custom
(lsp-completion-provider :none) ;; we use Corfu! (lsp-completion-provider :none) ;; we use Corfu!
:config :config
(setq lsp-keep-workspace-alive nil)
(require 'lsp-ui) (require 'lsp-ui)
:init :init
(defun materus/orderless-dispatch-flex-first (_pattern index _total) (defun materus/orderless-dispatch-flex-first (_pattern index _total)
@ -775,10 +792,10 @@ Other configs
(add-hook 'nix-mode-hook 'lsp-deferred) (add-hook 'nix-mode-hook 'lsp-deferred)
(add-hook 'nix-mode-hook 'display-line-numbers-mode) (add-hook 'nix-mode-hook 'display-line-numbers-mode)
;;(add-hook 'nix-ts-mode-hook 'lsp-deferred) (add-hook 'nix-ts-mode-hook 'lsp-deferred)
;;(add-hook 'nix-ts-mode-hook 'display-line-numbers-mode) (add-hook 'nix-ts-mode-hook 'display-line-numbers-mode)
;;(when (treesit-language-available-p 'nix) (push '(nix-mode . nix-ts-mode) major-mode-remap-alist)) (when (treesit-language-available-p 'nix) (push '(nix-mode . nix-ts-mode) major-mode-remap-alist))
#+end_src #+end_src
** Emacs Lisp ** Emacs Lisp
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -791,26 +808,28 @@ Other configs
(add-hook 'c-mode-hook 'lsp-deferred) (add-hook 'c-mode-hook 'lsp-deferred)
(add-hook 'c-mode-hook 'display-line-numbers-mode) (add-hook 'c-mode-hook 'display-line-numbers-mode)
;(add-hook 'c-ts-mode-hook 'lsp-deferred) (add-hook 'c-ts-mode-hook 'lsp-deferred)
;(add-hook 'c-ts-mode-hook 'display-line-numbers-mode) (add-hook 'c-ts-mode-hook 'display-line-numbers-mode)
(add-hook 'c++-mode-hook 'lsp-deferred) (add-hook 'c++-mode-hook 'lsp-deferred)
(add-hook 'c++-mode-hook 'display-line-numbers-mode) (add-hook 'c++-mode-hook 'display-line-numbers-mode)
;(add-hook 'c++-ts-mode-hook 'lsp-deferred) (add-hook 'c++-ts-mode-hook 'lsp-deferred)
;(add-hook 'c++-ts-mode-hook 'display-line-numbers-mode) (add-hook 'c++-ts-mode-hook 'display-line-numbers-mode)
;(when (treesit-language-available-p 'c) (push '(c-mode . c-ts-mode) major-mode-remap-alist)) (when (treesit-language-available-p 'c) (push '(c-mode . c-ts-mode) major-mode-remap-alist))
;(when (treesit-language-available-p 'cpp) (push '(c++-mode . c++-ts-mode) major-mode-remap-alist)) (when (treesit-language-available-p 'cpp) (push '(c++-mode . c++-ts-mode) major-mode-remap-alist))
(add-to-list 'c-default-style '(c-mode . "bsd")) (add-to-list 'c-default-style '(c-mode . "bsd"))
(add-to-list 'c-default-style '(c++-mode . "bsd")) (add-to-list 'c-default-style '(c++-mode . "bsd"))
;(add-to-list 'c-default-style '(c-ts-mode . "bsd")) (add-to-list 'c-default-style '(c-ts-mode . "bsd"))
;(add-to-list 'c-default-style '(c++-ts-mode . "bsd")) (add-to-list 'c-default-style '(c++-ts-mode . "bsd"))
#+end_src #+end_src
** Python ** Python
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package lsp-pyright) (use-package lsp-pyright)
(setq lsp-pyright-langserver-command "pyright") (setq lsp-pyright-langserver-command "pyright")
(add-hook 'python-mode-hook 'lsp-deferred) (add-hook 'python-mode-hook 'lsp-deferred)
(add-hook 'python-ts-mode-hook 'lsp-deferred)
(when (treesit-language-available-p 'python) (push '(python-mode . python-ts-mode) major-mode-remap-alist))
#+end_src #+end_src
** Java ** Java
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -820,11 +839,11 @@ Other configs
(add-hook 'java-mode-hook 'lsp-deferred) (add-hook 'java-mode-hook 'lsp-deferred)
(add-hook 'java-mode-hook 'display-line-numbers-mode) (add-hook 'java-mode-hook 'display-line-numbers-mode)
;(add-hook 'java-ts-mode-hook (lambda () (when (getenv "JDTLS_PATH") (setq lsp-java-server-install-dir (getenv "JDTLS_PATH"))))) (add-hook 'java-ts-mode-hook (lambda () (when (getenv "JDTLS_PATH") (setq lsp-java-server-install-dir (getenv "JDTLS_PATH")))))
;(add-hook 'java-ts-mode-hook 'lsp-deferred) (add-hook 'java-ts-mode-hook 'lsp-deferred)
;(add-hook 'java-ts-mode-hook 'display-line-numbers-mode) (add-hook 'java-ts-mode-hook 'display-line-numbers-mode)
;(when (treesit-language-available-p 'java) (push '(java-mode . java-ts-mode) major-mode-remap-alist)) (when (treesit-language-available-p 'java) (push '(java-mode . java-ts-mode) major-mode-remap-alist))
(add-to-list 'c-default-style '(java-mode . "java")) (add-to-list 'c-default-style '(java-mode . "java"))
(add-to-list 'c-default-style '(java-ts-mode . "java")) (add-to-list 'c-default-style '(java-ts-mode . "java"))
@ -840,7 +859,12 @@ Other configs
(setq-default c-basic-offset 4) (setq-default c-basic-offset 4)
(setq-default c-indent-level 4) (setq-default c-indent-level 4)
(setq-default c-ts-mode-indent-offset 4)
(setq-default c-ts-mode-indent-style 'bsd)
(setq-default c-hungry-delete-key t) (setq-default c-hungry-delete-key t)
(electric-pair-mode 1) (electric-pair-mode 1)
(electric-indent-mode -1) (electric-indent-mode -1)
(setq-default tab-width 4) (setq-default tab-width 4)
@ -859,13 +883,15 @@ Other configs
;; Eat Term ;; Eat Term
(define-key cua--eat-semi-char-keymap (kbd "C-v") #'eat-yank) (define-key cua--eat-semi-char-keymap (kbd "C-v") #'eat-yank)
(define-key cua--eat-char-keymap (kbd "C-S-v") #'eat-yank) (define-key cua--eat-char-keymap (kbd "C-S-v") #'eat-yank)
(define-key cua--eat-semi-char-keymap (kbd "C-c") #'copy-region-as-kill)
(define-key cua--eat-char-keymap (kbd "C-S-c") #'copy-region-as-kill)
(define-key eat-mode-map (kbd "C-<right>") #'eat-self-input) (define-key eat-mode-map (kbd "C-<right>") #'eat-self-input)
(define-key eat-mode-map (kbd "C-<left>") #'eat-self-input) (define-key eat-mode-map (kbd "C-<left>") #'eat-self-input)
;; perspective ;; perspective
(define-key global-map (kbd "C-x C-b") 'persp-list-buffers) (define-key global-map (kbd "C-x C-b") #'persp-list-buffers)
(define-key global-map (kbd "C-x C-B") 'list-buffers) (define-key global-map (kbd "C-x C-B") #'list-buffers)
(define-key global-map (kbd "C-x b") 'persp-switch-to-buffer) (define-key global-map (kbd "C-x b") #'persp-switch-to-buffer*)
(define-key global-map (kbd "C-x B") 'consult-buffer) (define-key global-map (kbd "C-x B") #'consult-buffer)
;; CUA-like global ;; CUA-like global
(define-key global-map (kbd "C-s") 'save-buffer) (define-key global-map (kbd "C-s") 'save-buffer)
(define-key global-map (kbd "C-r") 'query-replace) (define-key global-map (kbd "C-r") 'query-replace)
@ -972,6 +998,8 @@ Just for testing some code
;;; (set-window-margins (selected-window) 0 0) ;;; (set-window-margins (selected-window) 0 0)
;;; (buffer-local-value 'var (get-buffer "your-buffer-name"))
;;; (setq completion-styles '(orderless basic) ;;; (setq completion-styles '(orderless basic)
;;; completion-category-defaults nil ;;; completion-category-defaults nil
;;; completion-category-overrides '((file (styles partial-completion)))) ;;; completion-category-overrides '((file (styles partial-completion))))

View File

@ -304,6 +304,18 @@
:hook :hook
((org-mode . toc-org-mode ) ((org-mode . toc-org-mode )
(markdown-mode . toc-org-mode))) (markdown-mode . toc-org-mode)))
(setq org-latex-pdf-process '("latexmk -xelatex -quiet -shell-escape -f -output-directory=%o %f"))
(org-babel-do-load-languages
'org-babel-load-languages
'((latex . t)
(emacs-lisp . t)
(shell . t)
(css . t)
(C . t)
(calc . t)
(awk . t)
(sql . t)
(sqlite . t)))
;; Org-mode:1 ends here ;; Org-mode:1 ends here
;; [[file:../../emacs-materus-config.org::*Style][Style:1]] ;; [[file:../../emacs-materus-config.org::*Style][Style:1]]
@ -448,9 +460,11 @@
(use-package magit) (use-package magit)
;; Magit:1 ends here ;; Magit:1 ends here
;; [[file:../../emacs-materus-config.org::*Dirvish][Dirvish:1]] ;; [[file:../../emacs-materus-config.org::*Dirvish / Dired][Dirvish / Dired:1]]
(setq dired-mouse-drag-files t)
(use-package dirvish (use-package dirvish
:config (dirvish-override-dired-mode 1) :config
(dirvish-override-dired-mode 1)
(setq dirvish-attributes (setq dirvish-attributes
'(vc-state '(vc-state
subtree-state subtree-state
@ -459,11 +473,12 @@
git-msg git-msg
file-time file-time
file-size))) file-size)))
;; Dirvish:1 ends here ;; Dirvish / Dired:1 ends here
;; [[file:../../emacs-materus-config.org::*Perspective][Perspective:1]] ;; [[file:../../emacs-materus-config.org::*Perspective][Perspective:1]]
(require 'perspective) (require 'perspective)
(customize-set-variable 'persp-mode-prefix-key (kbd "C-c M-p")) (setq persp-mode-prefix-key (kbd "C-c M-p"))
(setq persp-modestring-short t)
(persp-mode 1) (persp-mode 1)
;; Perspective:1 ends here ;; Perspective:1 ends here
@ -472,6 +487,7 @@
:custom :custom
(lsp-completion-provider :none) ;; we use Corfu! (lsp-completion-provider :none) ;; we use Corfu!
:config :config
(setq lsp-keep-workspace-alive nil)
(require 'lsp-ui) (require 'lsp-ui)
:init :init
(defun materus/orderless-dispatch-flex-first (_pattern index _total) (defun materus/orderless-dispatch-flex-first (_pattern index _total)
@ -551,10 +567,10 @@
(add-hook 'nix-mode-hook 'lsp-deferred) (add-hook 'nix-mode-hook 'lsp-deferred)
(add-hook 'nix-mode-hook 'display-line-numbers-mode) (add-hook 'nix-mode-hook 'display-line-numbers-mode)
;;(add-hook 'nix-ts-mode-hook 'lsp-deferred) (add-hook 'nix-ts-mode-hook 'lsp-deferred)
;;(add-hook 'nix-ts-mode-hook 'display-line-numbers-mode) (add-hook 'nix-ts-mode-hook 'display-line-numbers-mode)
;;(when (treesit-language-available-p 'nix) (push '(nix-mode . nix-ts-mode) major-mode-remap-alist)) (when (treesit-language-available-p 'nix) (push '(nix-mode . nix-ts-mode) major-mode-remap-alist))
;; Nix:1 ends here ;; Nix:1 ends here
;; [[file:../../emacs-materus-config.org::*Emacs Lisp][Emacs Lisp:1]] ;; [[file:../../emacs-materus-config.org::*Emacs Lisp][Emacs Lisp:1]]
@ -567,26 +583,28 @@
(add-hook 'c-mode-hook 'lsp-deferred) (add-hook 'c-mode-hook 'lsp-deferred)
(add-hook 'c-mode-hook 'display-line-numbers-mode) (add-hook 'c-mode-hook 'display-line-numbers-mode)
;(add-hook 'c-ts-mode-hook 'lsp-deferred) (add-hook 'c-ts-mode-hook 'lsp-deferred)
;(add-hook 'c-ts-mode-hook 'display-line-numbers-mode) (add-hook 'c-ts-mode-hook 'display-line-numbers-mode)
(add-hook 'c++-mode-hook 'lsp-deferred) (add-hook 'c++-mode-hook 'lsp-deferred)
(add-hook 'c++-mode-hook 'display-line-numbers-mode) (add-hook 'c++-mode-hook 'display-line-numbers-mode)
;(add-hook 'c++-ts-mode-hook 'lsp-deferred) (add-hook 'c++-ts-mode-hook 'lsp-deferred)
;(add-hook 'c++-ts-mode-hook 'display-line-numbers-mode) (add-hook 'c++-ts-mode-hook 'display-line-numbers-mode)
;(when (treesit-language-available-p 'c) (push '(c-mode . c-ts-mode) major-mode-remap-alist)) (when (treesit-language-available-p 'c) (push '(c-mode . c-ts-mode) major-mode-remap-alist))
;(when (treesit-language-available-p 'cpp) (push '(c++-mode . c++-ts-mode) major-mode-remap-alist)) (when (treesit-language-available-p 'cpp) (push '(c++-mode . c++-ts-mode) major-mode-remap-alist))
(add-to-list 'c-default-style '(c-mode . "bsd")) (add-to-list 'c-default-style '(c-mode . "bsd"))
(add-to-list 'c-default-style '(c++-mode . "bsd")) (add-to-list 'c-default-style '(c++-mode . "bsd"))
;(add-to-list 'c-default-style '(c-ts-mode . "bsd")) (add-to-list 'c-default-style '(c-ts-mode . "bsd"))
;(add-to-list 'c-default-style '(c++-ts-mode . "bsd")) (add-to-list 'c-default-style '(c++-ts-mode . "bsd"))
;; C/C++:1 ends here ;; C/C++:1 ends here
;; [[file:../../emacs-materus-config.org::*Python][Python:1]] ;; [[file:../../emacs-materus-config.org::*Python][Python:1]]
(use-package lsp-pyright) (use-package lsp-pyright)
(setq lsp-pyright-langserver-command "pyright") (setq lsp-pyright-langserver-command "pyright")
(add-hook 'python-mode-hook 'lsp-deferred) (add-hook 'python-mode-hook 'lsp-deferred)
(add-hook 'python-ts-mode-hook 'lsp-deferred)
(when (treesit-language-available-p 'python) (push '(python-mode . python-ts-mode) major-mode-remap-alist))
;; Python:1 ends here ;; Python:1 ends here
;; [[file:../../emacs-materus-config.org::*Java][Java:1]] ;; [[file:../../emacs-materus-config.org::*Java][Java:1]]
@ -596,11 +614,11 @@
(add-hook 'java-mode-hook 'lsp-deferred) (add-hook 'java-mode-hook 'lsp-deferred)
(add-hook 'java-mode-hook 'display-line-numbers-mode) (add-hook 'java-mode-hook 'display-line-numbers-mode)
;(add-hook 'java-ts-mode-hook (lambda () (when (getenv "JDTLS_PATH") (setq lsp-java-server-install-dir (getenv "JDTLS_PATH"))))) (add-hook 'java-ts-mode-hook (lambda () (when (getenv "JDTLS_PATH") (setq lsp-java-server-install-dir (getenv "JDTLS_PATH")))))
;(add-hook 'java-ts-mode-hook 'lsp-deferred) (add-hook 'java-ts-mode-hook 'lsp-deferred)
;(add-hook 'java-ts-mode-hook 'display-line-numbers-mode) (add-hook 'java-ts-mode-hook 'display-line-numbers-mode)
;(when (treesit-language-available-p 'java) (push '(java-mode . java-ts-mode) major-mode-remap-alist)) (when (treesit-language-available-p 'java) (push '(java-mode . java-ts-mode) major-mode-remap-alist))
(add-to-list 'c-default-style '(java-mode . "java")) (add-to-list 'c-default-style '(java-mode . "java"))
(add-to-list 'c-default-style '(java-ts-mode . "java")) (add-to-list 'c-default-style '(java-ts-mode . "java"))
@ -615,7 +633,12 @@
(setq-default c-basic-offset 4) (setq-default c-basic-offset 4)
(setq-default c-indent-level 4) (setq-default c-indent-level 4)
(setq-default c-ts-mode-indent-offset 4)
(setq-default c-ts-mode-indent-style 'bsd)
(setq-default c-hungry-delete-key t) (setq-default c-hungry-delete-key t)
(electric-pair-mode 1) (electric-pair-mode 1)
(electric-indent-mode -1) (electric-indent-mode -1)
(setq-default tab-width 4) (setq-default tab-width 4)
@ -632,13 +655,15 @@
;; Eat Term ;; Eat Term
(define-key cua--eat-semi-char-keymap (kbd "C-v") #'eat-yank) (define-key cua--eat-semi-char-keymap (kbd "C-v") #'eat-yank)
(define-key cua--eat-char-keymap (kbd "C-S-v") #'eat-yank) (define-key cua--eat-char-keymap (kbd "C-S-v") #'eat-yank)
(define-key cua--eat-semi-char-keymap (kbd "C-c") #'copy-region-as-kill)
(define-key cua--eat-char-keymap (kbd "C-S-c") #'copy-region-as-kill)
(define-key eat-mode-map (kbd "C-<right>") #'eat-self-input) (define-key eat-mode-map (kbd "C-<right>") #'eat-self-input)
(define-key eat-mode-map (kbd "C-<left>") #'eat-self-input) (define-key eat-mode-map (kbd "C-<left>") #'eat-self-input)
;; perspective ;; perspective
(define-key global-map (kbd "C-x C-b") 'persp-list-buffers) (define-key global-map (kbd "C-x C-b") #'persp-list-buffers)
(define-key global-map (kbd "C-x C-B") 'list-buffers) (define-key global-map (kbd "C-x C-B") #'list-buffers)
(define-key global-map (kbd "C-x b") 'persp-switch-to-buffer) (define-key global-map (kbd "C-x b") #'persp-switch-to-buffer*)
(define-key global-map (kbd "C-x B") 'consult-buffer) (define-key global-map (kbd "C-x B") #'consult-buffer)
;; CUA-like global ;; CUA-like global
(define-key global-map (kbd "C-s") 'save-buffer) (define-key global-map (kbd "C-s") 'save-buffer)
(define-key global-map (kbd "C-r") 'query-replace) (define-key global-map (kbd "C-r") 'query-replace)
@ -735,6 +760,8 @@
;;; (set-window-margins (selected-window) 0 0) ;;; (set-window-margins (selected-window) 0 0)
;;; (buffer-local-value 'var (get-buffer "your-buffer-name"))
;;; (setq completion-styles '(orderless basic) ;;; (setq completion-styles '(orderless basic)
;;; completion-category-defaults nil ;;; completion-category-defaults nil
;;; completion-category-overrides '((file (styles partial-completion)))) ;;; completion-category-overrides '((file (styles partial-completion))))