diff --git a/docs/fish-config.md b/docs/fish-config.md index 19ab311..a24b2c4 100644 --- a/docs/fish-config.md +++ b/docs/fish-config.md @@ -1236,15 +1236,14 @@ Add -i (interactive confirmation) to destructive commands: regardless of the __fish_config_opinionated master state. Navigation: - ↑ ↓ / j k Move cursor - ← → Set value directionally: OFF ← DEFAULT → ON (clamped) - Space Cycle through all states: ON → OFF → DEFAULT → ON (wraps) + ↑ ↓ / k j Move cursor + ← → / h l Set value: OFF ← DEFAULT → ON (clamped) Tab Switch scope (Universal ↔ Session) q / Escape Exit - Left/Right move one step along the OFF–DEFAULT–ON scale and stop at the - ends; Space cycles through every state and wraps around. DEFAULT erases - the variable so the master switch / built-in default applies. + Left/Right (or vim-style h/l) move the highlighted value one step along + the OFF–DEFAULT–ON scale and stop at the ends. DEFAULT erases the + variable so the master switch / built-in default applies. Flags: --help / -h Show usage. diff --git a/functions/__config_toggle_apply.fish b/functions/__config_toggle_apply.fish index dde90ba..7ce27d0 100644 --- a/functions/__config_toggle_apply.fish +++ b/functions/__config_toggle_apply.fish @@ -6,8 +6,8 @@ # # DESCRIPTION # Applies a state value to an opinionated-component variable in the given -# scope, immediately and persistently. Used by config-toggle's Space (cycle) -# and Left/Right (directional) handlers so the set/erase logic lives in one +# scope, immediately and persistently. Used by config-toggle's Left/Right +# (and vim h/l) directional handlers so the set/erase logic lives in one # place. A value of "DEFAULT" erases the variable in that scope so the # master switch / built-in default takes over again. # diff --git a/functions/__config_toggle_draw.fish b/functions/__config_toggle_draw.fish index 45585c3..235e2f3 100644 --- a/functions/__config_toggle_draw.fish +++ b/functions/__config_toggle_draw.fish @@ -133,7 +133,7 @@ function __config_toggle_draw # ── Keybind hint ────────────────────────────────────── # Padded to the inner width so the right border stays aligned regardless # of the hint text. string pad is width-aware (arrows count as 1 column). - set -l hint " ↑↓ move ←→ set Space cycle Tab scope q quit" + set -l hint " ↑↓/kj move ←→/hl set Tab scope q quit" printf '│%s%s%s│\n' $c_dim (string pad -r -w $IW -- $hint) $c_reset # ── Bottom border ───────────────────────────────────── diff --git a/functions/config-toggle.fish b/functions/config-toggle.fish index 4b2113c..2cac262 100644 --- a/functions/config-toggle.fish +++ b/functions/config-toggle.fish @@ -13,8 +13,9 @@ # Universal — persists across all sessions (set -U / set -Ue) # Session — active for the current shell only (set -g / set -eg) # -# Changes apply immediately on each Space keypress — no confirm step. -# Always available regardless of __fish_config_opinionated state. +# Values are changed directionally with the arrow keys (or vim-style h/l) +# along an OFF ← DEFAULT → ON scale, and apply immediately — no confirm +# step. Always available regardless of __fish_config_opinionated state. # # ARGUMENTS # -h, --help Print usage and exit @@ -43,9 +44,8 @@ function config-toggle --description 'Interactive TUI for toggling opinionated c echo " Changes apply immediately — no confirm step required." echo echo "$c_head""Navigation:$c_reset" - echo " $c_flag↑ ↓$c_reset or $c_flag""j k$c_reset Move cursor up / down" - echo " $c_flag← →$c_reset Set value: OFF ← DEFAULT → ON (clamped)" - echo " $c_flag""Space$c_reset Cycle: ON → OFF → DEFAULT → ON (wraps)" + echo " $c_flag↑ ↓$c_reset or $c_flag""k j$c_reset Move cursor up / down" + echo " $c_flag← →$c_reset or $c_flag""h l$c_reset Set value: OFF ← DEFAULT → ON" echo " $c_flag""Tab$c_reset Switch scope (Universal ↔ Session)" echo " $c_flag""q$c_reset / $c_flag""Esc$c_reset Exit" echo @@ -108,22 +108,7 @@ function config-toggle --description 'Interactive TUI for toggling opinionated c else set cur_scope universal end - case space # Space — cycle through all states and apply - set -l varname $vars[(math $cur_row + 1)] - set -l cur_val (__config_toggle_get_val $varname $cur_scope) - - # Cycle (wraps): on → off → DEFAULT → on - set -l next_val on - switch $cur_val - case on - set next_val off - case off - set next_val DEFAULT - case '*' # DEFAULT or any unrecognised - set next_val on - end - __config_toggle_apply $varname $cur_scope $next_val - case right # → step toward ON (clamped, no wrap) + case right l # → / l — step toward ON (clamped, no wrap) set -l varname $vars[(math $cur_row + 1)] set -l cur_val (__config_toggle_get_val $varname $cur_scope) @@ -138,7 +123,7 @@ function config-toggle --description 'Interactive TUI for toggling opinionated c set next_val on end __config_toggle_apply $varname $cur_scope $next_val - case left # ← step toward OFF (clamped, no wrap) + case left h # ← / h — step toward OFF (clamped, no wrap) set -l varname $vars[(math $cur_row + 1)] set -l cur_val (__config_toggle_get_val $varname $cur_scope)