From 3c4feebbcc7bb700419052e3c8b3859b489469e1 Mon Sep 17 00:00:00 2001 From: huyjaky Date: Sun, 19 Jan 2025 12:00:28 +0700 Subject: [PATCH] astro-nvim-v3 - modified folder structure --- lazy-lock.json | 2 +- lua/plugins/astrocore.lua | 2 +- lua/plugins/cmp.lua | 2 +- lua/plugins/code-runner.lua | 30 ------ lua/plugins/disabled.lua | 3 - lua/plugins/distant.lua | 21 ---- lua/plugins/editor.lua | 1 - lua/plugins/lsp-features.lua | 43 -------- lua/plugins/mini-icons.lua | 47 -------- lua/plugins/mini-move.lua | 40 ------- lua/plugins/mini.lua | 96 +++++++++++++++++ lua/plugins/multiple-cursor.lua | 40 ------- lua/plugins/multiple-visual.lua | 4 - lua/plugins/multiple.lua | 49 +++++++++ lua/plugins/nvim-dap-ui.lua | 149 ++++++++++++++++---------- lua/plugins/nvim-dap-virtual-text.lua | 11 -- lua/plugins/nvimlsp-endhints.lua | 22 ---- lua/plugins/todo-comments.lua | 25 ----- lua/plugins/ts-rainbow.lua | 33 ------ lua/plugins/ui.lua | 122 +++++++++++++++++++++ lua/plugins/ultimate-autopair.lua | 64 ----------- 21 files changed, 363 insertions(+), 443 deletions(-) delete mode 100644 lua/plugins/code-runner.lua delete mode 100644 lua/plugins/distant.lua delete mode 100644 lua/plugins/lsp-features.lua delete mode 100644 lua/plugins/mini-icons.lua delete mode 100644 lua/plugins/mini-move.lua create mode 100644 lua/plugins/mini.lua delete mode 100644 lua/plugins/multiple-cursor.lua delete mode 100644 lua/plugins/multiple-visual.lua create mode 100644 lua/plugins/multiple.lua delete mode 100644 lua/plugins/nvim-dap-virtual-text.lua delete mode 100644 lua/plugins/nvimlsp-endhints.lua delete mode 100644 lua/plugins/todo-comments.lua delete mode 100644 lua/plugins/ts-rainbow.lua delete mode 100644 lua/plugins/ultimate-autopair.lua diff --git a/lazy-lock.json b/lazy-lock.json index 638c788..c3eb1d1 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -4,7 +4,7 @@ "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "aerial.nvim": { "branch": "master", "commit": "1160fb7a15a34b03b7381d95d45560712b5f19d0" }, "alpha-nvim": { "branch": "main", "commit": "de72250e054e5e691b9736ee30db72c65d560771" }, - "astrocommunity": { "branch": "main", "commit": "532a545db91bbc63be038fee99cf2666cc3b6350" }, + "astrocommunity": { "branch": "main", "commit": "bac0a03e1f661600efa1e4c848416355d2ce1586" }, "astrocore": { "branch": "main", "commit": "0fcaac66d115948605c14eaf45a41d3923eaafeb" }, "astrolsp": { "branch": "main", "commit": "2f6b0a4059775a1dac011d2944dd41fd4a8fe7a8" }, "astrotheme": { "branch": "main", "commit": "41b7d8430a55fd771e41bd763af4c3fd1c2fc0b5" }, diff --git a/lua/plugins/astrocore.lua b/lua/plugins/astrocore.lua index 3b73bfe..1989d19 100644 --- a/lua/plugins/astrocore.lua +++ b/lua/plugins/astrocore.lua @@ -13,7 +13,7 @@ return { large_buf = { size = 1024 * 500, lines = 10000 }, -- set global limits for large files for disabling features like treesitter autopairs = false, -- enable autopairs at start cmp = true, -- enable completion at start - diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on) + diagnostics_mode = 0, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on) highlighturl = false, -- highlight URLs at start notifications = true, -- enable notifications at start }, diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 29490b3..1b0458a 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -122,7 +122,7 @@ return { -- [""] = cmp.mapping(function(fallback) -- -- Check if Copilot is suggesting something -- if vim.fn["copilot#Accept"]() ~= "" then - -- vim.api.nvim_set_keymap("i", "", "copilot#Accept('')", { expr = true, silent = true }) + -- vim.api.nvim_set_keymap("i", "", 'copilot#Accept("\\")', { expr = true, silent = true }) -- else -- fallback() -- If no suggestion, fallback to default behavior -- end diff --git a/lua/plugins/code-runner.lua b/lua/plugins/code-runner.lua deleted file mode 100644 index 1b4370a..0000000 --- a/lua/plugins/code-runner.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - "CRAG666/code_runner.nvim", - opts = { - filetype = { - java = { - "cd $dir &&", - "javac $fileName &&", - "java $fileNameWithoutExt", - }, - python = { - "cd $dir &&", - "python3 -u $fileName", - }, - rust = { - "cd $dir &&", - "rustc $fileName &&", - "$dir/$fileNameWithoutExt", - }, - }, - }, - keys = { - { "r", ":RunCode", mode = "n", noremap = true, silent = false, desc = "Run code" }, - { "rf", ":RunFile", mode = "n", noremap = true, silent = false, desc = "Run file" }, - { "rft", ":RunFile tab", mode = "n", noremap = true, silent = false, desc = "Run file in new tab" }, - { "rp", ":RunProject", mode = "n", noremap = true, silent = false, desc = "Run project" }, - { "rc", ":RunClose", mode = "n", noremap = true, silent = false, desc = "Close run" }, - { "crf", ":CRFiletype", mode = "n", noremap = true, silent = false, desc = "Change run filetype" }, - { "crp", ":CRProjects", mode = "n", noremap = true, silent = false, desc = "Change run projects" }, - }, -} diff --git a/lua/plugins/disabled.lua b/lua/plugins/disabled.lua index b17b3ab..5301789 100644 --- a/lua/plugins/disabled.lua +++ b/lua/plugins/disabled.lua @@ -12,12 +12,9 @@ return { { "kmontocam/nvim-conda", enabled = false }, { "NMAC427/guess-indent.nvim", enabled = false }, { "lukas-reineke/indent-blankline.nvim", enabled = false }, - { "chipsenkbeil/distant.nvim", enabled = false }, - { "gen740/SmoothCursor.nvim", enabled = false }, { "AstroNvim/astrotheme", enabled = false }, { "scottmckendry/cyberdream.nvim", enabled = false }, { "xiyaowong/transparent.nvim", enabled = false }, - { "MagicDuck/grug-far.nvim", enabled = false }, { "loctvl842/monokai-pro.nvim", enabled = false }, { "xiyaowong/transparent.nvim", enabled = false }, { "iamcco/markdown-preview.nvim", enabled = false }, diff --git a/lua/plugins/distant.lua b/lua/plugins/distant.lua deleted file mode 100644 index 4539e1f..0000000 --- a/lua/plugins/distant.lua +++ /dev/null @@ -1,21 +0,0 @@ - --- NOTE: control remote pc -return { - "chipsenkbeil/distant.nvim", - branch = "v0.3", - event = "VimEnter", - cmd = { - "DistantLaunch", - "DistantOpen", - "DistantConnect", - "DistantInstall", - "DistantMetadata", - "DistantShell", - "DistantShell", - "DistantSystemInfo", - "DistantClientVersion", - "DistantSessionInfo", - "DistantCopy", - }, - config = function() require("distant"):setup() end, -} diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 05bfd9c..c43f5cd 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -1,4 +1,3 @@ -local rainbow = require "plugins.ts-rainbow" -- Plugins that enhance editor experience return { { diff --git a/lua/plugins/lsp-features.lua b/lua/plugins/lsp-features.lua deleted file mode 100644 index 2f5fe02..0000000 --- a/lua/plugins/lsp-features.lua +++ /dev/null @@ -1,43 +0,0 @@ --- Plugins to add additional functionality for LSP -return { - -- Signature help - { - "ray-x/lsp_signature.nvim", - event = "User AstroFile", - config = function() - require("lsp_signature").setup { - bind = true, - handler_opts = { border = "rounded" }, - hint_enable = true, - hint_prefix = "🐼 ", - debug = true, - verbose = true, - } - end, - }, - -- Additional features for Clangd - -- { - -- "p00f/clangd_extensions.nvim", - -- lazy = true, - -- ft = { "c", "cpp" }, - -- dependencies = { - -- "AstroNvim/astrocore", - -- opts = { - -- autocmds = { - -- clangd_extensions = { - -- { - -- event = "LspAttach", - -- desc = "Load clangd_extensions with clangd", - -- callback = function(args) - -- if assert(vim.lsp.get_client_by_id(args.data.client_id)).name == "clangd" then - -- require "clangd_extensions" - -- vim.api.nvim_del_augroup_by_name "clangd_extensions" - -- end - -- end, - -- }, - -- }, - -- }, - -- }, - -- }, - -- }, -} diff --git a/lua/plugins/mini-icons.lua b/lua/plugins/mini-icons.lua deleted file mode 100644 index 8d228ae..0000000 --- a/lua/plugins/mini-icons.lua +++ /dev/null @@ -1,47 +0,0 @@ -return { - "echasnovski/mini.icons", - opts = function(_, opts) - if vim.g.icons_enabled ~= false then - opts.style = "glyph" -- Use glyph icons when available - else - opts.style = "ascii" -- Fallback to ASCII if glyphs are disabled - end - end, - lazy = true, - specs = { - { "nvim-tree/nvim-web-devicons", enabled = false, optional = true }, - { - "nvim-neo-tree/neo-tree.nvim", - opts = { - default_component_configs = { - icon = { - provider = function(icon, node) - local text, hl - local mini_icons = require "mini.icons" - if node.type == "file" then - text, hl = mini_icons.get("file", node.name) - elseif node.type == "directory" then - text, hl = mini_icons.get("directory", node.name) - if node:is_expanded() then text = nil end - end - - if text then icon.text = text end - if hl then icon.highlight = hl end - end, - }, - kind_icon = { - provider = function(icon, node) - icon.text, icon.highlight = require("mini.icons").get("lsp", node.extra.kind.name) - end, - }, - }, - }, - }, - }, - init = function() - package.preload["nvim-web-devicons"] = function() - require("mini.icons").mock_nvim_web_devicons() - return package.loaded["nvim-web-devicons"] - end - end, -} diff --git a/lua/plugins/mini-move.lua b/lua/plugins/mini-move.lua deleted file mode 100644 index b8d119d..0000000 --- a/lua/plugins/mini-move.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - "echasnovski/mini.move", - keys = function(_, keys) - local plugin = require("lazy.core.config").spec.plugins["mini.move"] - local opts = require("lazy.core.plugin").values(plugin, "opts", false) -- resolve mini.clue options - -- Populate the keys based on the user's options - local mappings = { - { opts.mappings.line_left, desc = "Move line left" }, - { opts.mappings.line_right, desc = "Move line right" }, - { opts.mappings.line_down, desc = "Move line down" }, - { opts.mappings.line_up, desc = "Move line up" }, - { opts.mappings.left, desc = "Move selection left", mode = "v" }, - { opts.mappings.right, desc = "Move selection right", mode = "v" }, - { opts.mappings.down, desc = "Move selection down", mode = "v" }, - { opts.mappings.up, desc = "Move selection up", mode = "v" }, - } - mappings = vim.tbl_filter(function(m) return m[1] and #m[1] > 0 end, mappings) - return vim.list_extend(mappings, keys) - end, - opts = { - mappings = { - left = "", - right = "", - down = "", - up = "", - line_left = "", - line_right = "", - line_down = "", - line_up = "", - }, - }, - specs = { - { - "bamboo", -- Replace with the correct name for the Bamboo colorscheme package if necessary - optional = true, - ---@type BambooOptions -- Adjust type if Bamboo has specific options - opts = { integrations = { mini = true } }, - }, - }, -} diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua new file mode 100644 index 0000000..5fa6d6e --- /dev/null +++ b/lua/plugins/mini.lua @@ -0,0 +1,96 @@ +return { + { + "echasnovski/mini.icons", + opts = function(_, opts) + if vim.g.icons_enabled ~= false then + opts.style = "glyph" -- Use glyph icons when available + else + opts.style = "ascii" -- Fallback to ASCII if glyphs are disabled + end + end, + lazy = true, + specs = { + { "nvim-tree/nvim-web-devicons", enabled = false, optional = true }, + { + "nvim-neo-tree/neo-tree.nvim", + opts = { + default_component_configs = { + icon = { + provider = function(icon, node) + local text, hl + local mini_icons = require "mini.icons" + if node.type == "file" then + text, hl = mini_icons.get("file", node.name) + elseif node.type == "directory" then + text, hl = mini_icons.get("directory", node.name) + if node:is_expanded() then text = nil end + end + + if text then icon.text = text end + if hl then icon.highlight = hl end + end, + }, + kind_icon = { + provider = function(icon, node) + icon.text, icon.highlight = require("mini.icons").get("lsp", node.extra.kind.name) + end, + }, + }, + }, + }, + }, + init = function() + package.preload["nvim-web-devicons"] = function() + require("mini.icons").mock_nvim_web_devicons() + return package.loaded["nvim-web-devicons"] + end + end, + }, + { + "echasnovski/mini.icons", + opts = function(_, opts) + if vim.g.icons_enabled ~= false then + opts.style = "glyph" -- Use glyph icons when available + else + opts.style = "ascii" -- Fallback to ASCII if glyphs are disabled + end + end, + lazy = true, + specs = { + { "nvim-tree/nvim-web-devicons", enabled = false, optional = true }, + { + "nvim-neo-tree/neo-tree.nvim", + opts = { + default_component_configs = { + icon = { + provider = function(icon, node) + local text, hl + local mini_icons = require "mini.icons" + if node.type == "file" then + text, hl = mini_icons.get("file", node.name) + elseif node.type == "directory" then + text, hl = mini_icons.get("directory", node.name) + if node:is_expanded() then text = nil end + end + + if text then icon.text = text end + if hl then icon.highlight = hl end + end, + }, + kind_icon = { + provider = function(icon, node) + icon.text, icon.highlight = require("mini.icons").get("lsp", node.extra.kind.name) + end, + }, + }, + }, + }, + }, + init = function() + package.preload["nvim-web-devicons"] = function() + require("mini.icons").mock_nvim_web_devicons() + return package.loaded["nvim-web-devicons"] + end + end, + }, +} diff --git a/lua/plugins/multiple-cursor.lua b/lua/plugins/multiple-cursor.lua deleted file mode 100644 index 97aa453..0000000 --- a/lua/plugins/multiple-cursor.lua +++ /dev/null @@ -1,40 +0,0 @@ -return { - "brenton-leighton/multiple-cursors.nvim", - event = "BufRead", - cmd = { - "MultipleCursorsAddDown", - "MultipleCursorsAddUp", - "MultipleCursorsMouseAddDelete", - "MultipleCursorsAddMatches", - "MultipleCursorsAddMatchesV", - "MultipleCursorsAddJumpNextMatch", - "MultipleCursorsJumpNextMatch", - "MultipleCursorsLock", - }, - dependencies = { - "AstroNvim/astrocore", - opts = function(_, opts) - local maps = opts.mappings - for lhs, map in pairs { - [""] = { "MultipleCursorsAddDown", desc = "Add cursor down" }, - [""] = { "MultipleCursorsAddUp", desc = "Add cursor up" }, - [""] = { "MultipleCursorsMouseAddDelete", desc = "Add cursor with mouse" }, - } do - maps.n[lhs] = map - maps.i[lhs] = map - end - local prefix = "c" - for lhs, map in pairs { - [prefix .. "a"] = { "MultipleCursorsAddMatches", desc = "Add cursor matches" }, - [prefix .. "A"] = { "MultipleCursorsAddMatchesV", desc = "Add cursor matches in previous visual area" }, - [prefix .. "j"] = { "MultipleCursorsAddJumpNextMatch", desc = "Add cursor and jump to next match" }, - [prefix .. "J"] = { "MultipleCursorsJumpNextMatch", desc = "Move cursor to next match" }, - [prefix .. "l"] = { "MultipleCursorsLock", desc = "Lock virtual cursors" }, - } do - maps.n[lhs] = map - maps.x[lhs] = map - end - end, - }, - opts = {}, -} diff --git a/lua/plugins/multiple-visual.lua b/lua/plugins/multiple-visual.lua deleted file mode 100644 index 7201d74..0000000 --- a/lua/plugins/multiple-visual.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "mg979/vim-visual-multi", - event = "BufRead", -} diff --git a/lua/plugins/multiple.lua b/lua/plugins/multiple.lua new file mode 100644 index 0000000..c11af58 --- /dev/null +++ b/lua/plugins/multiple.lua @@ -0,0 +1,49 @@ +return { + { + "brenton-leighton/multiple-cursors.nvim", + event = "BufRead", + cmd = { + "MultipleCursorsAddDown", + "MultipleCursorsAddUp", + "MultipleCursorsMouseAddDelete", + "MultipleCursorsAddMatches", + "MultipleCursorsAddMatchesV", + "MultipleCursorsAddJumpNextMatch", + "MultipleCursorsJumpNextMatch", + "MultipleCursorsLock", + }, + dependencies = { + "AstroNvim/astrocore", + opts = function(_, opts) + local maps = opts.mappings + for lhs, map in pairs { + [""] = { "MultipleCursorsAddDown", desc = "Add cursor down" }, + [""] = { "MultipleCursorsAddUp", desc = "Add cursor up" }, + [""] = { "MultipleCursorsMouseAddDelete", desc = "Add cursor with mouse" }, + } do + maps.n[lhs] = map + maps.i[lhs] = map + end + local prefix = "c" + for lhs, map in pairs { + [prefix .. "a"] = { "MultipleCursorsAddMatches", desc = "Add cursor matches" }, + [prefix .. "A"] = { + "MultipleCursorsAddMatchesV", + desc = "Add cursor matches in previous visual area", + }, + [prefix .. "j"] = { "MultipleCursorsAddJumpNextMatch", desc = "Add cursor and jump to next match" }, + [prefix .. "J"] = { "MultipleCursorsJumpNextMatch", desc = "Move cursor to next match" }, + [prefix .. "l"] = { "MultipleCursorsLock", desc = "Lock virtual cursors" }, + } do + maps.n[lhs] = map + maps.x[lhs] = map + end + end, + }, + opts = {}, + }, + { + "mg979/vim-visual-multi", + event = "BufRead", + }, +} diff --git a/lua/plugins/nvim-dap-ui.lua b/lua/plugins/nvim-dap-ui.lua index cbb8bdc..17e8446 100644 --- a/lua/plugins/nvim-dap-ui.lua +++ b/lua/plugins/nvim-dap-ui.lua @@ -1,68 +1,105 @@ return { - "rcarriga/nvim-dap-ui", - requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, - opts = { - eval = true, - mappings = { - edit = "e", - expand = { "", "<2-LeftMouse>" }, - open = "o", - remove = "d", - repl = "r", - toggle = "t", - }, + { + { + "rcarriga/nvim-dap-ui", + requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, + opts = { + eval = true, + mappings = { + edit = "e", + expand = { "", "<2-LeftMouse>" }, + open = "o", + remove = "d", + repl = "r", + toggle = "t", + }, - layouts = { - { - elements = { + layouts = { { - id = "repl", - size = 0.5, + elements = { + { + id = "repl", + size = 0.5, + }, + { + id = "console", + size = 0.5, + }, + }, + position = "left", + size = 40, }, { - id = "console", - size = 0.5, + elements = { + { + id = "scopes", + size = 0.25, + }, + { + id = "breakpoints", + size = 0.25, + }, + -- { + -- id = "stacks", + -- size = 0.25, + -- }, + }, + position = "bottom", + size = 8, }, }, - position = "left", - size = 40, }, - { - elements = { - { - id = "scopes", - size = 0.25, - }, - { - id = "breakpoints", - size = 0.25, - }, - -- { - -- id = "stacks", - -- size = 0.25, - -- }, - }, - position = "bottom", - size = 8, + config = function(_, opts) + local dap = require "dap" + local dapui = require "dapui" + + -- Initialize dap-ui + dapui.setup(opts) + + -- Prevent UI from closing when debugging session ends + dap.listeners.after.event_terminated["dapui"] = function() + -- Do nothing, keeping the UI open + end + dap.listeners.after.event_exited["dapui"] = function() + -- Do nothing, keeping the UI open + end + + -- Optionally, open dap-ui when session starts + dap.listeners.after.event_initialized["dapui"] = function() dapui.open() end + end, + }, + { + "theHamsta/nvim-dap-virtual-text", + event = "User AstroFile", + opts = { + commented = false, + enabled = true, + enabled_commands = true, + show_stop_reason = true, + virt_text_pos = "eol", }, }, }, - config = function(_, opts) - local dap = require "dap" - local dapui = require "dapui" - - -- Initialize dap-ui - dapui.setup(opts) - - -- Prevent UI from closing when debugging session ends - dap.listeners.after.event_terminated["dapui"] = function() - -- Do nothing, keeping the UI open - end - dap.listeners.after.event_exited["dapui"] = function() - -- Do nothing, keeping the UI open - end - - -- Optionally, open dap-ui when session starts - dap.listeners.after.event_initialized["dapui"] = function() dapui.open() end - end, + { + "chrisgrieser/nvim-lsp-endhints", + event = "LspAttach", + opts = { + icons = { + type = "󰜁 ", + parameter = "󰏪 ", + offspec = " ", -- hint kind not defined in official LSP spec + unknown = " ", -- hint kind is nil + }, + label = { + truncateAtChars = 20, + padding = 1, + marginLeft = 0, + sameKindSeparator = ", ", + }, + extmark = { + priority = 50, + }, + autoEnableHints = true, + }, + }, } diff --git a/lua/plugins/nvim-dap-virtual-text.lua b/lua/plugins/nvim-dap-virtual-text.lua deleted file mode 100644 index 0b6c725..0000000 --- a/lua/plugins/nvim-dap-virtual-text.lua +++ /dev/null @@ -1,11 +0,0 @@ -return { - "theHamsta/nvim-dap-virtual-text", - event = "User AstroFile", - opts = { - commented = false, - enabled = true, - enabled_commands = true, - show_stop_reason = true, - virt_text_pos = 'eol' - }, -} diff --git a/lua/plugins/nvimlsp-endhints.lua b/lua/plugins/nvimlsp-endhints.lua deleted file mode 100644 index 122b19e..0000000 --- a/lua/plugins/nvimlsp-endhints.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - "chrisgrieser/nvim-lsp-endhints", - event = "LspAttach", - opts = { - icons = { - type = "󰜁 ", - parameter = "󰏪 ", - offspec = " ", -- hint kind not defined in official LSP spec - unknown = " ", -- hint kind is nil - }, - label = { - truncateAtChars = 20, - padding = 1, - marginLeft = 0, - sameKindSeparator = ", ", - }, - extmark = { - priority = 50, - }, - autoEnableHints = true, - }, -} diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua deleted file mode 100644 index 818a833..0000000 --- a/lua/plugins/todo-comments.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - "folke/todo-comments.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - - keywords = { - FIX = { - icon = " ", -- icon used for the sign, and in search results - color = "error", -- can be a hex color, or a named color (see below) - alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords - -- signs = false, -- configure signs for some keywords individually - }, - TODO = { icon = " ", color = "info" }, - GOAL = { icon = " ", color = "info" }, - HACK = { icon = " ", color = "warning" }, - WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } }, - PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, - NOTE = { icon = " ", color = "hint", alt = { "INFO" } }, - TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, - }, - }, -} diff --git a/lua/plugins/ts-rainbow.lua b/lua/plugins/ts-rainbow.lua deleted file mode 100644 index 6f7802a..0000000 --- a/lua/plugins/ts-rainbow.lua +++ /dev/null @@ -1,33 +0,0 @@ -return { - { - "HiPhish/rainbow-delimiters.nvim", - dependencies = { - "nvim-treesitter/nvim-treesitter", - { - "AstroNvim/astrocore", - opts = { - mappings = { - n = { - ["u("] = { - function() - local bufnr = vim.api.nvim_get_current_buf() - require("rainbow-delimiters").toggle(bufnr) - require("astrocore").notify( - string.format( - "Buffer rainbow delimeters %s", - require("rainbow-delimiters").is_enabled(bufnr) and "on" or "off" - ) - ) - end, - desc = "Toggle rainbow delimeters (buffer)", - }, - }, - }, - }, - }, - }, - event = "User AstroFile", - main = "rainbow-delimiters.setup", - opts = {}, - }, -} diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 26e24e8..b635130 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -38,4 +38,126 @@ return { { "uT", "TransparentToggle", desc = "Toggle transparent" }, }, }, + { + { + "HiPhish/rainbow-delimiters.nvim", + dependencies = { + "nvim-treesitter/nvim-treesitter", + { + "AstroNvim/astrocore", + opts = { + mappings = { + n = { + ["u("] = { + function() + local bufnr = vim.api.nvim_get_current_buf() + require("rainbow-delimiters").toggle(bufnr) + require("astrocore").notify( + string.format( + "Buffer rainbow delimeters %s", + require("rainbow-delimiters").is_enabled(bufnr) and "on" or "off" + ) + ) + end, + desc = "Toggle rainbow delimeters (buffer)", + }, + }, + }, + }, + }, + }, + event = "User AstroFile", + main = "rainbow-delimiters.setup", + opts = {}, + }, + }, + { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + + keywords = { + FIX = { + icon = " ", -- icon used for the sign, and in search results + color = "error", -- can be a hex color, or a named color (see below) + alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords + -- signs = false, -- configure signs for some keywords individually + }, + TODO = { icon = " ", color = "info" }, + GOAL = { icon = " ", color = "info" }, + HACK = { icon = " ", color = "warning" }, + WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } }, + PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } }, + NOTE = { icon = " ", color = "hint", alt = { "INFO" } }, + TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } }, + }, + }, + }, + { + "altermo/ultimate-autopair.nvim", + event = "InsertEnter", + branch = "v0.6", --recommended as each new version will have breaking changes + opts = { + -- disable autopair in the command line: https://github.com/altermo/ultimate-autopair.nvim/issues/8 + cmap = false, + extensions = { + cond = { + -- disable in comments + -- https://github.com/altermo/ultimate-autopair.nvim/blob/6fd0d6aa976a97dd6f1bed4d46be1b437613a52f/Q%26A.md?plain=1#L26 + cond = { + function(fn) return not fn.in_node "comment" end, + }, + }, + -- get fly mode working on strings: + -- https://github.com/altermo/ultimate-autopair.nvim/issues/33 + fly = { + nofilter = true, + }, + }, + config_internal_pairs = { + { '"', '"', fly = true }, + { "'", "'", fly = true }, + { "[", "]", fly = true }, + { "{", "}", fly = true }, + { "(", ")", fly = true }, + -- { "<", ">", fly = true }, + }, + }, + dependencies = { + { + "AstroNvim/astrocore", + opts = { + mappings = { + n = { + ["ua"] = { + desc = "Toggle Ultimate Autopair", + function() + local notify = require("astrocore").notify + local function bool2str(bool) return bool and "on" or "off" end + local ok, ultimate_autopair = pcall(require, "ultimate-autopair") + if ok then + ultimate_autopair.toggle() + vim.g.ultimate_autopair_enabled = require("ultimate-autopair.core").disable + notify(string.format("ultimate-autopair %s", bool2str(not vim.g.ultimate_autopair_enabled))) + else + notify "ultimate-autopair not available" + end + end, + }, + }, + }, + }, + }, + }, + specs = { + { + "windwp/nvim-autopairs", + optional = true, + enabled = false, + }, + }, + }, } diff --git a/lua/plugins/ultimate-autopair.lua b/lua/plugins/ultimate-autopair.lua deleted file mode 100644 index 26edc94..0000000 --- a/lua/plugins/ultimate-autopair.lua +++ /dev/null @@ -1,64 +0,0 @@ -return { - "altermo/ultimate-autopair.nvim", - event = "InsertEnter", - branch = "v0.6", --recommended as each new version will have breaking changes - opts = { - -- disable autopair in the command line: https://github.com/altermo/ultimate-autopair.nvim/issues/8 - cmap = false, - extensions = { - cond = { - -- disable in comments - -- https://github.com/altermo/ultimate-autopair.nvim/blob/6fd0d6aa976a97dd6f1bed4d46be1b437613a52f/Q%26A.md?plain=1#L26 - cond = { - function(fn) return not fn.in_node "comment" end, - }, - }, - -- get fly mode working on strings: - -- https://github.com/altermo/ultimate-autopair.nvim/issues/33 - fly = { - nofilter = true, - }, - }, - config_internal_pairs = { - { '"', '"', fly = true }, - { "'", "'", fly = true }, - { "[", "]", fly = true }, - { "{", "}", fly = true }, - { "(", ")", fly = true }, - -- { "<", ">", fly = true }, - }, - }, - dependencies = { - { - "AstroNvim/astrocore", - opts = { - mappings = { - n = { - ["ua"] = { - desc = "Toggle Ultimate Autopair", - function() - local notify = require("astrocore").notify - local function bool2str(bool) return bool and "on" or "off" end - local ok, ultimate_autopair = pcall(require, "ultimate-autopair") - if ok then - ultimate_autopair.toggle() - vim.g.ultimate_autopair_enabled = require("ultimate-autopair.core").disable - notify(string.format("ultimate-autopair %s", bool2str(not vim.g.ultimate_autopair_enabled))) - else - notify "ultimate-autopair not available" - end - end, - }, - }, - }, - }, - }, - }, - specs = { - { - "windwp/nvim-autopairs", - optional = true, - enabled = false, - }, - }, -}