Initial Code
This commit is contained in:
7
lua/custom/chadrc.lua
Normal file
7
lua/custom/chadrc.lua
Normal file
@ -0,0 +1,7 @@
|
||||
---@type ChadrcConfig
|
||||
local M = {}
|
||||
|
||||
M.ui = { theme = 'catppuccin' }
|
||||
M.plugins = "custom.plugins"
|
||||
|
||||
return M
|
13
lua/custom/configs/lspconfig.lua
Normal file
13
lua/custom/configs/lspconfig.lua
Normal file
@ -0,0 +1,13 @@
|
||||
local base = require "plugins.configs.lspconfig"
|
||||
local on_attach = base.on_attach
|
||||
local capabilities = base.capabilities
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
|
||||
lspconfig.clangd.setup {
|
||||
on_attach = function(client, bufnr)
|
||||
client.server_capabilities.signatureHelpProvider = false
|
||||
on_attach(client, bufnr)
|
||||
end,
|
||||
capabilities = capabilities,
|
||||
}
|
25
lua/custom/configs/null-ls.lua
Normal file
25
lua/custom/configs/null-ls.lua
Normal file
@ -0,0 +1,25 @@
|
||||
local autogroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
local opts = {
|
||||
sources = {
|
||||
null_ls.builtins.formatting.clang_format,
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({
|
||||
group = autogroup,
|
||||
buffer = bufnr,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = autogroup,
|
||||
buffer = bufnr,
|
||||
callback = function ()
|
||||
vim.lsp.buf.format({bufnr = bufnr})
|
||||
end
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
return opts
|
31
lua/custom/plugins.lua
Normal file
31
lua/custom/plugins.lua
Normal file
@ -0,0 +1,31 @@
|
||||
local plugins = {
|
||||
{
|
||||
"xiyaowong/transparent.nvim",
|
||||
lazy = false
|
||||
},
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return require "custom.configs.null-ls"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require "plugins.configs.lspconfig"
|
||||
require "custom.configs.lspconfig"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"clangd",
|
||||
"clang-format",
|
||||
"lua-language-server"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return plugins
|
Reference in New Issue
Block a user