add nvchad-config

This commit is contained in:
2024-03-07 15:46:59 +07:00
parent c804fb8d2b
commit 2af9ff9194
9 changed files with 295 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
--type conform.options
local options = {
lsp_fallback = true,
formatters_by_ft = {
lua = { "stylua" },
javascript = { "prettier" },
css = { "prettier" },
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)

View File

@@ -0,0 +1,33 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
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",
-- back-end
"gopls",
-- static files
"jsonls",
"yamlls",
-- docker
"dockerls",
"docker_compose_language_service",
}
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
end
lspconfig.intelephense.setup{
filetypes = { 'php', 'ctp' }
}
-- lspconfig.pyright.setup { blabla}

View File

@@ -0,0 +1,69 @@
local M = {}
M.treesitter = {
ensure_installed = {
"vim",
"lua",
"html",
"css",
"javascript",
"typescript",
"tsx",
"c",
"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