Quick file diffs with the power of Telescope.nvim.
2023-03-29.21-18-34.mp4
- Diff current file with a file picked from Telescope
- Diff 2 files picked from Telescope
With Lazy.nvim :
{
"jemag/telescope-diff.nvim",
dependencies = {
{ "nvim-telescope/telescope.nvim" },
}
},
Then, somewhere after require("telescope").setup
, load the extension using:
require("telescope").load_extension("diff")
You may also add keybinds, for example:
vim.keymap.set("n", "<leader>sC", function()
require("telescope").extensions.diff.diff_files({ hidden = true })
end, { desc = "Compare 2 files" })
vim.keymap.set("n", "<leader>sc", function()
require("telescope").extensions.diff.diff_current({ hidden = true })
end, { desc = "Compare file with current" })