-
Notifications
You must be signed in to change notification settings - Fork 39.4k
(re)Add gitsigns recommended keymaps #740
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
Conversation
Hi! I personally have zero problem with this change. These seem like useful features. However I know @tjdevries explicitly had removing the gitsign stuff in mind with this rewrite, so you may need to take it up directly with him. One question: Could this be maybe moved into an optional enhancement folks could uncomment to include? I'd do that! Just trying to figure out if there's middle ground to get everyone what they want. |
Right, it was removed at this point:
If we add an "optional" way to enable this it would still increase the amount of code, even more so than if it's not an optional feature. Unless, you're suggesting to comment out the whole block in which case it would count towards the number of comments and not the number of code :) Anyway it seems we need @tjdevries to make a decision here. |
for what it's worth I spoke to him about this on discord, and he says he'll be looking at PR on this project again in a week or so. |
Let me think about it a little bit more, but I'm still leaning towards it adds a lot of noise for newcomers for something that is pretty auxillary. They should probably be focusing on other movements / actions / keymaps /etc instead of thinking about some of these git items. I wouldn't mind some way to allow them to see these keymaps more easily, or add them but I don't know that it's a good idea to have in the base init.lua |
I think the "next/prev hunk" keymaps are the only critical ones for the default experience, cause they provide with a way to navigate throgh the signs rendered explicitly by the plugin. While the rest of features are also cool, I find them being used way less frequently then navigating through the chunks. But maybe it's just me. |
@dam9000 Would you consider making this another optional commented out add in like the linting one we just added? I can totally see where these features are useful but I also understand and agree with @tjdevries desire to keep the base init.lua lean and mean so it's an easier jumping off point for new folks to actually read and understand. |
@feoh you mean moving the keymaps to a separate |
@dam9000 You're right, that's icky. If @tjdevries ultimately decides to keep it out, I'll be merging your PR into my fork :) Because if nothing else this functionality would make resolving merge conflicts easier to maintain said fork :) I'm sorry this has been so choppy and back and forth. I guess this is the way the software donuts get made :) |
-- Toggles | ||
map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) | ||
map('n', '<leader>td', gs.toggle_deleted, { desc = '[T]oggle git show [d]eleted' }) | ||
end, |
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.
If we want to keep this minimal I would remove:
toggle_deleted
toggle_current_line_blame
<leaderhD>
diff against last commitreset_buffer
undo_stage_hunk
stage_buffer
All these can be done with the :Gitsigns
command.
The rest are pretty critical to my workflow: navigation, individual hunk stage/reset, diff, preview, blame.
0d4656f
to
d55dc85
Compare
force pushed: rebased to latest master and made a minor simplification of vim.schedule that reduces 4 lines.
(same for next_hunk) Verified that it works correctly. |
@feoh , @tjdevries here is a PR with reduced list of keymaps and simplified code: #779 |
d55dc85
to
e6cddd5
Compare
I can appreciate where you're coming from around elegance and cleanliness, but I don't think we're going to see these merged. I'm running with gitsigns installed as a regular plugin in my fork and it works great. Would it make sense to not let the perfect be the enemy of the good? I could draft a PR where we make it another optional and by default commented out addition? |
@feoh yeah I see this is not getting anywhere, if making it an optional plugin would help getting it merged I can prepare that too. |
If you can get to that before I can that would be grand. Thank you for all your efforts - I really appreciate it! |
Closed in favor of #858. Thanks for the hard work on this! |
This used to be in kickstart, but was removed in the last rewrite, probably to keep the file short.
I would ask you to reconsider and include these keymaps.
I use them regularly and suspect others might find them useful too.
The keymaps are copied from:
https://github.com/lewis6991/gitsigns.nvim?tab=readme-ov-file#keymaps
with added descriptions.