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
Show diff for current buffer compared to saved version #164
Comments
This isn't outside the scope, I've been thinking about implementing something like this. Something I'm a little more interested in is showing signs for changes that are staged which would be useful if you like staging individual hunks which I personally do all the time. So essentially a diff of This suggestion is more of the lines of diffing |
Actually I found this plug:
|
I found this plugin: footprint which is good enough for my needs. I will close this then. |
Using footprint is probably a better option since the requirement of signs for modified lines doesn't require git. |
After some talk on Matrix, I'd like to reconsider this at some point. |
The `base` can now be set to `FILE` to diff against the working version. Resolves #164
The `base` can now be set to `FILE` to diff against the working version. Resolves #164
The `base` can now be set to `FILE` to diff against the working version. Resolves #164
Thx levis, somone figured out how to use it? https://github.com/lewis6991/gitsigns.nvim/blob/61e0130d4bd255d4a447656ec6e6c11bfeeb20a4/doc/gitsigns.txt#L104C1-L104C1 |
For now I get something like this : local git_non_tracked = vim.api.nvim_create_augroup("GitSignTrackNonTracked", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter"}, {
pattern = "*",
callback = function()
print('attaching gitsigngs')
gitsigns.attach(0, {
file = vim.fn.expand("%:p"),
toplevel = vim.fn.expand("%:p"),
base = 'FILE' })
end,
group = git_non_tracked,
}) But it does not seem to work. And I have to find way to detect non tracked buffer/files only. .. |
The files still need to be within a git repo for this to work, otherwise gitsigns can't attach. |
This will allow to highlight usaved changes in buffer, even if file is not in the git repo. This behaviour needs to be enabled by `attach_to_out_of_repo` config option (false by default). Resolves lewis6991#164
This will allow to highlight usaved changes in buffer, even if file is not in the git repo. This behaviour needs to be enabled by `attach_to_out_of_repo` config option (false by default). Resolves lewis6991#164
This will allow to highlight usaved changes in buffer, even if file is not in the git repo. This behaviour needs to be enabled by `attach_to_out_of_repo` config option (false by default). Resolves lewis6991#164
Is your feature request related to a problem? Please describe.
Lets say we do not have tracked file. We we made dome changes to file, and we want to quickly see what lines were edited.
Describe the solution you'd like
Gitsign could higlight/mark somehow edited lines (comparing edited file to non edited version on HDD)
Describe alternatives you've considered
We could maybe run diff of current buffer to original version but signs could be nicer
Additional context
Cool implementation in kde Kate text editor:
KateDiff.mp4
Modified lines are marked yellow, on save they tun green, and then new additional lines are marked yellow again. We can repeat save and new changes turn gree.
I know this may be outside the scope of this plug but still it could be nice feature to have..
The text was updated successfully, but these errors were encountered: