Commit bc72689230de

Vincent Demeester <vincent@sbr.pm>
2026-01-16 22:57:28
feat(emacs): prefer worktree files in magit diff navigation
- Navigate to worktree files instead of main repo when viewing diffs - Improve git worktree workflow in magit Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent e373e55
Changed files (2)
dots
.config
emacs
home
common
shell
dots/.config/emacs/init.el
@@ -977,6 +977,7 @@ minibuffer, even without explicitly focusing it."
   (magit-refresh-status-buffer nil "don't automatically refresh the status buffer after running a git command")
   (magit-commit-show-diff nil "don't show the diff by default in the commit buffer. Use `C-c C-d' to display it")
   (magit-branch-direct-configure nil "don't show git variables in magit branch")
+  (magit-diff-visit-prefer-worktree t "prefer visiting the worktree file")
   :config
   (declare-function magit-insert-worktrees "magit")
   (add-hook 'magit-status-sections-hook #'magit-insert-worktrees t)
home/common/shell/zsh.nix
@@ -1,4 +1,10 @@
-{ config, lib, pkgs, desktop ? null, ... }:
+{
+  config,
+  lib,
+  pkgs,
+  desktop ? null,
+  ...
+}:
 {
   home.file."${config.programs.zsh.dotDir}/completion.zsh".source = ./zsh/completion.zsh;
   home.file."${config.programs.zsh.dotDir}/prompt.zsh".source = ./zsh/prompt.zsh;
@@ -8,12 +14,16 @@
 
   # Kitty shell integration for CWD tracking in shpool sessions
   # Only deploy on headless servers (not on desktops/laptops)
-  home.file.".local/share/kitty-ssh-kitten/shell-integration/zsh/kitty-integration" = lib.mkIf (desktop == null) {
-    source = "${pkgs.kitty}/lib/kitty/shell-integration/zsh/kitty-integration";
-  };
-  home.file.".local/share/kitty-ssh-kitten/shell-integration/zsh/kitty.zsh" = lib.mkIf (desktop == null) {
-    source = "${pkgs.kitty}/lib/kitty/shell-integration/zsh/kitty.zsh";
-  };
+  home.file.".local/share/kitty-ssh-kitten/shell-integration/zsh/kitty-integration" =
+    lib.mkIf (desktop == null)
+      {
+        source = "${pkgs.kitty}/lib/kitty/shell-integration/zsh/kitty-integration";
+      };
+  home.file.".local/share/kitty-ssh-kitten/shell-integration/zsh/kitty.zsh" =
+    lib.mkIf (desktop == null)
+      {
+        source = "${pkgs.kitty}/lib/kitty/shell-integration/zsh/kitty.zsh";
+      };
 
   home.packages = with pkgs; [
     nix-zsh-completions