the hunk-inline.nvim is a plugin that enables displaying and submitting hunk comments directly within Neovim.
You can configurate this plugin like this if you use lazy.nvim.
return {
{
"tominaga-h/hunk-inline.nvim",
config = function()
local hunk = require("hunk-inline")
vim.keymap.set("n", "<leader>hc", hunk.add_comment, { desc = "Hunk: add inline comment" })
vim.keymap.set("n", "<leader>hr", function()
hunk.refresh_comments(false)
end, { desc = "Hunk: refresh hunk comments" })
vim.keymap.set("n", "<leader>hx", hunk.clear_comments, { desc = "Hunk: clear display" })
-- Automatic fetch when viewing files (*Pass true if you want to suppress error notifications during automatic updates)
vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained" }, {
pattern = "*",
callback = function()
hunk.refresh_comments(true) -- silent = true
end,
})
end,
},
}