zsh-vi-mode icon indicating copy to clipboard operation
zsh-vi-mode copied to clipboard

Set default keybindings for Home and End keys

Open tdltdc opened this issue 3 years ago • 5 comments

General information

  • Terminal program: alacritty 0.9.0 (fed349aaa)
  • Operating system: Linux arch 5.14.12-arch1-1 #1 SMP PREEMPT Wed, 13 Oct 2021 16:58:16 +0000 x86_64 GNU/Linux
  • ZSH framework: none, but grml-zsh-config installed
  • ZSH version: zsh 5.8 (x86_64-pc-linux-gnu)
  • ZVM version: zsh-vi-mode-git-0.8.4.r19.g0c6f34a

Basic examination

  • [x] I have read through the README page
  • [x] I have the latest version of zsh-vi-mode
  • [ ] ~I have tested with another terminal program~ n/a

Problem description

The Home and End keys do not bind to "jump to start of line" and "jump to end of line". This is a regression from the default ZSH behaviour. Vim and Bash vi mode both map Home and End keys by default (https://github.com/jeffreytse/zsh-vi-mode/issues/59#issuecomment-862729015).

@jeffreytse, given that you've already mentioned considering this change (https://github.com/jeffreytse/zsh-vi-mode/issues/59#issuecomment-864930748), I figured I'd create an issue for tracking convenience.

Reproduction steps

  1. git clone https://aur.archlinux.org/zsh-vi-mode-git
  2. makepkg -si
  3. add source /usr/share/zsh/plugins/zsh-vi-mode/zsh-vi-mode.plugin.zsh to ~/.config/zsh/.zshrc.local
  4. Enter some text, then press Home or End

Expected behavior

Home and End keys map to "jump to start of line" and "jump to end of line" respectively.

tdltdc avatar Oct 20 '21 08:10 tdltdc

Hi @tdltdc

Thanks for your issue, I will work on this issue as soon as possible.

Thanks and Regards

jeffreytse avatar Oct 25 '21 03:10 jeffreytse

Related to #33

jeffreytse avatar Nov 05 '21 15:11 jeffreytse

Hi @tdltdc

Now this default keybindings has been implemented, thanks for your patience. : )

Thanks and Regards

jeffreytse avatar Nov 06 '21 13:11 jeffreytse

Unfortunately, this is still an issue, using st and the latest git pull of zsh-vi-mode. When not in tmux, home works but end doesn't.

scresante avatar May 22 '22 04:05 scresante

The easiest way to fix this, without modifying zmv, is to simply re-bindkey the functionality in your .zshrc after sourcing zmv.

But using the terminfo method is important from a cross-platform compatibility standpoint.

The underlying issue is that apparently, people get different escapes for their home/end keys.

In the original zmv source, it assumes the end key, for example, is ^[[F while on my system, after hitting Ctrl+v, End, I get ^[[4

scresante avatar Jun 01 '22 22:06 scresante