From acf072e63498bb5f2080597771ca420672ee8367 Mon Sep 17 00:00:00 2001 From: inorishio Date: Mon, 10 Aug 2026 13:32:19 +0200 Subject: [PATCH] Chore: moved files, redone undotree, plugins are a little better --- lua/config/modules/undotree.lua | 16 +++--------- lua/mappings.lua | 2 +- lua/plugins/init.lua | 44 +++++++++++++++++++-------------- 3 files changed, 29 insertions(+), 33 deletions(-) diff --git a/lua/config/modules/undotree.lua b/lua/config/modules/undotree.lua index b8b0ab6..9cb6066 100644 --- a/lua/config/modules/undotree.lua +++ b/lua/config/modules/undotree.lua @@ -13,18 +13,8 @@ require("undotree").setup { ["move_change_next"] = "J", ["move_change_prev"] = "K", ["action_enter"] = "", - ["enter_diffbuf"] = "p", - ["quit"] = "q", + ["enter_diffbuf"] = "p", -- is defined for both undotree and preview buffers, so it works as a toggle + ["quit"] = "q", -- is defined for both undotree and preview buffers + ["update_undotree_view"] = "S", }, - -- Deprecated - -- keymaps = { - -- ['j'] = "move_next", - -- ['k'] = "move_prev", - -- ['gj'] = "move2parent", - -- ['J'] = "move_change_next", - -- ['K'] = "move_change_prev", - -- [''] = "action_enter", - -- ['p'] = "enter_diffbuf", - -- ['q'] = "quit", - -- }, } diff --git a/lua/mappings.lua b/lua/mappings.lua index 2f43c86..76e2360 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -17,7 +17,7 @@ map("n", "e", function() end) map("n", "g", require("telescope.builtin").live_grep, { desc = "Telescope grep" }) map("n", "f", require("telescope.builtin").find_files, { desc = "Telescope find files" }) --- map("n", "u", require("config.modules.undotree").toggle, { noremap = true, silent = true }) +map('n', 'u', require('undotree').toggle, { noremap = true, silent = true }) -- Copilot Chat buffer map("n", "", vim.cmd.CopilotChatToggle) diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index d56ffb8..5d81581 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,6 +1,6 @@ return { { - require("config.snacks") + require "config.snacks", }, { "nvim-treesitter/nvim-treesitter", @@ -8,7 +8,7 @@ return { build = ":TSUpdate", branch = "main", config = function() - require("config.modules.treesitter") + require "config.modules.treesitter" end, }, { @@ -24,7 +24,7 @@ return { { "rmagatti/auto-session", config = function() - require("config.modules.autosession") + require "config.modules.autosession" end, }, { @@ -40,19 +40,19 @@ return { "akinsho/bufferline.nvim", event = "VeryLazy", config = function() - require("config.other.barbar") + require "config.other.barbar" end, }, { "mawkler/modicator.nvim", config = function() - require("config.gui.modicator") + require "config.gui.modicator" end, }, { "jiaoshijie/undotree", config = function() - require("config.modules.undotree") + require "config.modules.undotree" end, }, { @@ -63,7 +63,7 @@ return { "windwp/nvim-autopairs", event = "InsertEnter", config = function() - require("config.other.autopairs") + require "config.other.autopairs" end, }, { @@ -72,7 +72,7 @@ return { { "rcarriga/nvim-notify", config = function() - require("config.other.notify") + require "config.other.notify" end, }, { @@ -80,7 +80,7 @@ return { cmd = "Copilot", event = "InsertEnter", config = function() - require("config.ai.copilot") + require "config.ai.copilot" end, }, { @@ -91,13 +91,13 @@ return { }, build = "make tiktoken", config = function() - require("config.ai.copilotchat") + require "config.ai.copilotchat" end, }, { "mfussenegger/nvim-dap", config = function() - require("config.other.dapconf") + require "config.other.dapconf" end, }, { @@ -112,7 +112,7 @@ return { "folke/lazydev.nvim", ft = "lua", opts = function() - require("config.lazydev") + require "config.lazydev" end, }, { @@ -132,7 +132,7 @@ return { "b0o/schemastore.nvim", }, config = function() - require("config.format.lspconfig") + require "config.format.lspconfig" end, }, { @@ -163,7 +163,7 @@ return { { "f3fora/nvim-texlabconfig", config = function() - require("config.format.texlab") + require "config.format.texlab" end, build = "go build", }, @@ -183,13 +183,13 @@ return { { "aserowy/tmux.nvim", config = function() - require("config.terminal.tmux") + require "config.terminal.tmux" end, }, { "rachartier/tiny-inline-diagnostic.nvim", config = function() - require("config.format.TID") + require "config.format.TID" end, }, { @@ -199,19 +199,19 @@ return { "nvim-lua/plenary.nvim", }, config = function() - require("config.other.harpoon") + require "config.other.harpoon" end, }, { "aznhe21/actions-preview.nvim", config = function() - require("config.other.actions-preview") + require "config.other.actions-preview" end, }, { "Zacharias-Brohn/zterm-navigator.nvim", config = function() - require("config.terminal.zterm-navigator") + require "config.terminal.zterm-navigator" end, }, { @@ -219,4 +219,10 @@ return { event = "LspAttach", opts = {}, }, + { + "jiaoshijie/undotree", + config = function() + require "config.modules.undotree" + end, + }, }