From d0047a1c7b2c9f263c2140503c44ceac4960649b Mon Sep 17 00:00:00 2001 From: Wong Ding Feng Date: Mon, 25 May 2026 19:17:22 +0800 Subject: [PATCH] misc tweaks: skhd bnpf bindings, neovim/doom/fish fixes - skhd: remap window nav/move/resize/stack from hjkl to Emacs-style bnpf; remap fullscreen/zoom to m, borders to o, prev/next space to [/]; add super-z to open emacsclient - neovim: fix catppuccin integration key (neo_tree -> neotree) so init loads without the "module not found" traceback - doom: disable lispy/objed/parinfer modules - fish: add ~/.bun/bin to PATH Co-Authored-By: Claude Opus 4.7 (1M context) --- darwin/skhd.nix | 74 ++++++++++++++++++--------------- doom.d/init.el | 6 +-- home-manager/modules/fish.nix | 3 ++ home-manager/modules/neovim.nix | 2 +- 4 files changed, 47 insertions(+), 38 deletions(-) diff --git a/darwin/skhd.nix b/darwin/skhd.nix index 42a5524..5837f5b 100644 --- a/darwin/skhd.nix +++ b/darwin/skhd.nix @@ -1,5 +1,8 @@ # skhd (Simple Hotkey Daemon) configuration for macOS # Uses nix-darwin's services.skhd module +# +# Directional keys use Emacs-style BPNF: +# b = west (backward), n = south (next), p = north (previous), f = east (forward) { config, lib, @@ -12,7 +15,7 @@ in { enable = true; skhdConfig = '' ## Navigation (${super} - ...) - # Space Navigation (four spaces per display): ${super} - {1, 2, 3, 4} + # Space Navigation: ${super} - {1-9, 0} ${super} - 1 : yabai -m space --focus 1 ${super} - 2 : yabai -m space --focus 2 ${super} - 3 : yabai -m space --focus 3 @@ -24,32 +27,32 @@ in { ${super} - 9 : yabai -m space --focus 9 ${super} - 0 : yabai -m space --focus 0 - # Window Navigation (through display borders): ${super} - {h, j, k, l} - ${super} - h : yabai -m window --focus west || yabai -m display --focus west - ${super} - j : yabai -m window --focus south || yabai -m display --focus south - ${super} - k : yabai -m window --focus north || yabai -m display --focus north - ${super} - l : yabai -m window --focus east || yabai -m display --focus east + # Window Navigation (through display borders): ${super} - {b, n, p, f} + ${super} - b : yabai -m window --focus west || yabai -m display --focus west + ${super} - n : yabai -m window --focus south || yabai -m display --focus south + ${super} - p : yabai -m window --focus north || yabai -m display --focus north + ${super} - f : yabai -m window --focus east || yabai -m display --focus east # Float / Unfloat window: ${super} - space # ${super} - space : yabai -m window --toggle float; sketchybar --trigger window_focus - # Make window zoom to fullscreen: shift + ${super} - f - shift + ${super} - f : yabai -m window --toggle zoom-fullscreen; sketchybar --trigger window_focus + # Make window zoom to fullscreen: shift + ${super} - m + shift + ${super} - m : yabai -m window --toggle zoom-fullscreen; sketchybar --trigger window_focus - # Make window zoom to parent node: ${super} - f - ${super} - f : yabai -m window --toggle zoom-parent; sketchybar --trigger window_focus + # Make window zoom to parent node: ${super} - m + ${super} - m : yabai -m window --toggle zoom-parent; sketchybar --trigger window_focus ## Window Movement (shift + ${super} - ...) - # Moving windows in spaces: shift + ${super} - {h, j, k, l} - shift + ${super} - h : yabai -m window --warp west || $(yabai -m window --display west && sketchybar --trigger windows_on_spaces && yabai -m display --focus west && yabai -m window --warp last) || yabai -m window --move rel:-10:0 - shift + ${super} - j : yabai -m window --warp south || $(yabai -m window --display south && sketchybar --trigger windows_on_spaces && yabai -m display --focus south) || yabai -m window --move rel:0:10 - shift + ${super} - k : yabai -m window --warp north || $(yabai -m window --display north && sketchybar --trigger windows_on_spaces && yabai -m display --focus north) || yabai -m window --move rel:0:-10 - shift + ${super} - l : yabai -m window --warp east || $(yabai -m window --display east && sketchybar --trigger windows_on_spaces && yabai -m display --focus east && yabai -m window --warp first) || yabai -m window --move rel:10:0 + # Swap/warp windows directionally: shift + ${super} - {b, n, p, f} + shift + ${super} - b : yabai -m window --swap west || $(yabai -m window --display west && sketchybar --trigger windows_on_spaces && yabai -m display --focus west && yabai -m window --warp last) || yabai -m window --move rel:-10:0 + shift + ${super} - n : yabai -m window --swap south || $(yabai -m window --display south && sketchybar --trigger windows_on_spaces && yabai -m display --focus south) || yabai -m window --move rel:0:10 + shift + ${super} - p : yabai -m window --swap north || $(yabai -m window --display north && sketchybar --trigger windows_on_spaces && yabai -m display --focus north) || yabai -m window --move rel:0:-10 + shift + ${super} - f : yabai -m window --swap east || $(yabai -m window --display east && sketchybar --trigger windows_on_spaces && yabai -m display --focus east && yabai -m window --warp first) || yabai -m window --move rel:10:0 # Toggle split orientation of the selected windows node: shift + ${super} - s shift + ${super} - s : yabai -m window --toggle split - # Moving windows between spaces: shift + ${super} - {1, 2, 3, 4, p, n } (Assumes 4 Spaces Max per Display) + # Moving windows between spaces: shift + ${super} - {1, 2, 3, 4, [, ] } shift + ${super} - 1 : DISPLAY="$(yabai -m query --displays --display | jq '.index')";\ yabai -m window --space $((1+4*($DISPLAY - 1)));\ sketchybar --trigger windows_on_spaces @@ -66,30 +69,30 @@ in { yabai -m window --space $((4+4*($DISPLAY - 1)));\ sketchybar --trigger windows_on_spaces - shift + ${super} - p : yabai -m window --space prev; yabai -m space --focus prev; sketchybar --trigger windows_on_spaces - shift + ${super} - n : yabai -m window --space next; yabai -m space --focus next; sketchybar --trigger windows_on_spaces + shift + ${super} - 0x21 : yabai -m window --space prev; yabai -m space --focus prev; sketchybar --trigger windows_on_spaces + shift + ${super} - 0x1E : yabai -m window --space next; yabai -m space --focus next; sketchybar --trigger windows_on_spaces # Mirror Space on X and Y Axis: shift + ${super} - {x, y} shift + ${super} - x : yabai -m space --mirror x-axis shift + ${super} - y : yabai -m space --mirror y-axis ## Stacks (shift + ctrl - ...) - # Add the active window to the window or stack to the {direction}: shift + ctrl - {h, j, k, l} - shift + ctrl - h : yabai -m window west --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus - shift + ctrl - j : yabai -m window south --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus - shift + ctrl - k : yabai -m window north --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus - shift + ctrl - l : yabai -m window east --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus + # Add the active window to the window or stack to the {direction}: shift + ctrl - {b, n, p, f} + shift + ctrl - b : yabai -m window west --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus + shift + ctrl - n : yabai -m window south --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus + shift + ctrl - p : yabai -m window north --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus + shift + ctrl - f : yabai -m window east --stack $(yabai -m query --windows --window | jq -r '.id'); sketchybar --trigger window_focus - # Stack Navigation: shift + ctrl - {n, p} - shift + ctrl - n : yabai -m window --focus stack.next - shift + ctrl - p : yabai -m window --focus stack.prev + # Stack Navigation: shift + ctrl - {], [} + shift + ctrl - 0x1E : yabai -m window --focus stack.next + shift + ctrl - 0x21 : yabai -m window --focus stack.prev ## Resize (ctrl + ${super} - ...) - # Resize windows: ctrl + ${super} - {h, j, k, l} - ctrl + ${super} - h : yabai -m window --resize right:-100:0 || yabai -m window --resize left:-100:0 - ctrl + ${super} - j : yabai -m window --resize bottom:0:100 || yabai -m window --resize top:0:100 - ctrl + ${super} - k : yabai -m window --resize bottom:0:-100 || yabai -m window --resize top:0:-100 - ctrl + ${super} - l : yabai -m window --resize right:100:0 || yabai -m window --resize left:100:0 + # Resize windows: ctrl + ${super} - {b, n, p, f} + ctrl + ${super} - b : yabai -m window --resize right:-100:0 || yabai -m window --resize left:-100:0 + ctrl + ${super} - n : yabai -m window --resize bottom:0:100 || yabai -m window --resize top:0:100 + ctrl + ${super} - p : yabai -m window --resize bottom:0:-100 || yabai -m window --resize top:0:-100 + ctrl + ${super} - f : yabai -m window --resize right:100:0 || yabai -m window --resize left:100:0 # Equalize size of windows: ctrl + ${super} - e ctrl + ${super} - e : yabai -m space --balance @@ -97,15 +100,18 @@ in { # Enable / Disable gaps in current workspace: ctrl + ${super} - g ctrl + ${super} - g : yabai -m space --toggle padding; yabai -m space --toggle gap - # Enable / Disable window borders in current workspace: ctrl + ${super} - b - ctrl + ${super} - b : yabai -m config window_border off - shift + ctrl + ${super} - b : yabai -m config window_border on + # Enable / Disable window borders in current workspace: ctrl + ${super} - o + ctrl + ${super} - o : yabai -m config window_border off + shift + ctrl + ${super} - o : yabai -m config window_border on ## Misc # Open new Kitty window ${super} - return : kitty --single-instance -d ~ # Bring Kitty window to current space ${super} - o : yabai -m window $(yabai -m query --windows | jq '.[] | select(.app==".kitty-wrapped") | .id') --space $(yabai -m query --spaces | jq '.[] | select(.has-focus==1) .id') + + # Open Emacs client + ${super} - z : emacsclient -nc ''; }; } diff --git a/doom.d/init.el b/doom.d/init.el index 985e7e4..4556623 100644 --- a/doom.d/init.el +++ b/doom.d/init.el @@ -58,10 +58,10 @@ fold ; (nigh) universal code folding (format +onsave) ; automated prettiness ;;god ; run Emacs commands without modifier keys - lispy ; vim for lisp, for people who don't like vim + ;;lispy ; vim for lisp, for people who don't like vim multiple-cursors ; editing in many places at once - objed ; text object editing for the innocent - parinfer ; turn lisp into python, sort of + ;;objed ; text object editing for the innocent + ;;parinfer ; turn lisp into python, sort of rotate-text ; cycle region at point between text candidates snippets ; my elves. They type so I don't have to word-wrap ; soft wrapping with language-aware indent diff --git a/home-manager/modules/fish.nix b/home-manager/modules/fish.nix index 057cd17..121cabe 100644 --- a/home-manager/modules/fish.nix +++ b/home-manager/modules/fish.nix @@ -105,6 +105,9 @@ if test -z "$LC_ALL" set -gx LC_ALL en_US.UTF-8 end + + # Bun global bin directory + fish_add_path -g $HOME/.bun/bin ''; # ═══════════════════════════════════════════════════════════════════════════ diff --git a/home-manager/modules/neovim.nix b/home-manager/modules/neovim.nix index 5a7b015..3df77d0 100644 --- a/home-manager/modules/neovim.nix +++ b/home-manager/modules/neovim.nix @@ -367,7 +367,7 @@ gitsigns = true, treesitter = true, telescope = { enabled = true }, - neo_tree = true, + neotree = true, indent_blankline = { enabled = true }, native_lsp = { enabled = true }, },