astro-nvim-v3 - change lsp and highlighting

This commit is contained in:
huyjaky
2025-01-01 21:24:31 +07:00
parent 86b1ec41c3
commit fa8ffc5e10
12 changed files with 166 additions and 151 deletions

View File

@@ -10,7 +10,7 @@ return {
-- Configuration table of features provided by AstroLSP
features = {
autoformat = false, -- enable or disable auto formatting on start
codelens = true, -- enable/disable codelens refresh on start
codelens = false, -- enable/disable codelens refresh on start
inlay_hints = true, -- enable/disable inlay hints on start
semantic_tokens = true, -- enable/disable semantic token highlighting
},
@@ -21,8 +21,25 @@ return {
-- customize language server configuration options passed to `lspconfig`
---@diagnostic disable: missing-fields
config = {
clangd = require "plugins.configs.lsp.config.clangd",
basedpyright = require "plugins.configs.lsp.config.basedpyright",
-- clangd = require "plugins.configs.lsp.config.clangd",
-- basedpyright = require "plugins.configs.lsp.config.basedpyright",
jedi_language_server = {
init_options = {
completion = {
disableSnippets = true,
},
},
},
ruff_lsp = {
init_options = {
settings = {
args = {
"--extend-select=W,COM,ICN",
"--ignore=E501,E722,COM812",
},
},
},
},
},
-- customize how language servers are attached
handlers = {

View File

@@ -89,5 +89,18 @@ return {
},
},
{ "ribru17/bamboo.nvim", lazy = true, opts = { integrations = { mini = true } } },
-- Using lazy.nvim
{
"ribru17/bamboo.nvim",
lazy = false,
priority = 1000,
config = function()
require("bamboo").setup {
-- optional configuration here
integrations = { mini = true },
terminal_colors = false
}
require("bamboo").load()
end,
},
}

View File

@@ -1,34 +1,34 @@
return {
before_init = function(_, c)
if not c.settings then c.settings = {} end
if not c.settings.python then c.settings.python = {} end
c.settings.python.pythonPath = vim.fn.exepath "python"
end,
settings = {
basedpyright = {
analysis = {
-- diagnosticMode = "workspace",
diagnosticMode = "openFilesOnly",
typeCheckingMode = "basic",
autoImportCompletions = true,
autoSearchPath = true,
inlayHints = {
variableTypes = true,
functionReturnTypes = true,
callArgumentNames = true,
pytestParameters = true,
},
useLibraryCodeForTypes = true,
diagnosticSeverityOverrides = {
reportUnusedImport = "information",
reportUnusedFunction = "information",
reportUnusedVariable = "information",
-- reportGeneralTypeIssues = "none",
-- reportOptionalMemberAccess = "none",
-- reportOptionalSubscript = "none",
-- reportPrivateImportUsage = "none",
},
},
},
},
}
-- return {
-- before_init = function(_, c)
-- if not c.settings then c.settings = {} end
-- if not c.settings.python then c.settings.python = {} end
-- c.settings.python.pythonPath = vim.fn.exepath "python"
-- end,
-- settings = {
-- basedpyright = {
-- analysis = {
-- -- diagnosticMode = "workspace",
-- diagnosticMode = "off",
-- typeCheckingMode = "basic",
-- autoImportCompletions = true,
-- autoSearchPath = true,
-- inlayHints = {
-- variableTypes = true,
-- functionReturnTypes = true,
-- callArgumentNames = true,
-- pytestParameters = true,
-- },
-- useLibraryCodeForTypes = true,
-- diagnosticSeverityOverrides = {
-- reportUnusedImport = "information",
-- reportUnusedFunction = "information",
-- reportUnusedVariable = "information",
-- reportGeneralTypeIssues = "none",
-- reportOptionalMemberAccess = "none",
-- reportOptionalSubscript = "none",
-- reportPrivateImportUsage = "none",
-- },
-- },
-- },
-- },
-- }

View File

@@ -1,19 +1,19 @@
return {
capabilities = {
offsetEncoding = "utf-8",
},
cmd = {
"clangd",
"--background-index",
"--clang-tidy",
"--all-scopes-completion",
"--header-insertion=iwyu",
"--completion-style=detailed",
"--fallback-style=Microsoft",
},
init_options = {
clangdFileStatus = true,
usePlaceholders = false,
completeUnimported = true,
},
}
-- return {
-- capabilities = {
-- offsetEncoding = "utf-8",
-- },
-- cmd = {
-- "clangd",
-- "--background-index",
-- "--clang-tidy",
-- "--all-scopes-completion",
-- "--header-insertion=iwyu",
-- "--completion-style=detailed",
-- "--fallback-style=Microsoft",
-- },
-- init_options = {
-- clangdFileStatus = true,
-- usePlaceholders = false,
-- completeUnimported = true,
-- },
-- }

View File

@@ -10,28 +10,13 @@ return {
DiagnosticVirtualTextHint = { fg = get_hlgroup("DiagnosticHint").fg, bg = "none" },
DiagnosticVirtualTextInfo = { fg = get_hlgroup("DiagnosticInfo").fg, bg = "none" },
DiagnosticVirtualTextWarn = { fg = get_hlgroup("DiagnosticWarn").fg, bg = "none" },
CursorLineNr = { fg = "#FFD700", bg = "none", bold = true },
Visual = { fg = "#000000", bg = "#FFFFFF", bold = true },
-- remove background of inlay hints
LspInlayHint = { fg = get_hlgroup("LspInlayHint").fg, bg = "none" },
}
if utils.is_available "kanagawa.nvim" and ui.config.colorscheme == "kanagawa" then
local colors = require("kanagawa.colors").setup()
local theme = colors.theme
hl = utils.extend_tbl(hl, {
Pmenu = { fg = theme.ui.shade0, bg = theme.ui.bg_p1 }, -- add `blend = vim.o.pumblend` to enable transparency
PmenuSel = { fg = "NONE", bg = theme.ui.bg_p2 },
PmenuSbar = { bg = theme.ui.bg_m1 },
PmenuThumb = { bg = theme.ui.bg_p2 },
TelescopeTitle = { fg = theme.ui.special, bold = true },
TelescopePromptNormal = { bg = theme.ui.bg_p1 },
TelescopePromptBorder = { fg = theme.ui.bg_p1, bg = theme.ui.bg_p1 },
TelescopeResultsNormal = { fg = theme.ui.fg_dim, bg = theme.ui.bg_m1 },
TelescopeResultsBorder = { fg = theme.ui.bg_m1, bg = theme.ui.bg_m1 },
TelescopePreviewNormal = { bg = theme.ui.bg_dim },
TelescopePromptNormalopePreviewBorder = { bg = theme.ui.bg_dim, fg = theme.ui.bg_dim },
})
end
}
return hl
end,
@@ -39,3 +24,4 @@ return {
-- Normal = { bg = "#000000" },
},
}

View File

@@ -4,7 +4,7 @@ return {
{ "s1n7ax/nvim-window-picker", enabled = false },
{ "akinsho/toggleterm.nvim", enabled = false },
{ "NvChad/nvim-colorizer.lua", enabled = false },
{ "catppuccin/nvim", name = "catppuccin", enabled = false },
{ "catppuccin/nvim", name = "catppuccin", enabled = false},
{ "rebelot/kanagawa.nvim", enabled = false },
{ "folke/tokyonight.nvim", enabled = false },
{ "f4z3r/gruvbox-material.nvim", name = "gruvbox-material", enabled = false },
@@ -27,6 +27,7 @@ return {
{ "xiyaowong/transparent.nvim", enabled = false },
{ "iamcco/markdown-preview.nvim", enabled = false },
{ "max397574/better-escape.nvim", enabled = false },
{ "ribru17/bamboo.nvim", enabled = true },
-- { "hrsh7th/nvim-cmp", enabled = false },
}

View File

@@ -17,28 +17,28 @@ return {
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,
},
},
},
},
},
},
-- {
-- "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,
-- },
-- },
-- },
-- },
-- },
-- },
}

View File

@@ -10,9 +10,11 @@ return {
-- add more things to the ensure_installed table protecting against community packs modifying it
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
"lua_ls",
"clangd",
"basedpyright",
"jedi_language_server",
"ruff",
-- "clangd",
-- "basedpyright",
-- "ruff",
})
end,
},
@@ -24,9 +26,9 @@ return {
-- add more things to the ensure_installed table protecting against community packs modifying it
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, {
"stylua",
"clang-format",
-- "clang-format",
-- "black",
"prettier",
-- "prettier",
})
end,
},

View File

@@ -14,7 +14,7 @@ return {
})
opts.highlight = {
enable = true,
disable = { "c", "rust", "tsx", "javascript", "python"},
disable = { "c", "rust", "tsx", "javascript"},
additional_vim_regex_highlighting = false,
custom_captures = {
-- Highlight local variables