HELLO NvChad

This commit is contained in:
2023-12-16 23:48:41 -05:00
parent c8777040fb
commit fb4b0a7261
11 changed files with 398 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
-- local util = require "lspconfig/util"
-- if you just want default config for the servers then put them in a table
local servers = { "html", "cssls", "tsserver", "clangd" }
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
end
-- lspconfig.rust_analyzer.setup({
-- on_attach = on_attach,
-- capabilities = capabilities,
-- filetypes = {"rust"},
-- root_dir = util.root_pattern("Cargo.toml"),
-- settings = {},
-- ['rust-analyzer'] = {
-- cargo = {
-- allFeatures = true,
-- }
-- }
-- })
--
-- lspconfig.pyright.setup { blabla}

View File

@@ -0,0 +1,21 @@
local null_ls = require "null-ls"
local b = null_ls.builtins
local sources = {
-- webdev stuff
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
b.formatting.prettier.with { filetypes = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes
-- Lua
b.formatting.stylua,
-- cpp
b.formatting.clang_format,
}
null_ls.setup {
debug = true,
sources = sources,
}

View File

@@ -0,0 +1,67 @@
local cmp = require "cmp"
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",
-- c/cpp stuff
"clangd",
"clang-format",
},
}
-- git support in nvimtree
M.nvimtree = {
git = {
enable = true,
},
renderer = {
highlight_git = true,
icons = {
show = {
git = true,
},
},
},
}
-- M.cmp = {
-- mapping = {
-- ["<A-Space>"] = cmp.mapping.complete(),
-- }
-- }
return M

View File

@@ -0,0 +1,13 @@
-- local on_attach = require("plugins.configs.lspconfig").on_attach
-- local capabilities = require("plugins.configs.lspconfig").capabilities
--
-- local options = {
-- server = {
-- on_attach = vim.tbl_deep_extend("force", on_attach, {
-- vim.keymap.set("n", "<leader>H", rt)
-- },
-- capabilities = capabilities,
-- },
-- }
--
-- return options