fix(zsh): apply keybindings reliably on first startup
- set bindkey -e before custom binds and load zsh/terminfo early - remove later bindkey -e that reset earlier keymaps - preserve terminfo application mode hooks This prevents Ctrl+Arrow and other navigation keys from failing until .zshrc is re-sourced. 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
parent
bab7526ac9
commit
92b9d417fb
12
.zshrc
12
.zshrc
@ -139,6 +139,12 @@ alias ...="cd ../.."
|
||||
# Robust keybinds for navigation and editing (support most terminals)
|
||||
# =====================
|
||||
|
||||
# Ensure Emacs keymap is set before custom bindings so later changes don't reset them
|
||||
bindkey -e
|
||||
|
||||
# Load terminfo module for $terminfo[] and echoti
|
||||
zmodload zsh/terminfo 2>/dev/null || true
|
||||
|
||||
# VSCode terminal compatibility detection
|
||||
export IS_VSCODE_TERM=0
|
||||
if [[ "$TERM_PROGRAM" == "vscode" ]] || [[ -n "$VSCODE_IPC_HOOK_CLI" ]]; then
|
||||
@ -256,10 +262,8 @@ autoload -Uz compinit && compinit
|
||||
# Keybinds (Navigation, Editing, FZF, Completion)
|
||||
# =====================
|
||||
|
||||
# Emacs mode by default (comment out for vi mode)
|
||||
bindkey -e
|
||||
# Uncomment below for vi mode
|
||||
# bindkey -v
|
||||
# Emacs/vi mode selection handled earlier to avoid resetting custom binds
|
||||
# bindkey -v # Uncomment to use vi mode instead
|
||||
|
||||
# History search
|
||||
bindkey '^R' fzf-history-widget # fzf history search (fzf-tab)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user