mirror of
https://github.com/tuxdotrs/tawm.git
synced 2025-07-06 13:06:35 +05:30
update nvchad to 2.5.0
This commit is contained in:
27
pkgs/nvchad/nvim/lua/configs/conform.lua
Normal file
27
pkgs/nvchad/nvim/lua/configs/conform.lua
Normal file
@ -0,0 +1,27 @@
|
||||
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" },
|
||||
},
|
||||
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 1000,
|
||||
},
|
||||
}
|
||||
|
||||
require("conform").setup(options)
|
10
pkgs/nvchad/nvim/lua/configs/gen.lua
Normal file
10
pkgs/nvchad/nvim/lua/configs/gen.lua
Normal file
@ -0,0 +1,10 @@
|
||||
local opts = {
|
||||
model = "deepseek-coder:6.7b",
|
||||
display_mode = "float",
|
||||
show_prompt = true,
|
||||
show_model = true,
|
||||
no_auto_close = false,
|
||||
debug = false,
|
||||
}
|
||||
|
||||
return opts
|
47
pkgs/nvchad/nvim/lua/configs/lazy.lua
Normal file
47
pkgs/nvchad/nvim/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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
36
pkgs/nvchad/nvim/lua/configs/lspconfig.lua
Normal file
36
pkgs/nvchad/nvim/lua/configs/lspconfig.lua
Normal file
@ -0,0 +1,36 @@
|
||||
local configs = require("nvchad.configs.lspconfig")
|
||||
local on_attach = configs.on_attach
|
||||
local capabilities = configs.capabilities
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
local servers = { "tsserver", "tailwindcss", "eslint" }
|
||||
|
||||
local function organize_imports()
|
||||
local params = {
|
||||
command = "_typescript.organizeImports",
|
||||
arguments = { vim.api.nvim_buf_get_name(0) },
|
||||
title = "",
|
||||
}
|
||||
vim.lsp.buf.execute_command(params)
|
||||
end
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
if lsp == "tsserver" then
|
||||
lspconfig[lsp].setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
commands = {
|
||||
OrganizeImports = {
|
||||
organize_imports,
|
||||
description = "Organize Imports",
|
||||
},
|
||||
},
|
||||
})
|
||||
else
|
||||
lspconfig[lsp].setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end
|
||||
end
|
16
pkgs/nvchad/nvim/lua/configs/noice.lua
Normal file
16
pkgs/nvchad/nvim/lua/configs/noice.lua
Normal file
@ -0,0 +1,16 @@
|
||||
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, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
}
|
||||
|
||||
return opts
|
33
pkgs/nvchad/nvim/lua/configs/null-ls.lua
Normal file
33
pkgs/nvchad/nvim/lua/configs/null-ls.lua
Normal file
@ -0,0 +1,33 @@
|
||||
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,
|
||||
},
|
||||
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
|
21
pkgs/nvchad/nvim/lua/configs/nvim-lint.lua
Normal file
21
pkgs/nvchad/nvim/lua/configs/nvim-lint.lua
Normal file
@ -0,0 +1,21 @@
|
||||
-- Doesn't work
|
||||
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
lua = { "luacheck" },
|
||||
javascript = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
javascriptreact = { "eslint_d" },
|
||||
typescriptreact = { { "eslint_d" } },
|
||||
nix = { "statix" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
49
pkgs/nvchad/nvim/lua/configs/overrides.lua
Normal file
49
pkgs/nvchad/nvim/lua/configs/overrides.lua
Normal file
@ -0,0 +1,49 @@
|
||||
local M = {}
|
||||
|
||||
M.treesitter = {
|
||||
ensure_installed = {
|
||||
-- defaults
|
||||
"vim",
|
||||
"lua",
|
||||
|
||||
-- web dev
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
|
||||
-- nix
|
||||
"nix",
|
||||
},
|
||||
}
|
||||
|
||||
M.mason = {
|
||||
ensure_installed = {
|
||||
-- defaults
|
||||
"lua-language-server",
|
||||
"stylua",
|
||||
"luacheck",
|
||||
|
||||
-- web dev
|
||||
"css-lsp",
|
||||
"html-lsp",
|
||||
"prettierd",
|
||||
"eslint-lsp",
|
||||
"eslint_d",
|
||||
"typescript-language-server",
|
||||
"tailwindcss-language-server",
|
||||
|
||||
-- nix
|
||||
"nil",
|
||||
},
|
||||
}
|
||||
|
||||
M.telescope = {
|
||||
defaults = {
|
||||
winblend = 40,
|
||||
pumblend = 40,
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
Reference in New Issue
Block a user