From e31b780eeac022a8cb5819159d454826c5108705 Mon Sep 17 00:00:00 2001 From: huyjaky Date: Sun, 3 Nov 2024 19:33:51 +0700 Subject: [PATCH] astro-nvim-v3 - state of art --- lua/plugins/disabled.lua | 2 ++ lua/plugins/mini-icons.lua | 47 ++++++++++++++++++++++++++++++++++++++ lua/plugins/noice.lua | 37 +----------------------------- lua/plugins/ui.lua | 18 +-------------- 4 files changed, 51 insertions(+), 53 deletions(-) create mode 100644 lua/plugins/mini-icons.lua diff --git a/lua/plugins/disabled.lua b/lua/plugins/disabled.lua index 6fc4313..037c09a 100644 --- a/lua/plugins/disabled.lua +++ b/lua/plugins/disabled.lua @@ -23,6 +23,8 @@ return { { "HiPhish/rainbow-delimiters.nvim", enabled = true }, { "xiyaowong/transparent.nvim", enabled = true }, { "MagicDuck/grug-far.nvim", enabled = false }, + { "loctvl842/monokai-pro.nvim", enabled = false }, + {"xiyaowong/transparent.nvim", enabled = false} -- { "hrsh7th/nvim-cmp", enabled = false }, } diff --git a/lua/plugins/mini-icons.lua b/lua/plugins/mini-icons.lua new file mode 100644 index 0000000..8d228ae --- /dev/null +++ b/lua/plugins/mini-icons.lua @@ -0,0 +1,47 @@ +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/noice.lua b/lua/plugins/noice.lua index 695bf7d..ca85a39 100644 --- a/lua/plugins/noice.lua +++ b/lua/plugins/noice.lua @@ -6,36 +6,7 @@ return { config = function() require("noice").setup { -- Configuration here, or leave empty to use defaults - views = { - -- cmdline_popup = { - -- position = { - -- row = "50%", - -- col = "50%", - -- }, - -- size = { - -- width = 60, - -- height = "auto", - -- }, - -- }, - -- popupmenu = { - -- relative = "editor", - -- position = { - -- row = 8, - -- col = "50%", - -- }, - -- size = { - -- width = 60, - -- height = 10, - -- }, - -- border = { - -- style = "rounded", - -- padding = { 0, 1 }, - -- }, - -- win_options = { - -- winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, - -- }, - -- }, - }, + views = { }, messages = { enabled = false, -- disables the Noice messages UI }, @@ -134,11 +105,5 @@ return { }) end, }, - { - "catppuccin", - optional = true, - ---@type CatppuccinOptions - opts = { integrations = { noice = true } }, - }, }, } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 3bc1e13..fd1e377 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -26,23 +26,7 @@ return { opts.top_down = false end, }, - -- Icons support - { - "echasnovski/mini.icons", - opts = function(_, opts) - if vim.g.icons_enabled == false then opts.style = "glyph" end - end, - lazy = true, - specs = { - { "nvim-tree/nvim-web-devicons", enabled = false, optional = true }, - }, - init = function() - package.preload["nvim-web-devicons"] = function() - require("mini.icons").mock_nvim_web_devicons() - return package.loaded["nvim-web-devicons"] - end - end, - }, + -- Transparent background { "xiyaowong/transparent.nvim",