astro-nvim-v3 - clean up useless packages

This commit is contained in:
huyjaky
2025-01-26 10:22:51 +07:00
parent 3c4feebbcc
commit 93678288f1
11 changed files with 69 additions and 156 deletions

View File

@@ -12,7 +12,7 @@ return {
autoformat = false, -- enable or disable auto formatting on start
codelens = false, -- enable/disable codelens refresh on start
inlay_hints = false, -- enable/disable inlay hints on start
semantic_tokens = false, -- enable/disable semantic token highlighting
semantic_tokens = true, -- enable/disable semantic token highlighting
},
-- customize lsp formatting options
formatting = require "plugins.configs.lsp.formatting",

View File

@@ -27,7 +27,6 @@ return {
cmp.config.sources {
{ name = "nvim_lsp", priority = 1000 },
{ name = "cmdline", priority = 800 },
{ name = "buffer", priority = 500 },
{ name = "path", priority = 250 },
}

View File

@@ -170,14 +170,15 @@ return {
end,
},
},
-- Better split navigation and resize
{
"mrjones2014/smart-splits.nvim",
event = "VeryLazy", -- load on very lazy for mux detection
opts = function(_, opts)
opts.ignored_filetypes = { "nofile", "quickfix", "qf", "prompt" }
opts.ignored_filetypes = { "nofile", "quickfix", "qf", "prompt", "NvimTree" }
opts.ignored_buftypes = { "nofile" }
opts.log_level = "error"
end,
keys = {
{

View File

@@ -1,42 +0,0 @@
---@type LazySpec
return {
"iamcco/markdown-preview.nvim",
build = function(plugin)
local package_manager = vim.fn.executable "yarn" and "yarn" or vim.fn.executable "npx" and "npx -y yarn" or false
--- HACK: Use `yarn` or `npx` when possible, otherwise throw an error
---@see https://github.com/iamcco/markdown-preview.nvim/issues/690
---@see https://github.com/iamcco/markdown-preview.nvim/issues/695
if not package_manager then error "Missing `yarn` or `npx` in the PATH" end
local cmd = string.format(
"!cd %s && cd app && COREPACK_ENABLE_AUTO_PIN=0 %s install --frozen-lockfile",
plugin.dir,
package_manager
)
vim.cmd(cmd)
end,
ft = { "markdown", "markdown.mdx" },
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
init = function()
local plugin = require("lazy.core.config").spec.plugins["markdown-preview.nvim"]
vim.g.mkdp_filetypes = require("lazy.core.plugin").values(plugin, "ft", true)
end,
dependencies = {
{ "AstroNvim/astroui", opts = { icons = { Markdown = "" } } },
{
"AstroNvim/astrocore",
optional = true,
opts = function(_, opts)
local maps = opts.mappings
local prefix = "<Leader>M"
maps.n[prefix] = { desc = require("astroui").get_icon("Markdown", 1, true) .. "Markdown" }
maps.n[prefix .. "p"] = { "<cmd>MarkdownPreview<cr>", desc = "Preview" }
maps.n[prefix .. "s"] = { "<cmd>MarkdownPreviewStop<cr>", desc = "Stop preview" }
maps.n[prefix .. "t"] = { "<cmd>MarkdownPreviewToggle<cr>", desc = "Toggle preview" }
end,
},
},
}

View File

@@ -1,19 +1,19 @@
-- Plugins related to motion
return {
-- Faster change/delete/replace delimiter pairs
{
"echasnovski/mini.surround",
opts = { n_lines = 200 },
keys = {
{ "sa", mode = { "n", "x" }, desc = "Add surrounding" },
{ "sd", mode = { "n", "x" }, desc = "Delete surrounding" },
{ "sr", mode = { "n", "x" }, desc = "Replace surrounding" },
{ "sf", mode = { "n", "x" }, desc = "Find right surrounding" },
{ "sF", mode = { "n", "x" }, desc = "Find left surrounding" },
{ "sh", mode = { "n", "x" }, desc = "Highlight surrounding" },
{ "sn", mode = { "n", "x" }, desc = "Update `MiniSurround.config.n_lines`" },
},
},
-- {
-- "echasnovski/mini.surround",
-- opts = { n_lines = 200 },
-- keys = {
-- { "sa", mode = { "n", "x" }, desc = "Add surrounding" },
-- { "sd", mode = { "n", "x" }, desc = "Delete surrounding" },
-- { "sr", mode = { "n", "x" }, desc = "Replace surrounding" },
-- { "sf", mode = { "n", "x" }, desc = "Find right surrounding" },
-- { "sF", mode = { "n", "x" }, desc = "Find left surrounding" },
-- { "sh", mode = { "n", "x" }, desc = "Highlight surrounding" },
-- { "sn", mode = { "n", "x" }, desc = "Update `MiniSurround.config.n_lines`" },
-- },
-- },
-- Brackets splitjoin
{
"Wansmer/treesj",
@@ -26,68 +26,6 @@ return {
{ "gs", "<Cmd>TSJToggle<CR>", mode = { "n" }, desc = "Toggle splitjoin" },
},
},
-- {
-- "echasnovski/mini.ai",
-- event = "User AstroFile",
-- opts = function()
-- -- Register to which-key
-- local i = {
-- [" "] = "Whitespace",
-- ["?"] = "User Prompt",
-- _ = "Underscore",
-- a = "Argument",
-- b = "Paired ), ], }",
-- c = "Class",
-- d = "Digit(s)",
-- e = "Word in CamelCase & snake_case",
-- f = "Function",
-- g = "Entire file",
-- o = "Block, conditional, loop",
-- q = "Quote `, \", '",
-- t = "Tag",
-- u = "Use/call function & method",
-- U = "Use/call without dot in name",
-- }
-- local a = vim.deepcopy(i)
-- for k, v in pairs(a) do
-- a[k] = v:gsub(" including.*", "")
-- end
-- local ic = vim.deepcopy(i)
-- local ac = vim.deepcopy(a)
-- for key, name in pairs { n = "Next", l = "Last" } do
-- i[key] = vim.tbl_extend("force", { name = "Inside " .. name .. " textobject" }, ic)
-- a[key] = vim.tbl_extend("force", { name = "Around " .. name .. " textobject" }, ac)
-- end
-- require("which-key").register {
-- mode = { "o", "x" },
-- i = i,
-- a = a,
-- }
-- -- define custom textobjects
-- local ai = require "mini.ai"
-- return {
-- n_lines = 500,
-- custom_textobjects = {
-- o = ai.gen_spec.treesitter { -- code block
-- a = { "@block.outer", "@conditional.outer", "@loop.outer" },
-- i = { "@block.inner", "@conditional.inner", "@loop.inner" },
-- },
-- f = ai.gen_spec.treesitter { a = "@function.outer", i = "@function.inner" }, -- function
-- c = ai.gen_spec.treesitter { a = "@class.outer", i = "@class.inner" }, -- class
-- t = { "<([%p%w]-)%f[^<%w][^<>]->.-</%1>", "^<.->().*()</[^/]->$" }, -- tags
-- d = { "%f[%d]%d+" }, -- digits
-- e = { -- Word with case
-- { "%u[%l%d]+%f[^%l%d]", "%f[%S][%l%d]+%f[^%l%d]", "%f[%P][%l%d]+%f[^%l%d]", "^[%l%d]+%f[^%l%d]" },
-- "^().*()$",
-- },
-- u = ai.gen_spec.function_call(), -- u for "Usage"
-- U = ai.gen_spec.function_call { name_pattern = "[%w_]" }, -- without dot in function name
-- },
-- }
-- end,
-- },
-- Better move by word
{
"chrisgrieser/nvim-spider",
@@ -99,16 +37,6 @@ return {
{ "ge", "<Cmd>lua require('spider').motion('ge')<CR>", mode = { "n", "o", "x" }, desc = "Spider-ge" },
},
},
-- Duplicate line/block up/down
{
"hinell/duplicate.nvim",
keys = {
{ "<A-K>", "<Cmd>LineDuplicate -1<CR>", mode = { "n" }, desc = "Duplicate line up" },
{ "<A-J>", "<Cmd>LineDuplicate +1<CR>", mode = { "n" }, desc = "Duplicate line down" },
{ "<A-K>", "<Cmd>VisualDuplicate -1<CR>", mode = { "x" }, desc = "Duplicate block up" },
{ "<A-J>", "<Cmd>VisualDuplicate +1<CR>", mode = { "x" }, desc = "Duplicate block down" },
},
},
-- Better character motion
{
"folke/flash.nvim",
@@ -131,4 +59,23 @@ return {
},
},
},
-- Move code block
{
"echasnovski/mini.move",
event = "BufRead",
config = function()
require("mini.move").setup {
mappings = {
left = "<M-a>",
right = "<M-d>",
down = "<M-s>",
up = "<M-w>",
line_left = "<M-a>",
line_right = "<M-d>",
line_down = "<M-s>",
line_up = "<M-w>",
},
}
end,
},
}

View File

@@ -17,18 +17,17 @@ return {
enabled = false,
},
hover = {
-- enabled = false, -- disables Noice LSP hover
enabled = true, -- bật Noice hover
silent = true, -- thông báo nếu không có tài liệu hover
view = "hover", -- chế độ hiển thị mặc định cho hover
opts = { -- tùy chỉnh hiển thị
enabled = true,
silent = true,
view = "hover",
opts = {
border = {
style = "rounded", -- bo góc viền
text = { top = " Documents ", top_align = "center" }, -- tiêu đề hover
style = "rounded",
text = { top = " Documents ", top_align = "center" },
},
win_options = {
wrap = true, -- bật tự động xuống dòng
linebreak = true, -- ngắt dòng ở khoảng trắng
wrap = true,
linebreak = true,
},
},
},

View File

@@ -30,14 +30,14 @@ return {
},
-- Transparent background
{
"xiyaowong/transparent.nvim",
lazy = false,
opts = function(_, opts) opts = require "plugins.configs.ui.transparent"(opts) end,
keys = {
{ "<Leader>uT", "<Cmd>TransparentToggle<CR>", desc = "Toggle transparent" },
},
},
-- {
-- "xiyaowong/transparent.nvim",
-- lazy = false,
-- opts = function(_, opts) opts = require "plugins.configs.ui.transparent"(opts) end,
-- keys = {
-- { "<Leader>uT", "<Cmd>TransparentToggle<CR>", desc = "Toggle transparent" },
-- },
-- },
{
{
"HiPhish/rainbow-delimiters.nvim",

View File

@@ -16,5 +16,6 @@ return {
function() require("which-key").show { global = false } end,
desc = "Buffer Local Keymaps (which-key)",
},
},
}