diff --git a/flake.lock b/flake.lock index 5b36cfe..665943e 100644 --- a/flake.lock +++ b/flake.lock @@ -25,11 +25,11 @@ ] }, "locked": { - "lastModified": 1779213149, - "narHash": "sha256-Cf+p/T4Z3n9Sw0TiR3kQaIwQI+/hfvLJcoTzeq6yS3E=", + "lastModified": 1779969295, + "narHash": "sha256-HwIJ3tOcwSMiV75L7KqJXciXR9UfT+d7rwOZMX7cTnA=", "owner": "nix-community", "repo": "home-manager", - "rev": "bd868f769a69d3b6091a1da68a75cb83a181033c", + "rev": "61e2c9659324181e0f0ed911958c536333b1d4f6", "type": "github" }, "original": { @@ -65,11 +65,11 @@ ] }, "locked": { - "lastModified": 1778999127, - "narHash": "sha256-V5GquqJvAqwFTcpN6hxKSQAtwuJFRUEHmyNKbeaTQDg=", + "lastModified": 1779604987, + "narHash": "sha256-ZQ5z+fVhxYKtIFwtqGp5O0PD84BM1riASvqDaN5Xs+s=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "f680e0d3c1dbefe298c423691662e238496890f2", + "rev": "8fba98c80b48fa013820e0163c5096922fea4ddd", "type": "github" }, "original": { @@ -80,11 +80,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1778869304, - "narHash": "sha256-30sZNZoA1cqF5JNO9fVX+wgiQYjB7HJqqJ4ztCDeBZE=", + "lastModified": 1779560665, + "narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d233902339c02a9c334e7e593de68855ad26c4cb", + "rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786", "type": "github" }, "original": { diff --git a/home.org b/home.org index b29b9c0..455f3ae 100644 --- a/home.org +++ b/home.org @@ -889,7 +889,7 @@ Set up a few project- / workspace-related key bindings. (bind-keys ("s-f" . project-find-file) ("s-F" . project-switch-project)) - (with-eval-after-load tab-bar-mode + (with-eval-after-load 'tab-bar (bind-keys :map tab-bar-mode-map ("s-s" . tab-bar-switch-to-tab))) #+END_SRC @@ -1148,7 +1148,7 @@ its own devil-mode-only repeat maps that don't interfere when using normal modif (setq cursor-type (cond (org-present-mode nil) ((or (and nil god-local-mode) buffer-read-only - (and meow-mode (not (eq 'insert meow-current-state)))) 'box) + (and meow-mode (not (eq 'insert meow--current-state)))) 'box) (t 'bar)))) (add-hook 'post-command-hook 'my-god-mode-update-cursor-type) @@ -1275,17 +1275,37 @@ Just "silently" wrap when searching at the bottom of a document. } #+END_SRC +#+BEGIN_SRC elisp + (electric-pair-mode 1) + + (setq-default indent-tabs-mode nil) + (setq-default tab-width 4) + (global-tree-sitter-mode 1) + + (setopt ediff-split-window-function 'split-window-horizontally) + + (defun project-nix-flake () + (interactive) + (nix-flake (project-root (project-current t)))) + (bind-keys ("C-x p n" . project-nix-flake)) + #+END_SRC + +Show a vertical bar 100 characters out; ideally I don't want lines longer than this. 100 characters +is about the max you can have and still fit two files side-by-side on the screen. + +#+begin_src elisp + (setq-default fill-column 100) + + (defun jf-init-fill-column () + (display-fill-column-indicator-mode 1)) + (add-hook 'prog-mode-hook 'jf-init-fill-column) +#+end_src + I had some weird problems with jsx code where the default M-q would just do a text fill rather than a re-indent. The solution seems to be to only do the ~syntax-ppss~ stuff if tree-sitter isn't available? It seems to work for now anyway... -#+BEGIN_SRC elisp - (electric-pair-mode 1) - - (autoload 'flymake-show-project-diagnostics "flymake") - (autoload 'flymake-goto-next-error "flymake") - (autoload 'flymake-goto-prev-error "flymake") - +#+begin_src elisp (with-eval-after-load 'prog-mode (defun my-prog-fill-reindent-defun (&optional argument) "Refill or reindent the paragraph or defun that contains point. @@ -1306,47 +1326,57 @@ available? It seems to work for now anyway... (and (not (and (treesit-available-p) (treesit-parser-list))) (nth 8 (syntax-ppss))) (re-search-forward "\\s-*\\s<" (line-end-position) t)) (fill-paragraph argument (region-active-p)) - (beginning-of-defun) + (beginning-of-defun)/ (let ((start (point))) (end-of-defun) (indent-region start (point) nil)))))) - (advice-add 'prog-fill-reindent-defun :override #'my-prog-fill-reindent-defun) + (advice-add 'prog-fill-reindent-defun :override #'my-prog-fill-reindent-defun)) +#+end_src +*** Flymake +#+begin_src elisp + (autoload 'flymake-show-project-diagnostics "flymake") + (autoload 'flymake-goto-next-error "flymake") + (autoload 'flymake-goto-prev-error "flymake") + + (with-eval-after-load 'prog-mode (bind-keys :map prog-mode-map ("C-c D" . flymake-show-project-diagnostics) ("M-n" . flymake-goto-next-error) - ("M-p" . flymake-goto-prev-error)) - (defun jf-init-fill-column () - (display-fill-column-indicator-mode 1)) - (add-hook 'prog-mode-hook 'jf-init-fill-column)) - - (setq-default indent-tabs-mode nil) - (setq-default tab-width 4) - (global-tree-sitter-mode 1) - (setq-default fill-column 100) - - (setopt eglot-ignored-server-capabilities '(:inlayHintProvider :semanticTokensProvider)) - (add-hook 'eglot-managed-mode-hook (lambda () (eglot-inlay-hints-mode -1)) nil t) - (setopt eglot-code-action-indications nil) - (with-eval-after-load 'eglot - (bind-keys :map eglot-mode-map - ("C-c a" . eglot-code-actions) - ("C-c r" . eglot-rename) - ("C-c i" . eglot-find-implementation)) - (add-to-list 'eglot-stay-out-of 'yasnippet)) - - (setopt ediff-split-window-function 'split-window-horizontally) - - (defun project-nix-flake () - (interactive) - (nix-flake (project-root (project-current t)))) - (bind-keys ("C-x p n" . project-nix-flake)) + ("M-p" . flymake-goto-prev-error))) (with-eval-after-load 'flymake (bind-keys :map flymake-project-diagnostics-mode-map ("q" . quit-window))) - #+END_SRC +#+end_src + +*** Eglot +I don't like UI elements that insert fake text into the file. They mess up the spacing in the file, and can make everything too wide. + +#+BEGIN_SRC elisp + (setopt eglot-ignored-server-capabilities '(:inlayHintProvider :semanticTokensProvider)) + (add-hook 'eglot-managed-mode-hook (lambda () (eglot-inlay-hints-mode -1)) nil t) + (setopt eglot-code-action-indications nil) +#+END_SRC + +Set up a few useful eglot keys. + +#+begin_src elisp + (with-eval-after-load 'eglot + (bind-keys :map eglot-mode-map + ("C-c a" . eglot-code-actions) + ("C-c r" . eglot-rename) + ("C-c i" . eglot-find-implementation))) +#+end_src + +Eglot's yasnippet support uses the tab key, but I *also* use the tab key both for indentation, and +for completion. That makes it really annoying to use; don't use yasnippet with eglot. + +#+begin_src elisp + (with-eval-after-load 'eglot + (add-to-list 'eglot-stay-out-of 'yasnippet)) +#+end_src *** Rust #+BEGIN_SRC elisp @@ -1386,6 +1416,8 @@ available? It seems to work for now anyway... *** Typescript #+BEGIN_SRC elisp + (push '("\\.tsx?\\'" . typescript-mode) auto-mode-alist) + (push '(typescript-mode . typescript-ts-mode) major-mode-remap-alist) (setopt typescript-ts-mode-indent-offset 4) (with-eval-after-load 'typescript-ts-mode (defun my-tsx-ts-mode--indent-compatibility-b893426 () @@ -1404,6 +1436,7 @@ available? It seems to work for now anyway... *** Java #+BEGIN_SRC elisp + (push '(java-mode . java-ts-mode) major-mode-remap-alist) (with-eval-after-load 'java-ts-mode (bind-keys :map java-ts-mode-map ("C-c u" . string-inflection-java-style-cycle)) @@ -1491,6 +1524,7 @@ available? It seems to work for now anyway... #+BEGIN_SRC elisp (setopt magit-define-global-key-bindings 'recommended) + (bind-keys ("s-g" . magit)) (setopt magit-save-repository-buffers 'dontask) (setopt magit-commit-show-diff nil)