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

Using Fold Keys to Open/Close Diffs in :Git #1626

Closed
atomdmac opened this issue Nov 17, 2020 · 2 comments
Closed

Using Fold Keys to Open/Close Diffs in :Git #1626

atomdmac opened this issue Nov 17, 2020 · 2 comments

Comments

@atomdmac
Copy link

atomdmac commented Nov 17, 2020

My natural inclination when working with the :Git view is to use Vim's default "folding" keys (za/zm/etc.) to open and close the various file diffs in the staged and unstaged lists.

Is this possible to do (perhaps with a custom key map)?

EDIT: It looks like this already sort of works once the diff for a particular file has been expanded. What would be nice is if I could re-map <right> and <left> arrows so that I could expand/close the file diffs using the fold keys as well.

@tpope
Copy link
Owner

tpope commented Nov 18, 2020

There's no built-in functionality for this, but maps like nmap <buffer> za = in the fugitive file type should work as a reasonable approximation.

@tpope tpope closed this as completed Nov 18, 2020
@atomdmac
Copy link
Author

@tpope That custom key map worked beautifully. Thank you!

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

No branches or pull requests

2 participants