Thomas 1 жил өмнө
parent
commit
b989aa738e

+ 14 - 12
lazy-lock.json

@@ -12,50 +12,52 @@
   "cmp-r": { "branch": "main", "commit": "18b88eeb7e47996623b9aa0a763677ac00a16221" },
   "cmp-spell": { "branch": "master", "commit": "694a4e50809d6d645c1ea29015dad0c293f019d6" },
   "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
-  "conform.nvim": { "branch": "master", "commit": "797de8f79055334104cf77893cd93fe3fc2ac154" },
+  "conform.nvim": { "branch": "master", "commit": "25d48271e3d4404ba017cb92a37d3a681c1ad149" },
   "crates.nvim": { "branch": "main", "commit": "5d2751f3d31c952663ade44669b6b63efa06e295" },
   "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" },
   "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
   "dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" },
-  "edgy.nvim": { "branch": "main", "commit": "0e8bbab4eba9dab6c237e4a2e146dc0466897be6" },
+  "edgy-group.nvim": { "branch": "main", "commit": "d670840f0f6071452b7bde825990e7eab45f05e5" },
+  "edgy.nvim": { "branch": "main", "commit": "ebb77fde6f5cb2745431c6c0fe57024f66471728" },
   "fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" },
   "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
-  "fzf-lua": { "branch": "main", "commit": "a8a3466f83bf7391bdceb5131d7edc4308ff5430" },
+  "fzf-lua": { "branch": "main", "commit": "5565f4bfe304df30c35962a982f14d8de1043336" },
   "gitsigns.nvim": { "branch": "main", "commit": "f4928ba14eb6c667786ac7d69927f6aee6719f1e" },
   "image.nvim": { "branch": "master", "commit": "61c76515cfc3cdac8123ece9e9761b20c3dc1315" },
   "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" },
   "inlay-hints.nvim": { "branch": "master", "commit": "1d5bd49a43f8423bc56f5c95ebe8fe3f3b96ed58" },
-  "lazy.nvim": { "branch": "main", "commit": "16a5c46aa3d05d37eb9c49f57ab058033b0870a6" },
+  "lazy.nvim": { "branch": "main", "commit": "c02268ac6e6aab92249d020d75efc588bd9d24fa" },
   "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" },
   "mason-lspconfig.nvim": { "branch": "main", "commit": "58bc9119ca273c0ce5a66fad1927ef0f617bd81b" },
   "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
   "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
-  "mini.nvim": { "branch": "main", "commit": "23669ab7abc2cd10f9a5166de07400bb34eaecda" },
+  "mini.nvim": { "branch": "main", "commit": "657ef75b52a548090fb7906735517b7ddbf39e88" },
   "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" },
-  "neogit": { "branch": "master", "commit": "0ecc2e1c96b202b89ab1d991d0cb17ac720caa69" },
+  "neogit": { "branch": "master", "commit": "2b74a777b963dfdeeabfabf84d5ba611666adab4" },
   "neoscroll.nvim": { "branch": "master", "commit": "a7f5953dbfbe7069568f2d0ed23a9709a56725ab" },
-  "noice.nvim": { "branch": "main", "commit": "b97852ea8f04c51d2bd8ad033827c8189b542166" },
+  "noice.nvim": { "branch": "main", "commit": "dd7363eae290ecdb9d6a2db6e0f59527df79edd6" },
   "none-ls.nvim": { "branch": "main", "commit": "2cde745aadc2c36f6860a77a556494870675771a" },
   "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
   "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" },
-  "nvim-lspconfig": { "branch": "master", "commit": "47899067b10176a770b02eb47e2e7bc1d5b3b066" },
+  "nvim-lspconfig": { "branch": "master", "commit": "fa6c2a64100c6f692bbec29bbbc8ec2663c9e869" },
   "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
   "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
-  "nvim-treesitter": { "branch": "master", "commit": "aca4432ef6670adc5f5663bc0635fbe91180c3f1" },
+  "nvim-treesitter": { "branch": "master", "commit": "9d252d00210ed8d43197ef048daa94e6dc821bd6" },
   "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" },
   "nvim-web-devicons": { "branch": "master", "commit": "e612de3d3a41a6b7be47f51e956dddabcbf419d9" },
   "onedark": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" },
+  "outline.nvim": { "branch": "main", "commit": "2175b6da5b7b5be9de14fd3f54383a17f5e4609c" },
   "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
