-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 undo checkpoint command #2115
Conversation
First time contributing to any open source project, I thought I was opening a pull request to my own fork (hence why I closed and reopened this pr in the span of 2 minutes) |
helix-term/src/commands.rs
Outdated
@@ -319,6 +319,7 @@ impl MappableCommand { | |||
redo, "Redo change", | |||
earlier, "Move backward in history", | |||
later, "Move forward in history", | |||
add_undo_checkpoint, "Add undo checkpoint", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like commit_undo_checkpoint
might read slightly better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or even commit_undo_state, but I figured calling it commit would be confusing if git integration was added in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think diff and possibly blame are likely to end up in the core but any sort of git commit integration would probably live as a plugin. Since we already use "commit" when talking about history in the implementation I think commit_undo_checkpoint
is reasonable
This is great, welcome to the fold! Kakoune binds this in insert mode to |
|
I've added it to the keybinds as edit: nevermind, it seems to be a problem with uppercase characters since should I go ahead and map it to |
Personally I prefer maybe |
I'm in favor of Considering that this command would be pressed in insert mode, I like that |
@pickfire opinions on this ^ I'd prefer to map the existing |
Hmm, for my own opinion I would be prefer to keep the One pain point when I started using kakoune is that I always have to exit the insert mode to be able to do quick modification, especially when I typo a word wrongly and want to quickly erase it, which I missed from vim where you can just |
This is deliberate, there should be no movement in insert mode. mawww/kakoune#334 (comment) |
I'm considering removing the readline mappings but keeping the commands. That way users can re-introduce the mappings in their configs but it makes it clear that these aren't the preferred mappings. |
Yes, I have seen that when I started using kakoune, I still think they are useful, I had to manually specify that in kakoune and I ended up lazy to declare those (because I don't like tweaking config) so sometimes I still fallback to neovim when using kakoune because of it, I only use kakoune for multi-line edits mainly, because in insert mode, readline keys are still more powerful compared to kakoune insert mode which doesn't do anything useful. I think these are the parts where helix can make up to the part where kakoune falls shore, one is this where it is missing useful keys in insert mode, the other one being having to hold shift when extending keys (where we use But mainly I think what you said is correct, movement keys in insert mode isn't really that useful I think, like |
Yeah I agree. We'll keep |
I feel like alt-u makes sense while being easy for users to adapt if we change it to ctrl-u down the road. |
Like @archseer discussed on the chat
I think we probably need some sort of place to poll active users. I also agree that those only for movements (like ctrl-f) are not useful, I don't use any of those, but IIRC on kakoune someone did ask for one of it like ctrl-e, maybe we might need it on the poll. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @AntonioLucibello and aiding in the discussion of getting it alt-u
while keeping the old key ctrl-u
which I think is useful. \o/
Not sure if we are going to do a poll or something but I am going to let other maintainers merge this.
Hmm, while reading the tutor I wonder if |
ctrl-s might clash with the keybinding for signature help: #1755 although ctrl-s hasn't been committed to in that PR yet I think ctrl-s would be an especially nice binding for this though since it mirrors the key in normal mode. |
Good point. Sorry for the bike shedding, let's use |
adds command to manually commit undo state