update CLAUDE.md philosophy, set fish as default shell, improve tmux config

CLAUDE.md: add nix-only rule, verify-after-change rule, teach-debugging rule.
darwin: set fish as default user shell.
tmux: configure better-mouse-mode, fix catppuccin status, add extended keys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-25 12:51:04 +08:00
parent 11cc64bd4c
commit 5dc9962fc5
3 changed files with 23 additions and 4 deletions
+3 -1
View File
@@ -14,8 +14,10 @@ This repo strives for the **best possible macOS setup** with seamless UX:
- **Batteries included** — tools, shell plugins, keybindings, and integrations should work out of the box. No manual post-install steps.
- **Rice it** — the setup should look and feel polished. Consistent theming, clean status bars, good typography.
- **Research before implementing** — when adding or changing something, check the internet for the best current practices, latest options, and what power users recommend. Don't guess.
- **Test it works** — after making changes, run `darwin-rebuild switch` and verify the setting actually took effect (e.g. `defaults read` for macOS prefs). The UX should be seamless.
- **Test it works** — after making changes, run `darwin-rebuild switch` and verify the setting actually took effect (e.g. `defaults read` for macOS prefs, `which <pkg>` for packages, checking service status for daemons). Never assume a fix works — always confirm.
- **Teach debugging** — always explain *how* you verified something works and *how* the user can check it themselves. Show the proof: the command to run, what the output should look like, and what it means. The user should learn to debug and verify on their own, not just trust the output.
- **Stay current** — nix-darwin, home-manager, and macOS evolve. When touching a module, check if there are newer/better options available.
- **Nix-only** — never use `brew install`, `nix-env -i`, or any imperative package management. Everything goes through the flake: system packages in `darwin/configuration.nix`, user packages in `home-manager/modules/`. If it's not declared in Nix, it doesn't exist.
## Build Commands
+1
View File
@@ -50,6 +50,7 @@
users.users.df = {
name = "df";
home = "/Users/df";
shell = pkgs.fish;
};
# Set primary user for system defaults
+19 -3
View File
@@ -23,14 +23,23 @@
mouse = true;
prefix = "C-a"; # More ergonomic than C-b
escapeTime = 0; # No delay for escape (important for vim)
sensibleOnTop = true;
sensibleOnTop = false; # sensible's reattach-to-user-namespace overrides default-shell on macOS
shell = "${pkgs.fish}/bin/fish";
plugins = with pkgs.tmuxPlugins; [
# Core essentials
sensible
yank # System clipboard integration
vim-tmux-navigator # Seamless vim/tmux pane navigation
better-mouse-mode # Enhanced mouse support
{
plugin = better-mouse-mode;
extraConfig = ''
set -g @scroll-without-changing-pane 'on'
set -g @scroll-in-moused-over-pane 'on'
set -g @emulate-scroll-for-no-mouse-alternate-buffer 'on'
set -g @scroll-speed-num-lines-per-scroll '3'
'';
}
# Session persistence - survive reboots
{
@@ -82,7 +91,7 @@
# Status bar modules
set -g @catppuccin_status_modules_right 'session date_time'
set -g @catppuccin_status_modules_left ''''
set -g @catppuccin_status_modules_left ""
set -g @catppuccin_date_time_text '%H:%M'
'';
}
@@ -93,9 +102,16 @@
# GENERAL SETTINGS
# ============================================
# Force fish as the shell override sensible plugin's reattach-to-user-namespace
set -g default-command "${pkgs.fish}/bin/fish"
# True color support
set -ag terminal-overrides ",xterm-256color:RGB"
set -ag terminal-overrides ",*256col*:Tc"
# Extended keys lets tmux forward Shift+Enter, Ctrl+Enter, etc.
set -s extended-keys on
set -as terminal-features 'xterm*:extkeys'
# Undercurl support (for spell checking in nvim)
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'