jeffreytse / zsh-vi-mode

💻 A better and friendly vi(vim) mode plugin for ZSH.
MIT License
2.94k stars 102 forks source link

How can I use hjkl to move the cursor; instead of switching previous command or next command #200

Open whxcode opened 1 year ago

whxcode commented 1 year ago

How can I use hjkl to move the cursor; instead of switching previous command or next command.

jeffreytse commented 1 year ago

Hi @whxcode

Thanks for your issue, you can try to do custom keybindings according to the README instructions, for your requirement, the default keybindings are j -> up-line-or-history and k -> up-line-or-history, it means that if you have a multiline command, you will get the move behaviors, and if you have no any character, you will get the history commands behaviors.

Thanks & Regards

whxcode commented 1 year ago

Thanks for your answer; I think when I press k/j in normal mode; I can move the cursor up or down like in vim; so I can copy the previous command or some output text.

image

Cursor can move in this area

whxcode commented 1 year ago

Hi @whxcode

Thanks for your issue, you can try to do custom keybindings according to the README instructions, for your requirement, the default keybindings are j -> up-line-or-history and k -> up-line-or-history, it means that if you have a multiline command, you will get the move behaviors, and if you have no any character, you will get the history commands behaviors.

Thanks & Regards

Or; is there any other way to move the cursor to the top? Now if I want to copy the above text information; I can only move the cursor with the mouse; and then copy.

svrvt commented 11 months ago

Hi @whxcode If all of a sudden you're using alacritty, it provides that without plugins. https://github.com/alacritty/alacritty/blob/master/docs/features.md#vi-mode

Или; есть ли какой-либо другой способ переместить курсор наверх? Теперь, если я хочу скопировать приведенную выше текстовую информацию; я могу только переместить курсор с помощью мыши; а затем скопировать.

jeffreytse commented 11 months ago

@whxcode If you're using tmux, you can move the cursor to the top easily as well via the built-in vi mode of tmux.