-  "rainbow-delimiters.nvim": { "branch": "master", "commit": "b29da4a6061a88270e875b38367d82c04c856128" },
+  "rainbow-delimiters.nvim": { "branch": "master", "commit": "f15c67214bc7a4ffbbb9281684cc5b5508af0a67" },
   "rustaceanvim": { "branch": "master", "commit": "047f9c9d8cd2861745eb9de6c1570ee0875aa795" },
   "satellite.nvim": { "branch": "main", "commit": "777ed56e1ef45ec808df701730b6597fc4fb0fbc" },
   "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
   "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
   "transparent.nvim": { "branch": "main", "commit": "fd35a46f4b7c1b244249266bdcb2da3814f01724" },
-  "trouble.nvim": { "branch": "main", "commit": "e57250994e3d8630016176025b853110234a778b" },
+  "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
   "typst-preview.nvim": { "branch": "master", "commit": "15eaaffc0a2d8cd871f485f399d1d67ed3322a0b" },
   "typst.vim": { "branch": "main", "commit": "4d18ced62599ffe5b3c0e5e49566d5456121bc02" },
   "vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" },
   "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" },
-  "which-key.nvim": { "branch": "main", "commit": "18b6df97d85a60f531b44395541105ea6c3e449d" }
+  "which-key.nvim": { "branch": "main", "commit": "c1b062ae95c3ca3e6eb87c075da991523605d79b" }
 }

+ 7 - 0
lua/config/mappings.lua

