diff --git a/SwarselSystems.org b/SwarselSystems.org index 443233f..254bfc8 100644 --- a/SwarselSystems.org +++ b/SwarselSystems.org @@ -1537,6 +1537,10 @@ Mostly just sets some opened ports for several games, enables virtualbox (which ]; }; bluetooth.enable = true; + trackpoint = { + enable = true; + device = "TPPS/2 Elan TrackPoint"; + }; }; programs.steam = { @@ -4774,6 +4778,12 @@ Mostly used to install some compilers and lsp's that I want to have available wh rust-analyzer clippy rustfmt + # go + go + gopls + # zig + zig + zls # cpp clang-tools # + cuda @@ -8104,6 +8114,7 @@ Here I set up some things that are too minor to put under other categories. (add-hook 'prog-mode-hook 'display-line-numbers-mode) (add-hook 'text-mode-hook 'display-line-numbers-mode) + (global-visual-line-mode 1) #+end_src @@ -8692,6 +8703,8 @@ The popper package allows to declare different buffers as 'popup-type', which so "*scratch*" "*julia*" "*Python*" + "*rustic-compilation*" + "*cargo-run*" ;; ("*tex-shell*" . hide) (compilation-mode . hide))) (popper-mode +1) @@ -8704,6 +8717,8 @@ The popper package allows to declare different buffers as 'popup-type', which so ("*Occur*" :select t :popup t :align below :size 0.2) ("*scratch*" :select t :popup t :align below :size 0.2) ("*Python*" :select t :popup t :align below :size 0.2) + ("*rustic-compilation*" :select t :popup t :align below :size 0.4) + ("*cargo-run*" :select t :popup t :align below :size 0.2) ("*tex-shell*" :ignore t :popup t :align below :size 0.2) (helpful-mode :select t :popup t :align right :size 0.35) (help-mode :select t :popup t :align right :size 0.4))) @@ -9361,7 +9376,7 @@ In order to update the language grammars, run the next command below. #+end_src -*** direnv +*** direnv (envrc) :PROPERTIES: :CUSTOM_ID: h:82ddeef2-99f8-465b-ba36-07c3eaad717b :END: @@ -9698,45 +9713,13 @@ I leave the commented out alist extensions here in case I want to try them out a :CUSTOM_ID: h:3aa20438-edf6-4b13-a90d-3d5c51239c44 :END: -This is supposed to setup a rust-lsp - however, this has not worked nicely in the past and this configuration section is just a ruin really. I need to check what works and clean this up. +This sets up rustic-mode with tree-sitter support - there is still one issue to iron out with automatic adding of dependency crates, but everything else works fine now. #+begin_src emacs-lisp - ;; (use-package rustic - ;; :ensure - ;; :bind (:map rustic-mode-map - ;; ("M-j" . lsp-ui-imenu) - ;; ("M-?" . lsp-find-references) - ;; ("C-c C-c l" . flycheck-list-errors) - ;; ("C-c C-c a" . lsp-execute-code-action) - ;; ("C-c C-c r" . lsp-rename) - ;; ("C-c C-c q" . lsp-workspace-restart) - ;; ("C-c C-c Q" . lsp-workspace-shutdown) - ;; ("C-c C-c s" . lsp-rust-analyzer-status)) - ;; :config - - ;; (setq rustic-format-on-save t) - ;; (add-hook 'rustic-mode-hook 'rk/rustic-mode-hook)) - - ;; (defun rk/rustic-mode-hook () - ;; ;; so that run C-c C-c C-r works without having to confirm, but don't try to - ;; ;; save rust buffers that are not file visiting. Once - ;; ;; https://github.com/brotzeit/rustic/issues/253 has been resolved this should - ;; ;; no longer be necessary. - ;; (when buffer-file-name - ;; (setq-local buffer-save-without-query t)) - ;; (add-hook 'before-save-hook 'lsp-format-buffer nil t)) - - ;; (use-package rustic - ;; :config - ;; (setq rustic-format-on-save t) - ;; (setq rustic-lsp-client 'eglot) - ;; :custom - ;; (lsp-rust-analyzer-cargo-watch-command "clippy") - ;; (lsp-rust-analyzer-server-display-inlay-hints t) - ;; :mode ("\\.rs" . rustic-mode)) - (use-package rustic + :init + (setq rust-mode-treesitter-derive t) :config (setq rustic-format-on-save t) (setq rustic-lsp-client 'eglot) @@ -9899,7 +9882,7 @@ The following block is mostly inspired from [[https://code.kulupu.party/thesuess :CUSTOM_ID: h:316857e7-4df8-4ec5-b22e-6dac918fa937 :END: -After having tried out =lsp-mode= and =lsp-bridge= for a while each, I must say that =eglot= feels the most clean and fast to me. Rust-modes need a little extra care to get working here. +After having tried out =lsp-mode= and =lsp-bridge= for a while each, I must say that =eglot= feels the most clean and fast to me. :PROPERTIES: :CUSTOM_ID: h:424fbc62-84e2-42c7-a1ca-e43ea04c43e5 @@ -9916,6 +9899,8 @@ After having tried out =lsp-mode= and =lsp-bridge= for a while each, I must say c-ts-mode c++-mode c++-ts-mode + rustic-mode + rust-ts-mode tex-mode LaTeX-mode ) . (lambda () (progn @@ -9924,12 +9909,6 @@ After having tried out =lsp-mode= and =lsp-bridge= for a while each, I must say :custom (eldoc-echo-area-use-multiline-p nil) (completion-category-defaults nil) - :config - ;; (push '(rustic-ts-mode . eglot-rust-analyzer) eglot-server-programs) - (push '(rustic-mode . eglot-rust-analyzer) eglot-server-programs) - (add-to-list 'eglot-server-programs '((rust-mode) . (eglot-rust-analyzer "rust-analyzer"))) - ;; (add-to-list 'eglot-server-programs '((python-mode) . ("pylsp"))) - ;; (add-to-list 'eglot-server-programs '((c-mode) . ("clangd"))) :bind (:map eglot-mode-map ("M-(" . flymake-goto-next-error) ("C-c ," . eglot-code-actions))) diff --git a/index.html b/index.html index 57b9c52..c6ea438 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + SwarselSystems: NixOS + Emacs Configuration @@ -332,7 +332,7 @@

Table of Contents

  • 4.4.5. darkroom
  • 4.4.6. Ripgrep
  • 4.4.7. Tree-sitter
  • -
  • 4.4.8. direnv
  • +
  • 4.4.8. direnv (envrc)
  • 4.4.9. avy
  • 4.4.10. crdt (Collaborative Editing)
  • 4.4.11. devdocs
  • @@ -369,7 +369,7 @@

    Table of Contents

    -This file has 40644 words spanning 10489 lines and was last revised on 2024-06-20 18:10:32 +0200. +This file has 40441 words spanning 10468 lines and was last revised on 2024-06-28 00:09:44 +0200.

    @@ -419,7 +419,7 @@

    1

    -My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-06-20 18:10:32 +0200) +My emacs is built using the emacs-overlay nix flake, which builds a bleeding edge emacs on wayland (pgtk) with utilities like treesitter support. By executing the below source block, the current build setting can be updated at any time, and you can see my most up-to-date build options (last updated: 2024-06-28 00:09:44 +0200)

    @@ -2463,6 +2463,10 @@

    3 ]; }; bluetooth.enable = true; + trackpoint = { + enable = true; + device = "TPPS/2 Elan TrackPoint"; + }; }; programs.steam = { @@ -5971,6 +5975,12 @@

    3 rust-analyzer clippy rustfmt + # go + go + gopls + # zig + zig + zls # cpp clang-tools # + cuda @@ -9868,6 +9878,7 @@

    4 (add-hook 'prog-mode-hook 'display-line-numbers-mode) (add-hook 'text-mode-hook 'display-line-numbers-mode) +(global-visual-line-mode 1) @@ -10543,6 +10554,8 @@

    4 "*scratch*" "*julia*" "*Python*" + "*rustic-compilation*" + "*cargo-run*" ;; ("*tex-shell*" . hide) (compilation-mode . hide))) (popper-mode +1) @@ -10555,6 +10568,8 @@

    4 ("*Occur*" :select t :popup t :align below :size 0.2) ("*scratch*" :select t :popup t :align below :size 0.2) ("*Python*" :select t :popup t :align below :size 0.2) + ("*rustic-compilation*" :select t :popup t :align below :size 0.4) + ("*cargo-run*" :select t :popup t :align below :size 0.2) ("*tex-shell*" :ignore t :popup t :align below :size 0.2) (helpful-mode :select t :popup t :align right :size 0.35) (help-mode :select t :popup t :align right :size 0.4))) @@ -11291,7 +11306,7 @@

    4
    -

    4.4.8. direnv

    +

    4.4.8. direnv (envrc)

    @@ -11678,46 +11693,14 @@ 

    4

    4.4.20. rust

    -This is supposed to setup a rust-lsp - however, this has not worked nicely in the past and this configuration section is just a ruin really. I need to check what works and clean this up. +This sets up rustic-mode with tree-sitter support - there is still one issue to iron out with automatic adding of dependency crates, but everything else works fine now.

    -  ;; (use-package rustic
    -  ;;   :ensure
    -  ;;   :bind (:map rustic-mode-map
    -  ;;               ("M-j" . lsp-ui-imenu)
    -  ;;               ("M-?" . lsp-find-references)
    -  ;;               ("C-c C-c l" . flycheck-list-errors)
    -  ;;               ("C-c C-c a" . lsp-execute-code-action)
    -  ;;               ("C-c C-c r" . lsp-rename)
    -  ;;               ("C-c C-c q" . lsp-workspace-restart)
    -  ;;               ("C-c C-c Q" . lsp-workspace-shutdown)
    -  ;;               ("C-c C-c s" . lsp-rust-analyzer-status))
    -  ;;   :config
    -
    -  ;;   (setq rustic-format-on-save t)
    -  ;;   (add-hook 'rustic-mode-hook 'rk/rustic-mode-hook))
    -
    -;;   (defun rk/rustic-mode-hook ()
    -;;     ;; so that run C-c C-c C-r works without having to confirm, but don't try to
    -;;     ;; save rust buffers that are not file visiting. Once
    -;;     ;; https://github.com/brotzeit/rustic/issues/253 has been resolved this should
    -;;     ;; no longer be necessary.
    -;;     (when buffer-file-name
    -;;       (setq-local buffer-save-without-query t))
    -;;     (add-hook 'before-save-hook 'lsp-format-buffer nil t))
    -
    -;; (use-package rustic
    -;;   :config
    -;;   (setq rustic-format-on-save t)
    -;;   (setq rustic-lsp-client 'eglot)
    -;;   :custom
    -;;   (lsp-rust-analyzer-cargo-watch-command "clippy")
    -;;   (lsp-rust-analyzer-server-display-inlay-hints t)
    -;;   :mode ("\\.rs" . rustic-mode))
    -
     (use-package rustic
    +  :init
    +  (setq rust-mode-treesitter-derive t)
       :config
       (setq rustic-format-on-save t)
       (setq rustic-lsp-client 'eglot)
    @@ -11902,7 +11885,7 @@ 

    4

    4.4.25. eglot

    -After having tried out lsp-mode and lsp-bridge for a while each, I must say that eglot feels the most clean and fast to me. Rust-modes need a little extra care to get working here. +After having tried out lsp-mode and lsp-bridge for a while each, I must say that eglot feels the most clean and fast to me.

    @@ -11920,6 +11903,8 @@

    4 c-ts-mode c++-mode c++-ts-mode + rustic-mode + rust-ts-mode tex-mode LaTeX-mode ) . (lambda () (progn @@ -11928,12 +11913,6 @@

    4 :custom (eldoc-echo-area-use-multiline-p nil) (completion-category-defaults nil) - :config - ;; (push '(rustic-ts-mode . eglot-rust-analyzer) eglot-server-programs) - (push '(rustic-mode . eglot-rust-analyzer) eglot-server-programs) - (add-to-list 'eglot-server-programs '((rust-mode) . (eglot-rust-analyzer "rust-analyzer"))) - ;; (add-to-list 'eglot-server-programs '((python-mode) . ("pylsp"))) - ;; (add-to-list 'eglot-server-programs '((c-mode) . ("clangd"))) :bind (:map eglot-mode-map ("M-(" . flymake-goto-next-error) ("C-c ," . eglot-code-actions))) @@ -12567,7 +12546,7 @@

    4

    Author: Leon Schwarzäugl

    -

    Created: 2024-06-20 Do 18:10

    +

    Created: 2024-06-28 Fr 00:09

    Validate

    diff --git a/profiles/common/nixos.nix b/profiles/common/nixos.nix index ca31179..830730f 100644 --- a/profiles/common/nixos.nix +++ b/profiles/common/nixos.nix @@ -108,6 +108,12 @@ environment.systemPackages = with pkgs; [ rust-analyzer clippy rustfmt + # go + go + gopls + # zig + zig + zls # cpp clang-tools # + cuda diff --git a/profiles/fourside/nixos.nix b/profiles/fourside/nixos.nix index 32dcffa..0d1c118 100644 --- a/profiles/fourside/nixos.nix +++ b/profiles/fourside/nixos.nix @@ -115,6 +115,10 @@ ]; }; bluetooth.enable = true; + trackpoint = { + enable = true; + device = "TPPS/2 Elan TrackPoint"; + }; }; programs.steam = { diff --git a/programs/emacs/init.el b/programs/emacs/init.el index a085531..f82a4e3 100644 --- a/programs/emacs/init.el +++ b/programs/emacs/init.el @@ -444,6 +444,7 @@ create a new one." (add-hook 'prog-mode-hook 'display-line-numbers-mode) (add-hook 'text-mode-hook 'display-line-numbers-mode) +(global-visual-line-mode 1) (setq custom-safe-themes t) @@ -726,6 +727,8 @@ create a new one." "*scratch*" "*julia*" "*Python*" + "*rustic-compilation*" + "*cargo-run*" ;; ("*tex-shell*" . hide) (compilation-mode . hide))) (popper-mode +1) @@ -738,6 +741,8 @@ create a new one." ("*Occur*" :select t :popup t :align below :size 0.2) ("*scratch*" :select t :popup t :align below :size 0.2) ("*Python*" :select t :popup t :align below :size 0.2) + ("*rustic-compilation*" :select t :popup t :align below :size 0.4) + ("*cargo-run*" :select t :popup t :align below :size 0.2) ("*tex-shell*" :ignore t :popup t :align below :size 0.2) (helpful-mode :select t :popup t :align right :size 0.35) (help-mode :select t :popup t :align right :size 0.4))) @@ -1277,41 +1282,9 @@ create a new one." ;; (add-to-list 'completion-at-point-functions #'cape-line) ) -;; (use-package rustic - ;; :ensure - ;; :bind (:map rustic-mode-map - ;; ("M-j" . lsp-ui-imenu) - ;; ("M-?" . lsp-find-references) - ;; ("C-c C-c l" . flycheck-list-errors) - ;; ("C-c C-c a" . lsp-execute-code-action) - ;; ("C-c C-c r" . lsp-rename) - ;; ("C-c C-c q" . lsp-workspace-restart) - ;; ("C-c C-c Q" . lsp-workspace-shutdown) - ;; ("C-c C-c s" . lsp-rust-analyzer-status)) - ;; :config - - ;; (setq rustic-format-on-save t) - ;; (add-hook 'rustic-mode-hook 'rk/rustic-mode-hook)) - -;; (defun rk/rustic-mode-hook () -;; ;; so that run C-c C-c C-r works without having to confirm, but don't try to -;; ;; save rust buffers that are not file visiting. Once -;; ;; https://github.com/brotzeit/rustic/issues/253 has been resolved this should -;; ;; no longer be necessary. -;; (when buffer-file-name -;; (setq-local buffer-save-without-query t)) -;; (add-hook 'before-save-hook 'lsp-format-buffer nil t)) - -;; (use-package rustic -;; :config -;; (setq rustic-format-on-save t) -;; (setq rustic-lsp-client 'eglot) -;; :custom -;; (lsp-rust-analyzer-cargo-watch-command "clippy") -;; (lsp-rust-analyzer-server-display-inlay-hints t) -;; :mode ("\\.rs" . rustic-mode)) - (use-package rustic + :init + (setq rust-mode-treesitter-derive t) :config (setq rustic-format-on-save t) (setq rustic-lsp-client 'eglot) @@ -1413,6 +1386,8 @@ create a new one." c-ts-mode c++-mode c++-ts-mode + rustic-mode + rust-ts-mode tex-mode LaTeX-mode ) . (lambda () (progn @@ -1421,12 +1396,6 @@ create a new one." :custom (eldoc-echo-area-use-multiline-p nil) (completion-category-defaults nil) - :config - ;; (push '(rustic-ts-mode . eglot-rust-analyzer) eglot-server-programs) - (push '(rustic-mode . eglot-rust-analyzer) eglot-server-programs) - (add-to-list 'eglot-server-programs '((rust-mode) . (eglot-rust-analyzer "rust-analyzer"))) - ;; (add-to-list 'eglot-server-programs '((python-mode) . ("pylsp"))) - ;; (add-to-list 'eglot-server-programs '((c-mode) . ("clangd"))) :bind (:map eglot-mode-map ("M-(" . flymake-goto-next-error) ("C-c ," . eglot-code-actions)))