neogit icon indicating copy to clipboard operation
neogit copied to clipboard

Option to run checktime to reload buffers

Open Tebro opened this issue 11 months ago • 2 comments

Is your feature request related to a problem? Please describe. I noticed this when discarding a hunk and the buffer holding the file in question didn't update.

Describe the solution you'd like I would like a configuration option to enable this automatic update of buffers behaviour

Describe alternatives you've considered I tried to make an autocmd that solves this based on NeogitStatusRefreshed but it breaks Neogits status view instead.

vim.api.nvim_create_autocmd("User", {
	pattern = "NeogitStatusRefreshed",
	command = "checktime"
})

Tebro avatar Jan 16 '25 12:01 Tebro

Ok this seems to work.

vim.api.nvim_create_autocmd("User", {
	pattern = "NeogitStatusRefreshed",
	callback = function()
		vim.cmd("set autoread | checktime")
	end
})

Tebro avatar Jan 16 '25 12:01 Tebro

I would love to see a feature like this implemented in neogit natively. Neogit is the only git plugin I know of that doesn't have this by default.

pachungulo avatar Feb 05 '25 15:02 pachungulo