[nvchad] fix configuration

This commit is contained in:
2025-03-03 11:18:02 +07:00
parent 78ab401193
commit cc4fd91e74
15 changed files with 205 additions and 201 deletions

View File

@@ -1,8 +1,5 @@
--type conform.options
local options = {
lsp_fallback = true,
formatters_by_ft = {
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettier" },
@@ -10,16 +7,7 @@ local options = {
html = { "prettier" },
sh = { "shfmt" },
},
-- adding same formatter for multiple filetypes can look too much work for some
-- instead of the above code you could just use a loop! the config is just a table after all!
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
},
}
require("conform").setup(options)
return options

View File

@@ -0,0 +1,19 @@
-- To find any highlight groups: "<cmd> Telescope highlights"
-- Each highlight group can take a table with variables fg, bg, bold, italic, etc
-- base30 variable names can also be used as colors
local M = {}
---@type Base46HLGroupsList
M.override = {
Comment = {
italic = true,
},
}
---@type HLTable
M.add = {
NvimTreeOpenedFolderName = { fg = "green", bold = true },
}
return M

View File

@@ -0,0 +1,47 @@
return {
defaults = { lazy = true },
install = { colorscheme = { "nvchad" } },
ui = {
icons = {
ft = "",
lazy = "󰂠 ",
loaded = "",
not_loaded = "",
},
},
performance = {
rtp = {
disabled_plugins = {
"2html_plugin",
"tohtml",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
},
},
},
}

View File

@@ -1,13 +1,13 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
-- load defaults i.e lua_lsp
require("nvchad.configs.lspconfig").defaults()
local lspconfig = require "lspconfig"
-- if you just want default config for the servers then put them in a table
local servers = {
-- front-end
"html",
"cssls",
"tsserver",
"ts_ls",
-- back-end
"gopls",
-- static files
@@ -17,11 +17,14 @@ local servers = {
"dockerls",
"docker_compose_language_service",
}
local nvlsp = require "nvchad.configs.lspconfig"
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init,
capabilities = nvlsp.capabilities,
}
end
@@ -29,5 +32,9 @@ lspconfig.intelephense.setup{
filetypes = { 'php', 'ctp' }
}
-- lspconfig.pyright.setup { blabla}
-- configuring single server, example: typescript
-- lspconfig.ts_ls.setup {
-- on_attach = nvlsp.on_attach,
-- on_init = nvlsp.on_init,
-- capabilities = nvlsp.capabilities,
-- }

View File

@@ -0,0 +1,30 @@
local config = {
ensure_installed = {
-- lua stuff
"lua-language-server",
"stylua",
-- web dev stuff
"css-lsp",
"html-lsp",
"typescript-language-server",
"deno",
"prettier",
"json-lsp",
"yaml-language-server",
-- c/cpp stuff
"clangd",
"clang-format",
-- golang stuff
"gopls",
"goimports",
-- php stuff
"intelephense",
-- docker
"docker-compose-language-service",
"dockerfile-language-server",
-- shell stuff
"shfmt",
},
}
return config

View File

@@ -0,0 +1,17 @@
local config = {
git = {
enable = true,
},
renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}
return config

View File

@@ -1,71 +0,0 @@
local M = {}
M.treesitter = {
ensure_installed = {
"vim",
"vimdoc",
"lua",
"html",
"css",
"javascript",
"typescript",
"tsx",
"c",
"cmake",
"markdown",
"markdown_inline",
},
indent = {
enable = true,
-- disable = {
-- "python"
-- },
},
}
M.mason = {
ensure_installed = {
-- lua stuff
"lua-language-server",
"stylua",
-- web dev stuff
"css-lsp",
"html-lsp",
"typescript-language-server",
"deno",
"prettier",
"json-lsp",
"yaml-language-server",
-- c/cpp stuff
"clangd",
"clang-format",
-- golang stuff
"gopls",
"goimports",
-- php stuff
"intelephense",
-- docker
"docker-compose-language-service",
"dockerfile-language-server",
-- shell stuff
"shfmt",
},
}
-- git support in nvimtree
M.nvimtree = {
git = {
enable = true,
},
renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}
return M

View File

@@ -0,0 +1,21 @@
local conf = {
ensure_installed = {
"vim",
"vimdoc",
"lua",
"html",
"css",
"javascript",
"typescript",
"tsx",
"c",
"cmake",
"markdown",
"markdown_inline",
},
indent = {
enable = true,
},
}
return conf