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

Vimdiff support #705

Closed
antonmry opened this issue Jan 1, 2025 · 2 comments · Fixed by #746
Closed

Vimdiff support #705

antonmry opened this issue Jan 1, 2025 · 2 comments · Fixed by #746
Labels
enhancement New feature or request

Comments

@antonmry
Copy link

antonmry commented Jan 1, 2025

Following this discussion, this is a feature request to add support for neovim/vim diff with the current CopilotChat diff functionality.

It could work in a similar way to the existing diff mappings (gd, gy, gq, gj) but it would open the diff (assuming COPILOT_GENERATE prompt) in a new vertical buffer and it would execute a 'diffthis` command in the last active buffer and the new vertical buffer.

Some possible variations:

  • The Copilot buffer could be reused to load the diff.
  • Vimdiff may be only executed in the buffer with the diff, letting the user to execute ":diffthis" in whatever other buffer they choose.
@deathbeam deathbeam added the enhancement New feature or request label Jan 2, 2025
@antonmry
Copy link
Author

antonmry commented Jan 6, 2025

I implemented a PoC here in case it's helpful: https://github.com/antonmry/diff_copilot.nvim

output_final.mov

deathbeam added a commit to deathbeam/CopilotChat.nvim that referenced this issue Feb 4, 2025
Add new `full_diff` option to show_diff mapping which allows showing a full
diff view instead of unified diff view. When enabled, it will show the
modified file content side by side with original file using Vim's built-in
diff mode.

The full diff mode provides better visualization of changes and allows using
Vim's diff navigation commands to review changes.

Closes CopilotC-Nvim#705
deathbeam added a commit to deathbeam/CopilotChat.nvim that referenced this issue Feb 4, 2025
Add new `full_diff` option to show_diff mapping which allows showing a full
diff view instead of unified diff view. When enabled, it will show the
modified file content side by side with original file using Vim's built-in
diff mode.

The full diff mode provides better visualization of changes and allows using
Vim's diff navigation commands to review changes.

Closes CopilotC-Nvim#705

Signed-off-by: Tomas Slusny <[email protected]>
@deathbeam
Copy link
Collaborator

Took me a while to get back to this but I hink it works nice: #746

deathbeam added a commit to deathbeam/CopilotChat.nvim that referenced this issue Feb 4, 2025
Add new `full_diff` option to show_diff mapping which allows showing a full
diff view instead of unified diff view. When enabled, it will show the
modified file content side by side with original file using Vim's built-in
diff mode.

The full diff mode provides better visualization of changes and allows using
Vim's diff navigation commands to review changes.

Closes CopilotC-Nvim#705

Signed-off-by: Tomas Slusny <[email protected]>
deathbeam added a commit that referenced this issue Feb 4, 2025
Add new `full_diff` option to show_diff mapping which allows showing a full
diff view instead of unified diff view. When enabled, it will show the
modified file content side by side with original file using Vim's built-in
diff mode.

The full diff mode provides better visualization of changes and allows using
Vim's diff navigation commands to review changes.

Closes #705

Signed-off-by: Tomas Slusny <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants