jemag / telescope-diff.nvim

View file diffs quickly with Telescope.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Telescope-diff.nvim

Quick file diffs with the power of Telescope.nvim.

Preview

2023-03-29.21-18-34.mp4

Features

  • Diff current file with a file picked from Telescope
  • Diff 2 files picked from Telescope

Installation

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" })

About

View file diffs quickly with Telescope.nvim

License:MIT License


Languages

Language:Lua 100.0%