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

Add insert_space command #8542

Closed
wants to merge 2 commits into from
Closed

Add insert_space command #8542

wants to merge 2 commits into from

Conversation

yerlaser
Copy link
Contributor

Add command to insert whitespace.
Motivation: I would like to add a special binding in normal mode to Shift-Space shortcut.
However, in insert mode it is very easy to hit this combination by accident as Shift often remains depressed after a previous character was inserted.
Therefore, I would like to assign Shift-Space to insert space, just like Space does, but only in insert mode.

@sicher
Copy link

sicher commented Oct 16, 2023

Shouldn't you already get space with shift-space in helix (and everywhere else) by default? I do.

@yerlaser
Copy link
Contributor Author

Shouldn't you already get space with shift-space in helix (and everywhere else) by default? I do.

Yes, that's because your terminal is configured by default to send space character when you press Shift-Space.
But, you can change it.

@the-mikedavis
Copy link
Member

See #2116

@yerlaser
Copy link
Contributor Author

See #2116

Thanks, that's another use case that I didn't think of.
In general, though, this command can have a few other uses.

In that other PR you refer to the Macro Style Bindings, but that feature seems to be stalled since 2021.
May I suggest to have this now and once that arrives all three insert commands can be replaced by one.

@tmke8
Copy link

tmke8 commented Oct 16, 2023

This could also be generalized to an :insert-text typeable command, and then you'd use

"S-ret" = ":insert-text ' '"

There is an open issue for that: #2797

@yerlaser
Copy link
Contributor Author

OK. I see.

@yerlaser yerlaser closed this Oct 16, 2023
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.

4 participants