Closed sayanarijit closed 2 months ago
Config:
version = '0.21.3'
xplr.config.general.selection_ui.style = {
add_modifiers = { "CrossedOut", "Reversed" },
}
xplr.config.general.focus_selection_ui.style = {
add_modifiers = { "Bold", "CrossedOut", "Reversed" },
}
xplr.config.modes.custom.Z = {
name = "Z",
key_bindings = {
on_key = {
Z = {
messages = {
"PrintPwdAndQuit",
},
},
Q = {
messages = {
"Quit",
},
},
},
},
}
xplr.config.modes.builtin.default.key_bindings.on_key["Z"] = {
messages = {
{ SwitchModeCustom = "Z" },
},
}
xplr.config.modes.builtin.default.key_bindings.on_key["enter"] = { messages = { "Enter" } }
xplr.config.modes.builtin.default.key_bindings.on_key["e"] = xplr.config.modes.builtin.action.key_bindings.on_key.e
xplr.config.modes.builtin.search.key_bindings.on_key.enter.messages = { "Enter", "PopMode" }
xplr.config.modes.builtin.search.key_bindings.on_key["/"] = { messages = { "Enter", "ResetInputBuffer" } }
@sayanarijit I've found out that it's happening when I'm using tmux for some reason. Without tmux, it works fine. It's still interesting because I'm not experiencing this issue with vim even under tmux.
Check your tmux key bindings...
Found this https://github.com/tmux/tmux/wiki/FAQ#what-is-the-escape-time-option-is-zero-a-good-value
I've fixed it for xplr by setting set -g escape-time 0
. Still, I can't understand why I'm not facing the same under vim/neovim? Maybe xplr handles escape sequences differently?
here is my only set tmux keybindings:
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind -r C-h resize-pane -L
bind -r C-j resize-pane -D
bind -r C-k resize-pane -U
bind -r C-l resize-pane -R
bind -nr C-j 'send-keys Down'
bind -nr C-k 'send-keys Up'
bind -r C-n 'swapw -s +1; next-window'
bind -r C-p 'swapw -s -1; previous-window'
Thanks for posting the solution. xplr uses crossterm for input reading, so its behavior depends on how crossterm handles inputs.
Closing this...
Discussed in https://github.com/sayanarijit/xplr/discussions/684