mirror of
https://github.com/tuxdotrs/tnvim.git
synced 2025-07-07 05:46:34 +05:30
feat: isolate nvim config
This commit is contained in:
22
src/lua/configs/avante.lua
Normal file
22
src/lua/configs/avante.lua
Normal file
@ -0,0 +1,22 @@
|
||||
local opts = {
|
||||
provider = "hyperbolic",
|
||||
vendors = {
|
||||
deepseek = {
|
||||
__inherited_from = "openai",
|
||||
api_key_name = "DEEPSEEK_API_KEY",
|
||||
endpoint = "https://api.deepseek.com/v1",
|
||||
model = "deepseek-chat",
|
||||
},
|
||||
|
||||
hyperbolic = {
|
||||
__inherited_from = "openai",
|
||||
api_key_name = "cmd:cat /run/secrets/hyperbolic_api_key",
|
||||
endpoint = "https://api.hyperbolic.xyz/v1",
|
||||
model = "deepseek-ai/DeepSeek-R1",
|
||||
temperature = 0,
|
||||
max_tokens = 4096,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return opts
|
29
src/lua/configs/conform.lua
Normal file
29
src/lua/configs/conform.lua
Normal file
@ -0,0 +1,29 @@
|
||||
local prettier = { "prettierd", "prettier" }
|
||||
|
||||
local options = {
|
||||
lsp_fallback = true,
|
||||
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
javascript = prettier,
|
||||
typescript = prettier,
|
||||
javascriptreact = prettier,
|
||||
typescriptreact = prettier,
|
||||
json = prettier,
|
||||
jsonc = prettier,
|
||||
css = prettier,
|
||||
html = prettier,
|
||||
markdown = prettier,
|
||||
nix = { "alejandra" },
|
||||
go = { "goimports", "gofumpt" },
|
||||
rust = { "rust_analyzer" },
|
||||
},
|
||||
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
}
|
||||
|
||||
require("conform").setup(options)
|
17
src/lua/configs/dap.lua
Normal file
17
src/lua/configs/dap.lua
Normal file
@ -0,0 +1,17 @@
|
||||
require("dapui").setup()
|
||||
require("nvim-dap-virtual-text").setup()
|
||||
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.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
|
5
src/lua/configs/go.lua
Normal file
5
src/lua/configs/go.lua
Normal file
@ -0,0 +1,5 @@
|
||||
require("go").setup({
|
||||
trouble = true,
|
||||
icons = { breakpoint = "", currentpos = "" },
|
||||
gocoverage_sign = "│",
|
||||
})
|
47
src/lua/configs/lazy.lua
Normal file
47
src/lua/configs/lazy.lua
Normal 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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
47
src/lua/configs/lspconfig.lua
Normal file
47
src/lua/configs/lspconfig.lua
Normal file
@ -0,0 +1,47 @@
|
||||
local configs = require("nvchad.configs.lspconfig")
|
||||
local on_attach = configs.on_attach
|
||||
local capabilities = configs.capabilities
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
local servers = { "eslint", "gopls", "templ" }
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end
|
||||
|
||||
lspconfig.nil_ls.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "nix" },
|
||||
cmd = { "nil" },
|
||||
settings = {
|
||||
["nil"] = {
|
||||
flake = {
|
||||
autoArchive = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
lspconfig.html.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "html", "templ" },
|
||||
})
|
||||
|
||||
lspconfig.htmx.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "html", "templ" },
|
||||
})
|
||||
|
||||
lspconfig.tailwindcss.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "templ", "astro", "javascript", "typescript", "react", "typescriptreact" },
|
||||
init_options = { userLanguages = { templ = "html" } },
|
||||
})
|
27
src/lua/configs/noice.lua
Normal file
27
src/lua/configs/noice.lua
Normal file
@ -0,0 +1,27 @@
|
||||
local opts = {
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
},
|
||||
presets = {
|
||||
long_message_to_split = true,
|
||||
inc_rename = false,
|
||||
lsp_doc_border = false,
|
||||
},
|
||||
views = {
|
||||
mini = {
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require("notify").setup({
|
||||
background_colour = "#000",
|
||||
})
|
||||
|
||||
return opts
|
40
src/lua/configs/null-ls.lua
Normal file
40
src/lua/configs/null-ls.lua
Normal file
@ -0,0 +1,40 @@
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
local b = null_ls.builtins
|
||||
|
||||
local opts = {
|
||||
sources = {
|
||||
b.formatting.prettierd,
|
||||
b.formatting.stylua,
|
||||
|
||||
-- nix
|
||||
b.code_actions.statix,
|
||||
b.formatting.alejandra,
|
||||
b.diagnostics.deadnix,
|
||||
|
||||
-- go
|
||||
b.code_actions.gomodifytags,
|
||||
b.code_actions.impl,
|
||||
b.formatting.gofumpt,
|
||||
b.formatting.goimports,
|
||||
b.diagnostics.staticcheck,
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ bufnr = bufnr })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
return opts
|
71
src/lua/configs/overrides.lua
Normal file
71
src/lua/configs/overrides.lua
Normal file
@ -0,0 +1,71 @@
|
||||
local M = {}
|
||||
|
||||
M.treesitter = {
|
||||
ensure_installed = {
|
||||
-- defaults
|
||||
"vim",
|
||||
"lua",
|
||||
"regex",
|
||||
"bash",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
|
||||
-- web dev
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
|
||||
-- nix
|
||||
"nix",
|
||||
|
||||
-- go
|
||||
"go",
|
||||
"gomod",
|
||||
"gowork",
|
||||
"gosum",
|
||||
"templ",
|
||||
|
||||
-- rust
|
||||
"rust",
|
||||
},
|
||||
}
|
||||
|
||||
M.mason = {
|
||||
ensure_installed = {
|
||||
-- defaults
|
||||
"lua-language-server",
|
||||
"stylua",
|
||||
"luacheck",
|
||||
|
||||
-- web dev
|
||||
"css-lsp",
|
||||
"html-lsp",
|
||||
"htmx-lsp",
|
||||
"prettier",
|
||||
"prettierd",
|
||||
"eslint-lsp",
|
||||
"eslint_d",
|
||||
"tailwindcss-language-server",
|
||||
|
||||
-- nix
|
||||
"nil",
|
||||
|
||||
-- go
|
||||
"gopls",
|
||||
"templ",
|
||||
|
||||
-- rust
|
||||
"codelldb",
|
||||
},
|
||||
}
|
||||
|
||||
M.telescope = {
|
||||
defaults = {
|
||||
winblend = 40,
|
||||
pumblend = 40,
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
17
src/lua/configs/rust.lua
Normal file
17
src/lua/configs/rust.lua
Normal file
@ -0,0 +1,17 @@
|
||||
local configs = require("nvchad.configs.lspconfig")
|
||||
local on_attach = configs.on_attach
|
||||
local capabilities = configs.capabilities
|
||||
|
||||
vim.g.rustaceanvim = {
|
||||
server = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
default_settings = {
|
||||
["rust-analyzer"] = {
|
||||
cargo = {
|
||||
allFeatures = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
20
src/lua/configs/smart-yank.lua
Normal file
20
src/lua/configs/smart-yank.lua
Normal file
@ -0,0 +1,20 @@
|
||||
require("smartyank").setup({
|
||||
highlight = {
|
||||
enabled = true,
|
||||
higroup = "IncSearch",
|
||||
timeout = 2000,
|
||||
},
|
||||
clipboard = {
|
||||
enabled = true,
|
||||
},
|
||||
tmux = {
|
||||
enabled = true,
|
||||
cmd = { "tmux", "set-buffer", "-w" },
|
||||
},
|
||||
osc52 = {
|
||||
enabled = true,
|
||||
ssh_only = false,
|
||||
silent = false,
|
||||
echo_hl = "Directory",
|
||||
},
|
||||
})
|
5
src/lua/configs/ts.lua
Normal file
5
src/lua/configs/ts.lua
Normal file
@ -0,0 +1,5 @@
|
||||
local on_attach = require("nvchad.configs.lspconfig").on_attach
|
||||
|
||||
require("typescript-tools").setup({
|
||||
on_attach = on_attach,
|
||||
})
|
Reference in New Issue
Block a user