diff --git a/lazy-lock.json b/lazy-lock.json index 1ad30ac..ff984e8 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -36,7 +36,7 @@ "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, "nvim-scrollview": { "branch": "main", "commit": "c29c5f69d37040a1fac88cbea7f5e6f06f0aff4d" }, - "nvim-tree.lua": { "branch": "master", "commit": "707b24af91a1d05823099ed8c5450796290466ba" }, + "nvim-tree.lua": { "branch": "master", "commit": "85c502e9076d9c82e2f04addabb3614846ae7558" }, "nvim-treesitter": { "branch": "master", "commit": "f197a15b0d1e8d555263af20add51450e5aaa1f0" }, "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" }, diff --git a/lua/core/init.lua b/lua/core/init.lua index 8289a90..4efce92 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -5,7 +5,7 @@ require("user.colorscheme") require("user.keymaps") -- require("user.snip") -- require("core.neovide") --- require("custom.autocmd") +require("custom.autocmd") -- require("custom.keymaps") -- require("user.nvim-tree") -- require("user.options") diff --git a/lua/custom/autocmd.lua b/lua/custom/autocmd.lua index d0b1371..f77b215 100644 --- a/lua/custom/autocmd.lua +++ b/lua/custom/autocmd.lua @@ -9,7 +9,7 @@ end -- get folder name from current directory local _get_folder_name = function() local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") - return " 󱧶 " .. str:lower():gsub("^%l", string.upper) .. " " + return " " .. str:lower():gsub("^%l", string.upper) .. " " end local term_program = vim.fn.getenv("TERM_PROGRAM") diff --git a/lua/custom/default.lua b/lua/custom/default.lua index fe714cd..eabd364 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -11,7 +11,7 @@ -- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha -- dracula -- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox -vim.g.pcode_colorscheme = "tokyonight" +vim.g.pcode_colorscheme = "tokyonight-storm" -- custom transparent mode -- only support diff --git a/lua/custom/plugins/bufferline.lua b/lua/custom/plugins/bufferline.lua index ca7678f..1afe7dc 100644 --- a/lua/custom/plugins/bufferline.lua +++ b/lua/custom/plugins/bufferline.lua @@ -1,167 +1,167 @@ return { - -- "akinsho/bufferline.nvim", - -- event = "VeryLazy", - -- config = function() - -- local status_ok, bufferline = pcall(require, "bufferline") - -- if not status_ok then - -- return - -- end - -- - -- local icons = require("user.icons") - -- local use_icons = true - -- - -- -- get folder name from current directory - -- local _get_folder_name = function() - -- local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") - -- return " 󱧶 " .. str:lower():gsub("^%l", string.upper) .. " " - -- end - -- - -- local function diagnostics_indicator(num, _, diagnostics, _) - -- local result = {} - -- local symbols = { - -- error = icons.diagnostics.Error, - -- warning = icons.diagnostics.Warning, - -- info = icons.diagnostics.Information, - -- } - -- if not use_icons then - -- return "(" .. num .. ")" - -- end - -- for name, count in pairs(diagnostics) do - -- if symbols[name] and count > 0 then - -- table.insert(result, symbols[name] .. " " .. count) - -- end - -- end - -- result = table.concat(result, " ") - -- return #result > 0 and result or "" - -- end - -- - -- vim.opt.termguicolors = true - -- - -- bufferline.setup({ - -- options = { - -- color_icons = true, - -- numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, - -- close_command = function(bufnum) - -- require("bufdelete").bufdelete(bufnum, true) - -- end, - -- right_mouse_command = function(bufnum) - -- require("bufdelete").bufdelete(bufnum, true) - -- end, - -- -- close_command = "bdelete! %d", - -- -- right_mouse_command = "bdelete! %d", - -- left_mouse_command = "buffer %d", - -- middle_mouse_command = nil, - -- - -- indicator_icon = nil, - -- indicator = { style = "icon", icon = "▎" }, - -- buffer_close_icon = icons.ui.Close, - -- modified_icon = icons.ui.Circle, - -- close_icon = icons.ui.BoldClose, - -- left_trunc_marker = icons.ui.ArrowCircleLeft, - -- right_trunc_marker = icons.ui.ArrowCircleRight, - -- max_name_length = 30, - -- max_prefix_length = 30, - -- tab_size = 21, - -- diagnostics = false, -- | "nvim_lsp" | "coc", - -- diagnostics_update_in_insert = false, - -- diagnostics_indicator = diagnostics_indicator, - -- offsets = { - -- { - -- filetype = "NvimTree", - -- text = _get_folder_name(), - -- highlight = "Directory", - -- text_align = "left", - -- padding = 1, - -- }, - -- { - -- filetype = "neo-tree", - -- text = _get_folder_name(), - -- highlight = "Directory", - -- text_align = "left", - -- padding = 1, - -- }, - -- }, - -- show_buffer_icons = true, - -- show_buffer_close_icons = true, - -- show_close_icon = true, - -- show_tab_indicators = true, - -- persist_buffer_sort = true, -- whether or not custom sorted buffers should persist - -- separator_style = { "", "" }, -- | "thick" | "thin" | { 'any', 'any' }, - -- enforce_regular_tabs = true, - -- always_show_bufferline = true, - -- }, - -- highlights = { - -- background = { - -- fg = { attribute = "fg", highlight = "TabLine" }, - -- bg = { attribute = "none", highlight = "TabLine" }, - -- }, - -- buffer_visible = { - -- fg = { attribute = "fg", highlight = "TabLine" }, - -- bg = { attribute = "none", highlight = "TabLine" }, - -- }, - -- close_button = { - -- fg = { attribute = "fg", highlight = "TabLine" }, - -- bg = { attribute = "none", highlight = "TabLine" }, - -- }, - -- close_button_visible = { - -- fg = { attribute = "fg", highlight = "TabLine" }, - -- bg = { attribute = "none", highlight = "TabLine" }, - -- }, - -- tab_selected = { - -- fg = { attribute = "fg", highlight = "Normal" }, - -- bg = { attribute = "bg", highlight = "Normal" }, - -- }, - -- tab = { - -- fg = { attribute = "fg", highlight = "TabLine" }, - -- bg = { attribute = "bg", highlight = "TabLine" }, - -- }, - -- tab_close = { - -- -- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, - -- fg = { attribute = "fg", highlight = "TabLineSel" }, - -- bg = { attribute = "bg", highlight = "Normal" }, - -- }, - -- duplicate_selected = { - -- fg = { attribute = "fg", highlight = "TabLineSel" }, - -- bg = { attribute = "bg", highlight = "TabLineSel" }, - -- underline = true, - -- }, - -- duplicate_visible = { - -- fg = { attribute = "fg", highlight = "TabLine" }, - -- bg = { attribute = "bg", highlight = "TabLine" }, - -- underline = true, - -- }, - -- duplicate = { - -- fg = { attribute = "fg", highlight = "TabLine" }, - -- bg = { attribute = "bg", highlight = "TabLine" }, - -- underline = true, - -- }, - -- - -- modified = { - -- fg = { attribute = "fg", highlight = "TabLine" }, - -- bg = { attribute = "bg", highlight = "TabLine" }, - -- }, - -- modified_selected = { - -- fg = { attribute = "fg", highlight = "Normal" }, - -- bg = { attribute = "bg", highlight = "Normal" }, - -- }, - -- modified_visible = { - -- fg = { attribute = "fg", highlight = "TabLine" }, - -- bg = { attribute = "bg", highlight = "TabLine" }, - -- }, - -- - -- separator = { - -- fg = { attribute = "bg", highlight = "TabLine" }, - -- bg = { attribute = "bg", highlight = "TabLine" }, - -- }, - -- separator_selected = { - -- fg = { attribute = "bg", highlight = "Normal" }, - -- bg = { attribute = "bg", highlight = "Normal" }, - -- }, - -- indicator_selected = { - -- fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - -- bg = { attribute = "bg", highlight = "Normal" }, - -- }, - -- }, - -- }) - -- end, + "akinsho/bufferline.nvim", + event = "VeryLazy", + config = function() + local status_ok, bufferline = pcall(require, "bufferline") + if not status_ok then + return + end + + local icons = require("user.icons") + local use_icons = true + + -- get folder name from current directory + local _get_folder_name = function() + local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") + return " 󱧶 " .. str:lower():gsub("^%l", string.upper) .. " " + end + + local function diagnostics_indicator(num, _, diagnostics, _) + local result = {} + local symbols = { + error = icons.diagnostics.Error, + warning = icons.diagnostics.Warning, + info = icons.diagnostics.Information, + } + if not use_icons then + return "(" .. num .. ")" + end + for name, count in pairs(diagnostics) do + if symbols[name] and count > 0 then + table.insert(result, symbols[name] .. " " .. count) + end + end + result = table.concat(result, " ") + return #result > 0 and result or "" + end + + vim.opt.termguicolors = true + + bufferline.setup({ + options = { + color_icons = true, + numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, + close_command = function(bufnum) + require("bufdelete").bufdelete(bufnum, true) + end, + right_mouse_command = function(bufnum) + require("bufdelete").bufdelete(bufnum, true) + end, + -- close_command = "bdelete! %d", + -- right_mouse_command = "bdelete! %d", + left_mouse_command = "buffer %d", + middle_mouse_command = nil, + + indicator_icon = nil, + indicator = { style = "icon", icon = "▎" }, + buffer_close_icon = icons.ui.Close, + modified_icon = icons.ui.Circle, + close_icon = icons.ui.BoldClose, + left_trunc_marker = icons.ui.ArrowCircleLeft, + right_trunc_marker = icons.ui.ArrowCircleRight, + max_name_length = 30, + max_prefix_length = 30, + tab_size = 21, + diagnostics = false, -- | "nvim_lsp" | "coc", + diagnostics_update_in_insert = false, + diagnostics_indicator = diagnostics_indicator, + offsets = { + { + filetype = "NvimTree", + text = _get_folder_name(), + highlight = "Directory", + text_align = "left", + padding = 1, + }, + { + filetype = "neo-tree", + text = _get_folder_name(), + highlight = "Directory", + text_align = "left", + padding = 1, + }, + }, + show_buffer_icons = true, + show_buffer_close_icons = true, + show_close_icon = true, + show_tab_indicators = true, + persist_buffer_sort = true, -- whether or not custom sorted buffers should persist + separator_style = { "", "" }, -- | "thick" | "thin" | { 'any', 'any' }, + enforce_regular_tabs = true, + always_show_bufferline = true, + }, + highlights = { + background = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "none", highlight = "TabLine" }, + }, + buffer_visible = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "none", highlight = "TabLine" }, + }, + close_button = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "none", highlight = "TabLine" }, + }, + close_button_visible = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "none", highlight = "TabLine" }, + }, + tab_selected = { + fg = { attribute = "fg", highlight = "Normal" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, + tab = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + tab_close = { + -- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, + fg = { attribute = "fg", highlight = "TabLineSel" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, + duplicate_selected = { + fg = { attribute = "fg", highlight = "TabLineSel" }, + bg = { attribute = "bg", highlight = "TabLineSel" }, + underline = true, + }, + duplicate_visible = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + underline = true, + }, + duplicate = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + underline = true, + }, + + modified = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + modified_selected = { + fg = { attribute = "fg", highlight = "Normal" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, + modified_visible = { + fg = { attribute = "fg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + + separator = { + fg = { attribute = "bg", highlight = "TabLine" }, + bg = { attribute = "bg", highlight = "TabLine" }, + }, + separator_selected = { + fg = { attribute = "bg", highlight = "Normal" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, + indicator_selected = { + fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, + bg = { attribute = "bg", highlight = "Normal" }, + }, + }, + }) + end, } diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index ec574c4..e603bd7 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -126,7 +126,65 @@ return { end, }, -- for formater linter - { "RRethy/vim-illuminate", event = "BufRead", lazy = true }, + { + "RRethy/vim-illuminate", + event = "BufRead", + lazy = true, + config = function() + local status_ok, illuminate = pcall(require, "illuminate") + if not status_ok then + return + end + illuminate.configure({ + options = { + -- providers: provider used to get references in the buffer, ordered by priority + providers = { + "lsp", + "treesitter", + "regex", + }, + -- delay: delay in milliseconds + delay = 120, + -- filetype_overrides: filetype specific overrides. + -- The keys are strings to represent the filetype while the values are tables that + -- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist + filetype_overrides = {}, + -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist + filetypes_denylist = { + "dirvish", + "fugitive", + "alpha", + "NvimTree", + "lazy", + "neogitstatus", + "Trouble", + "lir", + "Outline", + "spectre_panel", + "toggleterm", + "DressingSelect", + "TelescopePrompt", + }, + -- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist + filetypes_allowlist = {}, + -- modes_denylist: modes to not illuminate, this overrides modes_allowlist + modes_denylist = {}, + -- modes_allowlist: modes to illuminate, this is overridden by modes_denylist + modes_allowlist = {}, + -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist + -- Only applies to the 'regex' provider + -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') + providers_regex_syntax_denylist = {}, + -- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist + -- Only applies to the 'regex' provider + -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') + providers_regex_syntax_allowlist = {}, + -- under_cursor: whether or not to illuminate under the cursor + under_cursor = true, + }, + }) + end, + }, { "jayp0521/mason-null-ls.nvim", lazy = true, @@ -372,7 +430,12 @@ return { -- dependencies = "nvim-treesitter/nvim-treesitter", -- }, -- for git - { "HiPhish/nvim-ts-rainbow2", lazy = true, event = "BufRead", dependencies = "nvim-treesitter/nvim-treesitter" }, + { + "HiPhish/nvim-ts-rainbow2", + lazy = true, + event = "BufRead", + dependencies = "nvim-treesitter/nvim-treesitter", + }, { "lewis6991/gitsigns.nvim", lazy = true, diff --git a/lua/user/colorizer.lua b/lua/user/colorizer.lua index 318656a..e7e20a0 100644 --- a/lua/user/colorizer.lua +++ b/lua/user/colorizer.lua @@ -3,6 +3,18 @@ if not status_ok then return end colorizer_cfg.setup({ + DEFAULT_OPTIONS = { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + names = true, -- "Name" codes like Blue + RRGGBBAA = true, -- #RRGGBBAA hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn + -- Available modes: foreground, background + mode = "background", -- Set the display mode. + }, filetypes = { "*", -- Highlight all files, but customize some others. css = { rgb_fn = true }, -- Enable parsing rgb(...) functions in css. diff --git a/lua/user/tokyonight.lua b/lua/user/tokyonight.lua index 146264b..cb4ac03 100644 --- a/lua/user/tokyonight.lua +++ b/lua/user/tokyonight.lua @@ -28,7 +28,7 @@ tokyonight.setup({ -- Value is any valid attr-list value for `:help nvim_set_hl` -- comments = { italic = true }, comments = { italic = true }, - keywords = { italic = true }, + keywords = {}, functions = {}, variables = {}, -- Background styles. Can be "dark", "transparent" or "normal" @@ -66,6 +66,8 @@ tokyonight.setup({ } highlights.BufferLineFill = { bg = colors.bg } highlights.NvimTreeSpecialFile = { fg = colors.purple, underline = false } - highlights["@property"] = { fg = colors.green1, italic = true } + highlights["@tag.attribute"] = { fg = colors.green1, italic = true } + -- highlights["@keyword.function"] = { fg = colors.blue, italic = true } + -- highlights["@function"] = { fg = colors.blue, italic = true } end, })