This commit is contained in:
2025-06-30 22:57:51 +03:00
commit 94097c5a1c
13 changed files with 410 additions and 0 deletions

15
lua/configs/conform.lua Normal file
View File

@@ -0,0 +1,15 @@
local options = {
formatters_by_ft = {
lua = { "stylua" },
-- css = { "prettier" },
-- html = { "prettier" },
},
-- format_on_save = {
-- -- These options will be passed to conform.format()
-- timeout_ms = 500,
-- lsp_fallback = true,
-- },
}
return options

52
lua/configs/dap.lua Normal file
View File

@@ -0,0 +1,52 @@
local dap = require("dap")
local dapui = require("dapui")
-- Setup dap-ui
dapui.setup()
-- Auto-open UI on DAP start
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end
-- Paths for Mason v2 codelldb adapter
local mason_path = vim.fn.stdpath("data") .. "/mason/packages/codelldb/extension"
local adapter_path = mason_path .. "/adapter/codelldb"
local liblldb_path = mason_path .. "/lldb/lib/liblldb.so"
-- Register the DAP adapter
dap.adapters.codelldb = {
type = "server",
host = "127.0.0.1",
port = "${port}",
executable = {
command = adapter_path,
args = { "--port", "${port}" },
},
}
-- Debug configuration for Rust
dap.configurations.rust = {
{
name = "Launch Rust",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input(
"Path to executable: ",
vim.fn.getcwd() .. "/target/debug/",
"file"
)
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
args = {},
runInTerminal = false,
},
}

47
lua/configs/lazy.lua Normal file
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",
},
},
},
}

31
lua/configs/lspconfig.lua Normal file
View File

@@ -0,0 +1,31 @@
-- load defaults i.e lua_lsp
require("nvchad.configs.lspconfig").defaults()
local lspconfig = require "lspconfig"
-- EXAMPLE
local servers = {
"html",
"cssls",
"clangd",
"pyright",
"zls",
"gopls",
}
local nvlsp = require "nvchad.configs.lspconfig"
-- lsps with default config
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = nvlsp.on_attach,
on_init = nvlsp.on_init,
capabilities = nvlsp.capabilities,
}
end
-- configuring single server, example: typescript
-- lspconfig.ts_ls.setup {
-- on_attach = nvlsp.on_attach,
-- on_init = nvlsp.on_init,
-- capabilities = nvlsp.capabilities,
-- }