mirror of
https://github.com/tuxdotrs/nixos-config.git
synced 2025-07-09 03:06:34 +05:30
repalce astrovim with nvchad
This commit is contained in:
21
pkgs/nvchad/custom/configs/conform.lua
Normal file
21
pkgs/nvchad/custom/configs/conform.lua
Normal file
@ -0,0 +1,21 @@
|
||||
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" },
|
||||
},
|
||||
}
|
||||
|
||||
require("conform").setup(options)
|
32
pkgs/nvchad/custom/configs/lspconfig.lua
Normal file
32
pkgs/nvchad/custom/configs/lspconfig.lua
Normal file
@ -0,0 +1,32 @@
|
||||
local configs = require "plugins.configs.lspconfig"
|
||||
local on_attach = configs.on_attach
|
||||
local capabilities = configs.capabilities
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
-- local util = require "lspconfig/util"
|
||||
|
||||
local servers = { "tsserver", "tailwindcss", "eslint" }
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
-- lspconfig.gopls.setup {
|
||||
-- on_attach = on_attach,
|
||||
-- capabilities = capabilities,
|
||||
-- cmd = { "gopls" },
|
||||
-- filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
||||
-- root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
||||
-- settings = {
|
||||
-- gopls = {
|
||||
-- completeUnimported = true,
|
||||
-- usePlaceholders = true,
|
||||
-- analyses = {
|
||||
-- unusedparams = true,
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- }
|
16
pkgs/nvchad/custom/configs/noice.lua
Normal file
16
pkgs/nvchad/custom/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/custom/configs/null-ls.lua
Normal file
33
pkgs/nvchad/custom/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
|
57
pkgs/nvchad/custom/configs/overrides.lua
Normal file
57
pkgs/nvchad/custom/configs/overrides.lua
Normal file
@ -0,0 +1,57 @@
|
||||
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",
|
||||
|
||||
-- web dev
|
||||
"css-lsp",
|
||||
"html-lsp",
|
||||
"prettierd",
|
||||
"eslint-lsp",
|
||||
"typescript-language-server",
|
||||
"tailwindcss-language-server",
|
||||
|
||||
-- nix
|
||||
"nil",
|
||||
},
|
||||
}
|
||||
|
||||
M.nvterm = {
|
||||
terminals = {
|
||||
shell = vim.o.shell,
|
||||
list = {},
|
||||
type_opts = {
|
||||
float = {
|
||||
relative = "editor",
|
||||
row = 0.23,
|
||||
col = 0.15,
|
||||
width = 0.7,
|
||||
height = 0.5,
|
||||
border = "single",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
Reference in New Issue
Block a user