1 -- A tool for splitting diffs in Neovim
2 -- A lot of commands in jujutsu allow you to select parts of a diff.
3 -- The tool used to select the diff can be configured via their ui.diff-editor config option.
4 -- To use hunk.nvim add the following to your jujutsu config.toml:
7 -- diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"]
9 -- https://github.com/julienvincent/hunk.nvim
15 vim.cmd.packadd("nui.nvim")
18 require("hunk").setup({
22 accept = { "<leader><Cr>" },
23 focus_tree = { "<leader>e" },
27 expand_node = { "l", "<Right>" },
28 collapse_node = { "h", "<Left>" },
30 open_file = { "<Cr>" },
32 toggle_file = { "a" },
36 toggle_hunk = { "A" },
37 toggle_line = { "a" },
38 -- This is like toggle_line but it will also toggle the line on the other
39 -- 'side' of the diff.
40 toggle_line_pair = { "s" },
45 -- Jump between the left and right diff view
46 toggle_focus = { "<Tab>" },
52 -- Mode can either be `nested` or `flat`
56 --- Can be either `vertical` or `horizontal`
63 partially_selected = "",
69 -- Called right after each window and buffer are created.
71 ---@param _context { buf: number, tree: NuiTree, opts: table }
72 on_tree_mount = function(_context) end,
73 ---@param _context { buf: number, win: number }
74 on_diff_mount = function(_context) end,