From ab4a79d91e52979938a0b1ffcb6c2b125d208e65 Mon Sep 17 00:00:00 2001 From: Diachk Date: Tue, 7 Jan 2025 13:17:48 +0100 Subject: [PATCH] diff view --- lua/config/keymaps.lua | 8 ++++---- lua/config/lazy.lua | 2 +- lua/plugins/diff-view.lua | 22 ++++++++++++++++++++++ lua/plugins/flash.lua | 14 ++++++++++++++ lua/plugins/git-conflict.lua | 1 + lua/plugins/indent-line.lua | 7 ------- lua/plugins/neogit.lua | 1 + 7 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 lua/plugins/diff-view.lua create mode 100644 lua/plugins/flash.lua delete mode 100644 lua/plugins/indent-line.lua diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 8723763..d23cbaa 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -38,10 +38,10 @@ end, { desc = "Yank current file path to system clipboard" }) vim.keymap.set("v", "y", '"*y', { desc = "Yank to system clipboard" }) -- jq vim.keymap.set("n", "jq", ":%!jq", { desc = "Stream current buffer to jq (json.parse current buffer)" }) --- Telescope resume last search -vim.keymap.set("n", "", function() - vim.cmd("Telescope resume") -end, { desc = "Telescope resume last search" }) +-- -- Telescope resume last search +-- vim.keymap.set("n", "", function() +-- vim.cmd("Telescope resume") +-- end, { desc = "Telescope resume last search" }) -- Delete mark vim.keymap.set("n", "dm", ":delmarks ", { desc = "Stream current buffer to jq (json.parse current buffer)" }) -- Close buffler split diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index a65aa08..3c2ee55 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -17,7 +17,7 @@ require("lazy").setup({ { import = "lazyvim.plugins.extras.formatting.prettier" }, { import = "lazyvim.plugins.extras.ui.alpha" }, -- { import = "lazyvim.plugins.extras.editor.symbols-outline" }, - { import = "lazyvim.plugins.extras.editor.leap" }, + -- { import = "lazyvim.plugins.extras.editor.leap" }, -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, -- import/override with your plugins { import = "plugins" }, diff --git a/lua/plugins/diff-view.lua b/lua/plugins/diff-view.lua new file mode 100644 index 0000000..7045cf3 --- /dev/null +++ b/lua/plugins/diff-view.lua @@ -0,0 +1,22 @@ +return { + "sindrets/diffview.nvim", + opts = { + view = { merge_tool = { layout = "diff3_mixed" } }, + hooks = { + diff_buf_win_enter = function(bufnr, winid, ctx) + if ctx.layout_name:match("^diff3") then + if ctx.symbol == "a" then + vim.opt_local.winhl = table.concat({ + "DiffAdd:DiffviewDiffAddAsDelete", + "DiffDelete:DiffviewDiffDelete", + }, ",") + elseif ctx.symbol == "b" then + vim.opt_local.winhl = table.concat({ + "DiffDelete:DiffviewDiffDelete", + }, ",") + end + end + end, + }, + }, +} diff --git a/lua/plugins/flash.lua b/lua/plugins/flash.lua new file mode 100644 index 0000000..dc6e9a0 --- /dev/null +++ b/lua/plugins/flash.lua @@ -0,0 +1,14 @@ +return { + "folke/flash.nvim", + event = "VeryLazy", + ---@type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} diff --git a/lua/plugins/git-conflict.lua b/lua/plugins/git-conflict.lua index 1abb95f..2cfe7d3 100644 --- a/lua/plugins/git-conflict.lua +++ b/lua/plugins/git-conflict.lua @@ -1,5 +1,6 @@ return { "akinsho/git-conflict.nvim", + enabled = false, version = "*", config = true, opts = { diff --git a/lua/plugins/indent-line.lua b/lua/plugins/indent-line.lua deleted file mode 100644 index 96c1e95..0000000 --- a/lua/plugins/indent-line.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "lukas-reineke/indent-blankline.nvim", - main = "ibl", - opts = { - indent = { highlight = { "CursorColumn" }, char = "" }, - }, -} diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua index ed0fa1e..4d0e758 100644 --- a/lua/plugins/neogit.lua +++ b/lua/plugins/neogit.lua @@ -1,5 +1,6 @@ return { "NeogitOrg/neogit", + enabled = false, dependencies = { "nvim-lua/plenary.nvim", -- required "sindrets/diffview.nvim", -- optional - Diff integration