Browse Source

nixpkgs/neovim: add diffview.nvim

Thomas Dy 6 days ago
parent
commit
da2f539045

+ 11 - 0
.config/nixpkgs/neovim/config/lua/user/plugins/git.lua

@@ -1,6 +1,15 @@
+local diffview = require('diffview')
 local MiniDiff = require('mini.diff')
 local util = require('user.util')
 
+diffview.setup({
+  use_icons = false,
+  signs = {
+    fold_closed = ' ',
+    fold_open = '-',
+  }
+})
+
 -- shows added/removed/changed lines
 MiniDiff.setup({
   -- keymap #bracketed
@@ -35,6 +44,8 @@ MiniDiff.setup({
 vim.keymap.set('n', '<Leader>gs', '<cmd>Gedit :<CR>')
 vim.keymap.set('n', '<Leader>gb', '<cmd>Telescope git_branches<CR>')
 vim.keymap.set('n', '<Leader>gd', MiniDiff.toggle_overlay)
+vim.keymap.set('n', '<Leader>gvi', '<cmd>DiffviewOpen<CR>')
+vim.keymap.set('n', '<Leader>gvr', '<cmd>DiffviewFileHistory --range=origin..HEAD<CR>')
 
 -- conflicts navigation #bracketed
 vim.keymap.set('n', '[x', '?^[<lt>=>]\\{7}<CR>')

+ 4 - 0
.config/nixpkgs/neovim/plugins/sources.json

@@ -92,5 +92,9 @@
   "nvim-telescope/telescope-ui-select.nvim": {
     "rev": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2",
     "sha256": "1cgi4kmq99ssx97nnriff5674cjfvc3qsw62nx3iz0xqc6d4s631"
+  },
+  "sindrets/diffview.nvim": {
+    "rev": "4516612fe98ff56ae0415a259ff6361a89419b0a",
+    "sha256": "0brabpd02596hg98bml118bx6z2sly98kf1cr2p0xzybiinb4zs9"
   }
 }