Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ctrl + Left/Right to jump between words instead of vi/normal mode? #35

Open
mitomeo opened this issue Jun 16, 2021 · 5 comments
Open

Ctrl + Left/Right to jump between words instead of vi/normal mode? #35

mitomeo opened this issue Jun 16, 2021 · 5 comments
Assignees

Comments

@mitomeo
Copy link

mitomeo commented Jun 16, 2021

Before applying the theme, I could use Ctrl Left/Right or Alt B/F to jump between words. How can I achieve the same now? Thx

@agkozak agkozak self-assigned this Jun 17, 2021
@agkozak
Copy link
Owner

agkozak commented Jun 17, 2021

The prompt is not intended to affect keybindings. Can you share your .zshrc with me? I might be able to identify what's going wrong.

@mitomeo
Copy link
Author

mitomeo commented Jun 18, 2021

Sure, here my zshrc run on urxvt

# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
bindkey -v
bindkey '^R' history-incremental-search-backward
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
zstyle :compinstall filename '/home/ken/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall

# antibody bundle < ~/.config/zsh_plugins.txt > ~/.config/zsh_plugins.sh
source ~/.config/zsh_plugins.sh

[[ -s /etc/profile.d/autojump.sh ]] && source /etc/profile.d/autojump.sh

# create a zkbd compatible hash;
# to add other keys to this hash, see: man 5 terminfo
typeset -g -A key

key[Home]="${terminfo[khome]}"
key[End]="${terminfo[kend]}"
key[Insert]="${terminfo[kich1]}"
key[Backspace]="${terminfo[kbs]}"
key[Delete]="${terminfo[kdch1]}"
key[PageUp]="${terminfo[kpp]}"
key[PageDown]="${terminfo[knp]}"
key[Shift-Tab]="${terminfo[kcbt]}"

# setup key accordingly
[[ -n "${key[Home]}"      ]] && bindkey -- "${key[Home]}"       beginning-of-line
[[ -n "${key[End]}"       ]] && bindkey -- "${key[End]}"        end-of-line
[[ -n "${key[Insert]}"    ]] && bindkey -- "${key[Insert]}"     overwrite-mode
[[ -n "${key[Backspace]}" ]] && bindkey -- "${key[Backspace]}"  backward-delete-char
[[ -n "${key[Delete]}"    ]] && bindkey -- "${key[Delete]}"     delete-char
[[ -n "${key[PageUp]}"    ]] && bindkey -- "${key[PageUp]}"     beginning-of-buffer-or-history
[[ -n "${key[PageDown]}"  ]] && bindkey -- "${key[PageDown]}"   end-of-buffer-or-history
[[ -n "${key[Shift-Tab]}" ]] && bindkey -- "${key[Shift-Tab]}"  reverse-menu-complete

# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
if (( ${+terminfo[smkx]} && ${+terminfo[rmkx]} )); then
	autoload -Uz add-zle-hook-widget
	function zle_application_mode_start { echoti smkx }
	function zle_application_mode_stop { echoti rmkx }
	add-zle-hook-widget -Uz zle-line-init zle_application_mode_start
	add-zle-hook-widget -Uz zle-line-finish zle_application_mode_stop
fi

AGKOZAK_CMD_EXEC_TIME=0
AGKOZAK_PROMPT_DIRTRIM=0
AGKOZAK_PROMPT_CHAR=( $ %# : )
AGKOZAK_MULTILINE=0

@agkozak
Copy link
Owner

agkozak commented Jun 18, 2021

I suspect the real culprit is in your ~/.config/zsh_plugins.txt file. You might need to post that as well.

Do you really use Vim editing mode (bindkey -v)? Alt+F and Alt+B for forward-word and backward-word come from Emacs editing mode (bindkey -e), though there's nothing to stop you from using keybindings from both.

@mitomeo
Copy link
Author

mitomeo commented Jun 18, 2021

You are right, I should not have expected Alt + B/F to move between words in vim mode. So my concern now is Ctrl + Left/Right not working.
I use antibody as my plugin manager, so basically my zsh_plugins.txt:

zsh-users/zsh-autosuggestions
zsh-users/zsh-completions
agkozak/agkozak-zsh-prompt
zsh-users/zsh-syntax-highlighting

zsh_plugins.sh:

source /home/ken/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
fpath+=( /home/ken/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-autosuggestions )
source /home/ken/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions/zsh-completions.plugin.zsh
fpath+=( /home/ken/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-completions )
source /home/ken/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-agkozak-SLASH-agkozak-zsh-prompt/agkozak-zsh-prompt.plugin.zsh
fpath+=( /home/ken/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-agkozak-SLASH-agkozak-zsh-prompt )
source /home/ken/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
fpath+=( /home/ken/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-zsh-users-SLASH-zsh-syntax-highlighting )

@AndydeCleyre
Copy link
Contributor

@mitomeo Can you try removing autosuggestions? That one is sometimes extra funky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants