added rust and cpp analyzer

This commit is contained in:
2025-09-27 10:24:43 +02:00
parent 5904040670
commit fba61bc3a5
28 changed files with 349 additions and 159 deletions

View File

@@ -4,7 +4,7 @@ return {
{ import = "lazyvim.plugins.extras.util.octo" },
{ import = "plugins.extras.lang.git-extended" },
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "gh" })

View File

@@ -3,7 +3,7 @@ local prettier = { "prettierd", "prettier", stop_after_first = true }
return {
{ import = "lazyvim.plugins.extras.formatting.prettier" },
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"prettierd",

View File

@@ -9,7 +9,7 @@ return {
end,
},
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"ruff",

View File

@@ -1,6 +1,6 @@
return {
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"rustywind",

View File

@@ -20,7 +20,7 @@ return {
end,
},
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"shfmt",

View File

@@ -21,7 +21,7 @@ return {
{ import = "plugins.extras.lang.yaml-extended" },
{ import = "lazyvim.plugins.extras.lang.ansible" },
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"ansible-language-server",

View File

@@ -16,7 +16,7 @@ return {
},
},
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"bash-language-server",

View File

@@ -1,7 +1,7 @@
return {
{ import = "lazyvim.plugins.extras.lang.go" },
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"golangci-lint",

View File

@@ -16,7 +16,7 @@ return {
},
},
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"julia-lsp",

View File

@@ -1,7 +1,7 @@
return {
{ import = "plugins.extras.lang.web.typescript-extended" },
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"graphql-language-service-cli",

View File

@@ -41,7 +41,7 @@ return {
},
},
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"emmet-language-server",

View File

@@ -8,7 +8,7 @@ return {
},
},
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"htmx-lsp",

View File

@@ -19,7 +19,7 @@ return {
},
},
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"vetur-vls",

View File

@@ -16,7 +16,7 @@ return {
},
},
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"lemminx",

View File

@@ -1,7 +1,7 @@
return {
{ import = "lazyvim.plugins.extras.lang.zig" },
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"codelldb",

View File

@@ -1,6 +1,6 @@
return {
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"biome",

View File

@@ -1,6 +1,6 @@
return {
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"pylint",

View File

@@ -1,6 +1,6 @@
return {
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"selene",

View File

@@ -1,6 +1,6 @@
return {
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"typos",

View File

@@ -1,6 +1,6 @@
return {
{
"williamboman/mason.nvim",
"mason-org/mason.nvim",
opts = {
ensure_installed = {
"vale",

View File

@@ -0,0 +1,203 @@
local float = require("config.defaults").diagnostics_options.float
return {
{
"neovim/nvim-lspconfig",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{
"ray-x/lsp_signature.nvim",
opts = {
bind = true,
max_height = float.max_height,
max_width = float.max_width,
hint_inline = function()
return vim.version.gt(vim.version(), { 0, 9, 0 })
end,
handler_opts = {
border = float.border,
},
},
},
{
"folke/neodev.nvim",
ft = "lua",
opts = {
pathStrict = true,
library = { plugins = { "nvim-dap-ui" }, types = true },
},
},
},
opts = {
-- LSP Server Settings
servers = {
-- cssls = {},
-- html = {},
-- jsonls = {},
-- tailwindcss = {},
-- tsserver = {},
-- volar = {},
bashls = {
filetypes = { "bash", "sh" },
},
mojo = {},
-- use pylsp-mypy for mypy
-- use python-lsp-ruff for ruff
-- use pylsp-inlay-hints for inlay hints
pylsp = {},
phan = {},
phpactor = {},
psalm = {},
clangd = {
cmd = {
"clangd",
"--clang-tidy",
"-j=5",
"--malloc-trim",
},
filetypes = { "c" }, -- "cpp"
},
zls = {},
rust_analyzer = {
settings = {
["rust-analyzer"] = {
check = {
command = "clippy",
features = "all",
},
},
},
},
lua_ls = {
cmd = {
"lua-language-server",
"-E",
"/usr/share/lua-language-server/main.lua",
},
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if
vim.uv.fs_stat(path .. "/.luarc.json")
or vim.uv.fs_stat(path .. "/.luarc.jsonc")
then
return
end
end
end,
settings = {
Lua = {
runtime = {
-- LuaJIT in the case of Neovim
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.env.VIMRUNTIME,
-- This feature causes the lsp to use the "environment emulation" feature to suggest
-- applying a library/framework when a certain keyword or filename has been found
checkThirdParty = false,
},
-- disable lua_ls default formater since I use stylua
format = { enable = false },
hint = { enable = true, setType = true },
},
},
},
},
-- you can do any additional lsp server setup here
setup = {
lua_ls = function(server, opts)
require("lspconfig")[server].setup(opts)
end,
},
},
config = function(_, opts)
local on_attach = function(client, bufnr)
_ = client
_ = bufnr
-- if vim.filetype.match({ buf = bufnr }) == "lua" then
-- end
require("lspconfig.ui.windows").default_options = {
border = float.border,
}
end
local function setup(server, server_config)
if opts.setup[server] then
if opts.setup[server](server, server_config) then
return
end
end
require("lspconfig")[server].setup(server_config)
end
local servers = opts.servers
local capabilities = require("cmp_nvim_lsp").default_capabilities(
vim.lsp.protocol.make_client_capabilities()
)
for server, _ in pairs(servers) do
local server_config = vim.tbl_deep_extend("force", {
capabilities = vim.deepcopy(capabilities),
on_attach = on_attach,
}, servers[server] or {})
setup(server, server_config)
end
end,
},
{
"nvimdev/lspsaga.nvim",
event = "LspAttach",
opts = {
ui = {
border = float.border,
},
outline = {
layout = "float",
},
},
},
{
"nvimtools/none-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = function()
local null_ls = require("null-ls")
return {
diagnostics_format = "#{m} (#{s})",
sources = {
-- cpp
null_ls.builtins.diagnostics.cppcheck.with({
extra_args = {
"--inconclusive",
},
}),
-- lua
null_ls.builtins.diagnostics.selene,
null_ls.builtins.formatting.stylua,
-- php
null_ls.builtins.diagnostics.phpstan,
null_ls.builtins.formatting.phpcsfixer,
-- shell
null_ls.builtins.diagnostics.zsh.with({
filetypes = { "zsh" },
}),
null_ls.builtins.hover.printenv.with({
filetypes = { "zsh", "bash", "sh", "dosbatch", "ps1" },
}),
-- Docker
null_ls.builtins.diagnostics.hadolint,
-- opengl
null_ls.builtins.diagnostics.glslc.with({
-- use opengl instead of vulkan1.0
extra_args = { "--target-env=opengl" },
}),
},
}
end,
},
}

View File

@@ -1,5 +1,5 @@
return {
"williamboman/mason.nvim",
"mason-org/mason.nvim",
keys = {
{ "<leader>cm", false },
{ "<leader>cim", "<cmd>Mason<cr>", desc = "Mason" },

View File

@@ -1,4 +1,5 @@
local palette = require("catppuccin.palettes").get_palette("macchiato") -- Import your favorite catppuccin colors
local palette = require("catppuccin.palettes").get_palette("macchiato")
local transparent_bg = require("catppuccin").options.transparent_background and "NONE" or palette.mantle
return {
{
@@ -6,6 +7,24 @@ return {
lazy = false,
name = "catppuccin",
opts = {
custom_highlights = {
-- Blink Menu
Pmenu = { bg = palette.base },
PmenuSel = { bg = palette.surface1, style = { "bold" } },
PmenuBar = { bg = palette.surface1 },
BlinkCmpMenuBorder = { bg = palette.base },
-- Snacks
SnacksNotifierInfo = { fg = palette.lavender },
SnacksNotifierIconInfo = { fg = palette.lavender },
SnacksNotifierTitleInfo = { fg = palette.lavender, style = { "italic" } },
SnacksNotifierFooterInfo = { link = "DiagnosticInfo" },
SnacksNotifierBorderInfo = { fg = palette.lavender },
SnacksPickerPreviewTitle = { fg = palette.crust, bg = palette.lavender },
SnacksDashboardHeader = { fg = palette.lavender },
["@property"] = { fg = palette.lavender, style = require("catppuccin").options.styles.properties or {} },
},
styles = {
comments = { "italic" },
},
@@ -13,102 +32,25 @@ return {
light = "latte",
dark = "macchiato",
},
transparent_background = true,
term_colors = true,
custom_highlights = function()
return {
Visual = { bg = palette.surface2 },
FloatermBorder = { fg = palette.base },
TelescopeMatching = { fg = palette.blue },
TelescopeSelection = { fg = palette.text, bg = palette.surface0, bold = true },
TelescopePromptPrefix = { bg = palette.surface0 },
TelescopePromptNormal = { bg = palette.surface0 },
TelescopeResultsNormal = { bg = palette.mantle },
TelescopePreviewNormal = { bg = palette.mantle },
TelescopePromptBorder = { bg = palette.surface0, fg = palette.surface0 },
TelescopeResultsBorder = { bg = palette.mantle, fg = palette.mantle },
TelescopePreviewBorder = { bg = palette.mantle, fg = palette.mantle },
TelescopePromptTitle = { bg = palette.red, fg = palette.mantle },
TelescopeResultsTitle = { fg = palette.mantle },
TelescopePreviewTitle = { bg = palette.green, fg = palette.mantle },
}
end,
auto_integrations = true,
integrations = {
alpha = true,
cmp = true,
barbecue = {
dim_dirname = true, -- directory name is dimmed by default
bold_basename = true,
dim_context = false,
alt_background = false,
},
colorful_winsep = {
snacks = {
enabled = true,
color = "lavender",
indent_scope_color = "lavender",
},
dap = true,
dap_ui = true,
dashboard = true,
diffview = true,
flash = true,
headlines = true,
gitsigns = true,
grug_far = true,
harpoon = false,
illuminate = true,
indent_blankline = {
enabled = true,
scope_color = "lavender", -- catppuccin color (eg. `lavender`) Default: text
colored_indent_levels = false,
},
render_markdown = true,
mason = true,
markdown = true,
mini = true,
native_lsp = {
enabled = true,
virtual_text = {
errors = { "italic" },
hints = { "italic" },
warnings = { "italic" },
information = { "italic" },
},
underlines = {
errors = { "underline" },
hints = { "underline" },
warnings = { "underline" },
information = { "underline" },
},
inlay_hints = {
background = true,
},
},
lsp_trouble = false,
navic = { enabled = false, custom_bg = "lualine" },
neotest = true,
neogit = false,
neotree = true,
notify = true,
noice = true,
ufo = true,
overseer = false,
octo = false,
rainbow_delimiters = true,
semantic_tokens = true,
snacks = true,
telescope = {
enabled = true,
},
symbols_outline = false,
treesitter = true,
treesitter_context = false,
which_key = true,
},
float = {
transparent = true, -- enables transparency on floating windows
solid = true, -- use nvchad styling for floating windows
},
},
},
{
"akinsho/bufferline.nvim",
opts = {
highlights = require("catppuccin.groups.integrations.bufferline").get({
highlights = require("catppuccin.groups.integrations.bufferline").get_theme({
styles = { "italic", "bold" },
custom = {
all = {
@@ -158,4 +100,49 @@ return {
},
},
},
{
"nvim-lualine/lualine.nvim",
opts = {
options = {
theme = {
normal = {
a = { bg = palette.lavender, fg = palette.mantle, gui = "bold" },
b = { bg = palette.surface0, fg = palette.lavender },
c = { bg = transparent_bg, fg = palette.text },
},
insert = {
a = { bg = palette.green, fg = palette.base, gui = "bold" },
b = { bg = palette.surface0, fg = palette.green },
},
terminal = {
a = { bg = palette.green, fg = palette.base, gui = "bold" },
b = { bg = palette.surface0, fg = palette.green },
},
command = {
a = { bg = palette.peach, fg = palette.base, gui = "bold" },
b = { bg = palette.surface0, fg = palette.peach },
},
visual = {
a = { bg = palette.mauve, fg = palette.base, gui = "bold" },
b = { bg = palette.surface0, fg = palette.mauve },
},
replace = {
a = { bg = palette.red, fg = palette.base, gui = "bold" },
b = { bg = palette.surface0, fg = palette.red },
},
inactive = {
a = { bg = transparent_bg, fg = palette.lavender },
b = { bg = transparent_bg, fg = palette.surface1, gui = "bold" },
c = { bg = transparent_bg, fg = palette.overlay0 },
},
},
},
},
},
}

View File

@@ -1,16 +1,17 @@
return {
"folke/noice.nvim",
opts = function(_, opts)
table.insert(opts.routes, {
filter = {
event = "notify",
find = "No information available",
opts = {
cmdline = {
view = "cmdline",
},
lsp = {
progress = {
enabled = false,
},
opts = {
skip = true,
},
})
opts.presets.lsp_doc_border = true
opts.presets.bottom_search = false
end,
},
presets = {
lsp_doc_border = true,
bottom_search = false,
},
},
}

View File

@@ -1,5 +1,5 @@
return {
"williamboman/mason.nvim",
"mason-org/mason.nvim",
dependencies = {
"zapling/mason-lock.nvim",
cmd = { "MasonLock", "MasonLockRestore" },