Git Diff - Full File View #33773
Replies: 22 comments 41 replies
|
yes, i feel like i'm missing something. i don't want to open a multibuffer with all the changes in my entire project. feels a bit like this is where they should have started?? lol. |
|
I have worked out a solution that will allow us to diff a full file relatively easily. essentially. you will need to have the ideally we would be able to run a task that just diffs the currently open file. so i found it the least painful to just select the file that i want to diff using open the command palette and run {
"label": "git - diff file",
"command": "selected_file=$(git status --porcelain | fzf --accept-nth=2); tmp_dir=/tmp/$(openssl rand -hex 8); mkdir -p $tmp_dir; tmp_file=$tmp_dir/diff; git show HEAD:$selected_file > $tmp_file; zed --diff $tmp_file $selected_file; rm $tmp_file;",
"use_new_terminal": true,
"reveal_target": "center",
"hide": "always"
}this should open an editor where you can select from a list of changes and when you select one it should open up a new editor with the selected file diff you can set this to be on a keybinding by putting this in your {
"context": "workspace",
"bindings": {
"cmd-alt-g": ["task::Spawn", { "task_name": "git - diff file" }],
}
}like i said. cheers |
|
@smitbarmase here is a second solution that will just open the file in the current Editor in a full file diff. put this in your tasks.json. {
"label": "diff",
"command": "git show HEAD:$ZED_RELATIVE_FILE > /tmp/$ZED_FILENAME; zed --diff /tmp/$ZED_FILENAME $ZED_RELATIVE_FILE; rm /tmp/$ZED_FILENAME;",
"reveal": "never",
"hide": "always"
},and this in your keybindings.json {
"context": "Editor",
"bindings": {
"cmd-alt-g": ["task::Spawn", { "task_name": "diff"}],
}
}i also still like having the |
|
ok. so after all that. I was looking through the docs and I actually discovered that Zed already has a action to view the git changes in a full file without any work arounds. I don't think the documentation around this feature is written very well, and that is probably why there are so many repeated discussions requesting this feature. go to the file that you would like to review and run this will show the git changes for the entire file. you can navigate between changes with and the |
|
The multi-buffer thing is a neat trick and probably great that it works that way under the hood, but it's almost never what I want as an end user. I would really like to see the entirety of the file and its changes side by side when I click a file in the git changes pane. |
|
this is now more important than ever, for us to review one single file of changes at a time. now with AI that does a lot of changes...!
literally my every day thought |
|
+1 on wanting to see this be a feature. Tried Zed when 1.0.0 released and really liked it, except switching back to Cursor / VS Code to view diffs. I had to go back to Cursor as primary editor, but will switch to Zed when this is a feature. |
|
I'm trying to make zed my main tool for coding but it's true that sometimes I have to comeback to vscode when I have to do something related with git. |
|
#56152 is supposed to resolve this issue. I tried it and was very satisfied with the solution. |
|
We also want this feature! Made an issue here and linked the PR: #58005. We're aware of it and will get to it as soon as we're able 🙏 |
|
The Solo DIff View is merged! |
|
Single-file Git diffs from the Git Panel have shipped in Zed Stable v1.6.3! Thanks to @chirivelli for the implementation! |
|
Please make it work like VSCode. Show one COMPLETE file with diffs. Anything else is just stupid and infuriating. |
|
what should be the default?
|
|
After a year its here and landed!! Thanks to all who go it across the finish line. If I was to be greedy I would ask for an option to make the default behavior when clicking on a file in the diff tree to open the full single file diff and then clicking the |
|
I almost gave up / left zededitor for VSCode due to lack of this setting. Initial look up on google / perplexity summarized that it's not possible with zed editor. So, glad to find it, finally "git": {
"file_diff": {
"show_full_file": true
}
},no, wait! This is something else. zed still requires 'Ctrl + Click' to open single file view? :( How to set it as default so I can just click and not 'Ctrl + Click'? |
|
Is there a way to invert the actions of |
|
This is great! The next in line of improvements for this are keyboard shortcuts/buttons/palette commands to:
|
|
Finally, found it. I was looking for it under "git diff" but it was under "Git Panel" in settings. And, this is the exact settings key: "git_panel": {
"entry_primary_click_action": "file_diff",
} |
|
Is there a way to achieve the same full file diff view from |
|
#62068 is one of the solution. Upvote if you want this feature. |







Uh oh!
There was an error while loading. Please reload this page.
One thing I love about viewing diffs in VSCode compared to Github is that I can view the complete uncollapsed file. This is really useful when trying to get broader context on the changes. Clicking through multiple expand up and downs is a lot of friction.
All reactions