@@ -69,6 +69,13 @@ wk.add({
 			end,
 			desc = "Suggest spell",
 		},
+		{
+			"zr",
+			function()
+				vim.lsp.buf.rename()
+			end,
+      desc = "Rename symbol",
+		},
 
 		{
 			"<leader>ft",

+ 277 - 187
lua/plugins/edgy.lua

@@ -1,192 +1,282 @@
 --@diagnostic disable: undefined-doc-name
 return {
-  "folke/edgy.nvim",
-  event = "VeryLazy",
-  init = function()
-    vim.opt.laststatus = 3
-    vim.opt.splitkeep = "screen"
-  end,
-  opts = {
-    bottom = {
-      -- toggleterm / lazyterm at the bottom with a height of 40% of the screen
-      {
-        ft = "toggleterm",
-        size = { height = 0.4 },
-        -- exclude floating windows
-        filter = function(buf, win)
-          return vim.api.nvim_win_get_config(win).relative == ""
-        end,
+	{
+		"lucobellic/edgy-group.nvim",
+		event = "VeryLazy",
+		dependencies = { "folke/edgy.nvim" },
+		keys = {
+			{
+				"<leader>el",
+				function()
+					require("edgy-group").open_group_offset("left", 1)
+				end,
+				desc = "Edgy Group Next Left",
+			},
+			{
+				"<leader>eh",
+				function()
+					require("edgy-group").open_group_offset("left", -1)
+				end,
+				desc = "Edgy Group Prev Left",
+			},
+			{
+				"<c-,>",
+				function()
+					require("edgy-group.stl").pick()
+				end,
+				desc = "Edgy Group Pick",
+			},
+		},
+		opts = {
+			groups = {
+				left = {
+					{ icon = "", titles = { "Neo-Tree", "Neo-Tree Buffers" } },
+					{ icon = "", titles = { "Neo-Tree Git" } },
+					{ icon = "", titles = { "Outline" } },
+				},
+			},
+			statusline = {
+        -- suffix and prefix separators between icons
+        separators = { ' ', ' ' },
+        clickable = false, -- open group on click
+        colored = false, -- enable highlight support
+        colors = { -- highlight colors
+          active = 'Normal', -- highlight color for open group
+          inactive = 'Normal', -- highlight color for closed group
+          pick_active = 'PmenuSel', -- highlight color for pick key for open group
+          pick_inactive = 'PmenuSel', -- highlight color for pick key for closed group
+        },
+        -- pick key position: left, right, left_separator, right_separator, icon
+        -- left: before left separator
+        -- right: after right separator
+        -- left_separator, right_separator and icon: replace the corresponding element
+        pick_key_pose = 'left',
+        pick_function = nil, -- optional function to override default behavior
       },
-      {
-        ft = "lazyterm",
-        title = "LazyTerm",
-        size = { height = 0.4 },
-        filter = function(buf)
-          return not vim.b[buf].lazyterm_cmd
-        end,
-      },
-      "Trouble",
-      { ft = "qf", title = "QuickFix" },
-      {
-        ft = "help",
-        size = { height = 20 },
-        -- only show help buffers
-        filter = function(buf)
-          return vim.bo[buf].buftype == "help"
-        end,
-      },
-      { ft = "spectre_panel", size = { height = 0.4 } },
-    },
-    left = {
-      -- Neo-tree filesystem always takes half the screen height
-      {
-        title = "Neo-Tree",
-        ft = "neo-tree",
-        filter = function(buf)
-          return vim.b[buf].neo_tree_source == "filesystem"
-        end,
-        pinned = true,
-        collapsed = false, -- show window as closed/collapsed on start
-        open = "Neotree position=left filesystem",
-        size = { height = 0.7 },
-      },
-      {
-        title = "Neo-Tree Git",
-        ft = "neo-tree",
-        filter = function(buf)
-          return vim.b[buf].neo_tree_source == "git_status"
-        end,
-        pinned = true,
-        collapsed = false, -- show window as closed/collapsed on start
-        open = "Neotree position=left git_status",
-        size = { height = 0.3 },
-      },
-      -- {
-      --   title = "Neo-Tree Buffers",
-      --   ft = "neo-tree",
-      --   filter = function(buf)
-      --     return vim.b[buf].neo_tree_source == "buffers"
-      --   end,
-      --   pinned = true,
-      --   collapsed = true, -- show window as closed/collapsed on start
-      --   open = "Neotree position=top buffers",
-      -- },
-      -- {
-      --   title = function()
-      --     local buf_name = vim.api.nvim_buf_get_name(0) or "[No Name]"
-      --     return vim.fn.fnamemodify(buf_name, ":t")
-      --   end,
-      --   ft = "Outline",
-      --   pinned = true,
-      --   open = "SymbolsOutlineOpen",
-      --
-      -- },
-      -- any other neo-tree windows
-    },
-    options = {
-      left = { size = 25 },
-      bottom = { size = 10 },
-      right = { size = 30 },
-      top = { size = 10 },
-    },
+      toggle = true,
+		},
+	},
+	{
+		"folke/edgy.nvim",
+		event = "VeryLazy",
+		init = function()
+			vim.opt.laststatus = 3
+			vim.opt.splitkeep = "screen"
+		end,
+		opts = {
+			bottom = {
+				-- toggleterm / lazyterm at the bottom with a height of 40% of the screen
+				{
+					ft = "toggleterm",
+					size = { height = 0.4 },
+					-- exclude floating windows
+					filter = function(buf, win)
+						return vim.api.nvim_win_get_config(win).relative == ""
+					end,
+				},
+				{
+					ft = "lazyterm",
+					title = "LazyTerm",
+					size = { height = 0.4 },
+					filter = function(buf)
+						return not vim.b[buf].lazyterm_cmd
+					end,
+				},
+				"Trouble",
+				{ ft = "qf", title = "QuickFix" },
+				{
+					ft = "help",
+					size = { height = 20 },
+					-- only show help buffers
+					filter = function(buf)
+						return vim.bo[buf].buftype == "help"
+					end,
+				},
+				{ ft = "spectre_panel", size = { height = 0.4 } },
+			},
+			left = {
+				{
+					title = "Neo-Tree",
+					ft = "neo-tree",
+					filter = function(buf)
+						return vim.b[buf].neo_tree_source == "filesystem"
+					end,
+					size = { height = 0.3 },
+					open = "Neotree position=left filesystem",
+				},
+				{
+					title = "Neo-Tree Buffers",
+					ft = "neo-tree",
+					filter = function(buf)
+						return vim.b[buf].neo_tree_source == "buffers"
+					end,
+					open = "Neotree position=top buffers",
+				},
+				{
+					title = "Neo-Tree Git",
+					ft = "neo-tree",
+					filter = function(buf)
+						return vim.b[buf].neo_tree_source == "git_status"
+					end,
+					open = "Neotree position=right git_status",
+				},
+				{
+					ft = "Outline",
+					open = "SymbolsOutlineOpen",
+				},
+			},
 
-    -- edgebar animations
-    animate = {
-      enabled = true,
-      fps = 100, -- frames per second
-      cps = 120, -- cells per second
-      on_begin = function()
-        vim.g.minianimate_disable = true
-      end,
-      on_end = function()
-        vim.g.minianimate_disable = false
-      end,
-      -- Spinner for pinned views that are loading.
-      -- if you have noice.nvim installed, you can use any spinner from it, like:
-      -- spinner = require("noice.util.spinners").spinners.circleFull,
-      spinner = {
-        frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" },
-        interval = 80,
-      },
-    },
-    -- enable this to exit Neovim when only edgy windows are left
-    exit_when_last = false,
-    -- close edgy when all windows are hidden instead of opening one of them
-    -- disable to always keep at least one edgy split visible in each open section
-    close_when_all_hidden = true,
-    -- global window options for edgebar windows
-    ---@type vim.wo
-    wo = {
-      -- Setting to `true`, will add an edgy winbar.
-      -- Setting to `false`, won't set any winbar.
-      -- Setting to a string, will set the winbar to that string.
-      winbar = true,
-      winfixwidth = true,
-      winfixheight = false,
-      winhighlight = "WinBar:EdgyWinBar,Normal:EdgyNormal",
-      spell = false,
-      signcolumn = "no",
-    },
-    -- buffer-local keymaps to be added to edgebar buffers.
-    -- Existing buffer-local keymaps will never be overridden.
-    -- Set to false to disable a builtin.
-    ---@type table<string, fun(win:Edgy.Window)|false>
-    keys = {
-      -- close window
-      ["q"] = function(win)
-        win:close()
-      end,
-      -- hide window
-      ["<c-q>"] = function(win)
-        win:hide()
-      end,
-      -- close sidebar
-      ["Q"] = function(win)
-        win.view.edgebar:close()
-      end,
-      -- next open window
-      ["]w"] = function(win)
-        win:next({ visible = true, focus = true })
-      end,
-      -- previous open window
-      ["[w"] = function(win)
-        win:prev({ visible = true, focus = true })
-      end,
-      -- next loaded window
-      ["]W"] = function(win)
-        win:next({ pinned = false, focus = true })
-      end,
-      -- prev loaded window
-      ["[W"] = function(win)
-        win:prev({ pinned = false, focus = true })
-      end,
-      -- increase width
-      ["<c-w>>"] = function(win)
-        win:resize("width", 2)
-      end,
-      -- decrease width
-      ["<c-w><lt>"] = function(win)
-        win:resize("width", -2)
-      end,
-      -- increase height
-      ["<c-w>+"] = function(win)
-        win:resize("height", 2)
-      end,
-      -- decrease height
-      ["<c-w>-"] = function(win)
-        win:resize("height", -2)
-      end,
-      -- reset all custom sizing
-      ["<c-w>="] = function(win)
-        win.view.edgebar:equalize()
-      end,
-    },
-    icons = {
-      closed = " ",
-      open = " ",
-    },
-    -- enable this on Neovim <= 0.10.0 to properly fold edgebar windows.
-    -- Not needed on a nightly build >= June 5, 2023.
-    fix_win_height = vim.fn.has("nvim-0.10.0") == 0,
-  },
+			-- left = {
+			-- 	-- Neo-tree filesystem always takes half the screen height
+			-- 	{
+			-- 		title = "Neo-Tree",
+			-- 		ft = "neo-tree",
+			-- 		filter = function(buf)
+			-- 			return vim.b[buf].neo_tree_source == "filesystem"
+			-- 		end,
+			-- 		pinned = true,
+			-- 		collapsed = false, -- show window as closed/collapsed on start
+			-- 		open = "Neotree position=left filesystem",
+			-- 		size = { height = 0.7 },
+			-- 	},
+			-- 	{
+			-- 		title = "Neo-Tree Git",
+			-- 		ft = "neo-tree",
+			-- 		filter = function(buf)
+			-- 			return vim.b[buf].neo_tree_source == "git_status"
+			-- 		end,
+			-- 		pinned = true,
+			-- 		collapsed = false, -- show window as closed/collapsed on start
+			-- 		open = "Neotree position=left git_status",
+			-- 		size = { height = 0.3 },
+			-- 	},
+			-- {
+			--   title = "Neo-Tree Buffers",
+			--   ft = "neo-tree",
+			--   filter = function(buf)
+			--     return vim.b[buf].neo_tree_source == "buffers"
+			--   end,
+			--   pinned = true,
+			--   collapsed = true, -- show window as closed/collapsed on start
+			--   open = "Neotree position=top buffers",
+			-- },
+			-- {
+			--   title = function()
+			--     local buf_name = vim.api.nvim_buf_get_name(0) or "[No Name]"
+			--     return vim.fn.fnamemodify(buf_name, ":t")
+			--   end,
+			--   ft = "Outline",
+			--   pinned = true,
+			--   open = "SymbolsOutlineOpen",
+			--
+			-- },
+			-- any other neo-tree windows
+			-- },
+			options = {
+				left = { size = 25 },
+				bottom = { size = 10 },
+				right = { size = 30 },
+				top = { size = 10 },
+			},
+
+			-- edgebar animations
+			animate = {
+				enabled = true,
+				fps = 100, -- frames per second
+				cps = 120, -- cells per second
+				on_begin = function()
+					vim.g.minianimate_disable = true
+				end,
+				on_end = function()
+					vim.g.minianimate_disable = false
+				end,
+				-- Spinner for pinned views that are loading.
+				-- if you have noice.nvim installed, you can use any spinner from it, like:
+				-- spinner = require("noice.util.spinners").spinners.circleFull,
+				spinner = {
+					frames = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" },
+					interval = 80,
+				},
+			},
+			-- enable this to exit Neovim when only edgy windows are left
+			exit_when_last = false,
+			-- close edgy when all windows are hidden instead of opening one of them
+			-- disable to always keep at least one edgy split visible in each open section
+			close_when_all_hidden = true,
+			-- global window options for edgebar windows
+			---@type vim.wo
+			wo = {
+				-- Setting to `true`, will add an edgy winbar.
+				-- Setting to `false`, won't set any winbar.
+				-- Setting to a string, will set the winbar to that string.
+				winbar = true,
+				winfixwidth = true,
+				winfixheight = false,
+				winhighlight = "WinBar:EdgyWinBar,Normal:EdgyNormal",
+				spell = false,
+				signcolumn = "no",
+			},
+			-- buffer-local keymaps to be added to edgebar buffers.
+			-- Existing buffer-local keymaps will never be overridden.
+			-- Set to false to disable a builtin.
+			---@type table<string, fun(win:Edgy.Window)|false>
+			keys = {
+				-- close window
+				["q"] = function(win)
+					win:close()
+				end,
+				-- hide window
+				["<c-q>"] = function(win)
+					win:hide()
+				end,
+				-- close sidebar
+				["Q"] = function(win)
+					win.view.edgebar:close()
+				end,
+				-- next open window
+				["]w"] = function(win)
+					win:next({ visible = true, focus = true })
+				end,
+				-- previous open window
+				["[w"] = function(win)
+					win:prev({ visible = true, focus = true })
+				end,
+				-- next loaded window
+				["]W"] = function(win)
+					win:next({ pinned = false, focus = true })
+				end,
+				-- prev loaded window
+				["[W"] = function(win)
+					win:prev({ pinned = false, focus = true })
+				end,
+				-- increase width
+				["<c-w>>"] = function(win)
+					win:resize("width", 2)
+				end,
+				-- decrease width
+				["<c-w><lt>"] = function(win)
+					win:resize("width", -2)
+				end,
+				-- increase height
+				["<c-w>+"] = function(win)
+					win:resize("height", 2)
+				end,
+				-- decrease height
+				["<c-w>-"] = function(win)
+					win:resize("height", -2)
+				end,
+				-- reset all custom sizing
+				["<c-w>="] = function(win)
+					win.view.edgebar:equalize()
+				end,
+			},
+			icons = {
+				closed = " ",
+				open = " ",
+			},
+			-- enable this on Neovim <= 0.10.0 to properly fold edgebar windows.
+			-- Not needed on a nightly build >= June 5, 2023.
+			fix_win_height = vim.fn.has("nvim-0.10.0") == 0,
+		},
+	},
 }

+ 14 - 0
lua/plugins/utils.lua

@@ -22,6 +22,20 @@ return {
 			}, opts))
 		end,
 	},
+	{
+		"hedyhli/outline.nvim",
+		lazy = true,
+		cmd = { "Outline", "OutlineOpen" },
+		keys = { -- Example mapping to toggle outline
+			{ "<leader>o", "<cmd>Outline<CR>", desc = "Toggle outline" },
+		},
+		opts = {
+			-- Your setup opts here
+		},
+		config = function()
+			require("outline").setup({})
+		end,
+	},
 	{
 		-- Automatically add brackets by pairs
 		"jiangmiao/auto-pairs",