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

feat: Add 'a', 'A', 'h', and 'l' bindings to vim-normal mode #1697

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

alerque
Copy link
Contributor

@alerque alerque commented Feb 9, 2024

The current 'i' binding to switch to insert mode is entirely unintuitive since what I almost always want to do is append to the current query. The fact that the cursor extends past the current input (which vim doesn't do with default settings) adds to the problem. The 'a' key is what I would reach for, but 'A' makes a lot of sense too so I added that.

The 'h' and 'l' bindings for moving the cursor also help makes things a bit more usable.

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

The current 'i' binding to switch to insert mode is entirely unintuitive
since what I almost always want to do is append to the current query.
The fact that the cursor extends past the current input (which vim
doesn't do with default settings) adds to the problem. The 'a' key is
what I would reach for, but 'A' makes a lot of sense too so I added
that.

The 'h' and 'l' bindings for moving the cursor also help makes things
a bit more usable.
Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you!

Seeing as this is your first time contributing, if you would like a holographic contributors-only Atuin sticker, then please fill out this form!

We do also have a Discord if you'd like to ask any questions, or just fancy hanging out!

@ellie ellie merged commit 8805d04 into atuinsh:main Feb 12, 2024
15 checks passed
@alerque alerque deleted the vim-append-keys branch February 12, 2024 09:46
mwpastore added a commit to mwpastore/atuin that referenced this pull request Feb 22, 2024
Add 'I' binding to vim-normal mode (a la 'A' introduced in atuinsh#1697) to
jump into vim-insert mode at the beginning of the search input.

Also add '/' and '?' bindings to vim-normal mode to clear the search
input and jump into vim-insert mode. This mimicks the UX in e.g. `set -o
vi` (bash) or `bindkey -v` (zsh) mode when you are using 'k' and 'j' to
browse history lines and can type '/' or '?' to start a new search. (In
a perfect world it would limit the search to the forward or backward
range starting at your current position in the history, but this is a
reasonable first step.)
mwpastore added a commit to mwpastore/atuin that referenced this pull request Feb 22, 2024
Add 'I' binding to vim-normal mode (a la 'A' introduced in atuinsh#1697) to
jump into vim-insert mode at the beginning of the search input.

Also add '/' and '?' bindings to vim-normal mode to clear the search
input and jump into vim-insert mode. This mimics the UX in e.g. `set -o
vi` (bash) or `bindkey -v` (zsh) mode when you are using 'k' and 'j' to
browse history lines and can type '/' or '?' to start a new search. (In
a perfect world it would limit the search to the forward or backward
range starting at your current position in the history, but this is a
reasonable first step.)
mwpastore added a commit to mwpastore/atuin that referenced this pull request Feb 22, 2024
Add 'I' binding to vim-normal mode (a la 'A' introduced in atuinsh#1697) to
jump into vim-insert mode at the beginning of the search input.

Also add '/' and '?' bindings to vim-normal mode to clear the search
input and jump into vim-insert mode. This mimics the UX in e.g. `set -o
vi` (bash) or `bindkey -v` (zsh) mode when you are using 'k' and 'j' to
browse history lines and can type '/' or '?' to start a new search. (In
a perfect world it would target the search in the forward or backward
range starting at your current position in the history, but this is a
reasonable first step.)
ellie pushed a commit that referenced this pull request Feb 26, 2024
Add 'I' binding to vim-normal mode (a la 'A' introduced in #1697) to
jump into vim-insert mode at the beginning of the search input.

Also add '/' and '?' bindings to vim-normal mode to clear the search
input and jump into vim-insert mode. This mimics the UX in e.g. `set -o
vi` (bash) or `bindkey -v` (zsh) mode when you are using 'k' and 'j' to
browse history lines and can type '/' or '?' to start a new search. (In
a perfect world it would target the search in the forward or backward
range starting at your current position in the history, but this is a
reasonable first step.)
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

Successfully merging this pull request may close these issues.

2 participants