mirror of
https://github.com/tuxdotrs/tawm.git
synced 2025-07-06 21:16:35 +05:30
update nvim config
This commit is contained in:
@ -16,6 +16,12 @@ local options = {
|
|||||||
markdown = { prettier },
|
markdown = { prettier },
|
||||||
nix = { "alejandra" },
|
nix = { "alejandra" },
|
||||||
},
|
},
|
||||||
|
|
||||||
|
format_on_save = {
|
||||||
|
lsp_fallback = true,
|
||||||
|
async = false,
|
||||||
|
timeout_ms = 1000,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
require("conform").setup(options)
|
require("conform").setup(options)
|
||||||
|
@ -1,32 +1,36 @@
|
|||||||
local configs = require "plugins.configs.lspconfig"
|
local configs = require("plugins.configs.lspconfig")
|
||||||
local on_attach = configs.on_attach
|
local on_attach = configs.on_attach
|
||||||
local capabilities = configs.capabilities
|
local capabilities = configs.capabilities
|
||||||
|
|
||||||
local lspconfig = require "lspconfig"
|
local lspconfig = require("lspconfig")
|
||||||
-- local util = require "lspconfig/util"
|
|
||||||
|
|
||||||
local servers = { "tsserver", "tailwindcss", "eslint" }
|
local servers = { "tsserver", "tailwindcss", "eslint" }
|
||||||
|
|
||||||
for _, lsp in ipairs(servers) do
|
local function organize_imports()
|
||||||
lspconfig[lsp].setup {
|
local params = {
|
||||||
on_attach = on_attach,
|
command = "_typescript.organizeImports",
|
||||||
capabilities = capabilities,
|
arguments = { vim.api.nvim_buf_get_name(0) },
|
||||||
|
title = "",
|
||||||
}
|
}
|
||||||
|
vim.lsp.buf.execute_command(params)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- lspconfig.gopls.setup {
|
for _, lsp in ipairs(servers) do
|
||||||
-- on_attach = on_attach,
|
if lsp == "tsserver" then
|
||||||
-- capabilities = capabilities,
|
lspconfig[lsp].setup({
|
||||||
-- cmd = { "gopls" },
|
on_attach = on_attach,
|
||||||
-- filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
capabilities = capabilities,
|
||||||
-- root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
commands = {
|
||||||
-- settings = {
|
OrganizeImports = {
|
||||||
-- gopls = {
|
organize_imports,
|
||||||
-- completeUnimported = true,
|
description = "Organize Imports",
|
||||||
-- usePlaceholders = true,
|
},
|
||||||
-- analyses = {
|
},
|
||||||
-- unusedparams = true,
|
})
|
||||||
-- },
|
else
|
||||||
-- },
|
lspconfig[lsp].setup({
|
||||||
-- },
|
on_attach = on_attach,
|
||||||
-- }
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
21
pkgs/nvchad/custom/configs/nvim-lint.lua
Normal file
21
pkgs/nvchad/custom/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,
|
||||||
|
})
|
@ -23,12 +23,14 @@ M.mason = {
|
|||||||
-- defaults
|
-- defaults
|
||||||
"lua-language-server",
|
"lua-language-server",
|
||||||
"stylua",
|
"stylua",
|
||||||
|
"luacheck",
|
||||||
|
|
||||||
-- web dev
|
-- web dev
|
||||||
"css-lsp",
|
"css-lsp",
|
||||||
"html-lsp",
|
"html-lsp",
|
||||||
"prettierd",
|
"prettierd",
|
||||||
"eslint-lsp",
|
"eslint-lsp",
|
||||||
|
"eslint_d",
|
||||||
"typescript-language-server",
|
"typescript-language-server",
|
||||||
"tailwindcss-language-server",
|
"tailwindcss-language-server",
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
local overrides = require "custom.configs.overrides"
|
local overrides = require("custom.configs.overrides")
|
||||||
|
|
||||||
local plugins = {
|
local plugins = {
|
||||||
{
|
{
|
||||||
@ -13,6 +13,22 @@ local plugins = {
|
|||||||
"NvChad/nvterm",
|
"NvChad/nvterm",
|
||||||
opts = overrides.nvterm,
|
opts = overrides.nvterm,
|
||||||
},
|
},
|
||||||
|
-- Need to setup properly
|
||||||
|
-- {
|
||||||
|
-- "stevearc/conform.nvim",
|
||||||
|
-- event = "BufWritePre",
|
||||||
|
-- config = function()
|
||||||
|
-- require("custom.configs.conform")
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
-- {
|
||||||
|
-- "mfussenegger/nvim-lint",
|
||||||
|
-- lazy = true,
|
||||||
|
-- event = { "BufReadPre", "BufNewFile" },
|
||||||
|
-- config = function()
|
||||||
|
-- require("custom.configs.nvim-lint")
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
{
|
{
|
||||||
"Shatur/neovim-session-manager",
|
"Shatur/neovim-session-manager",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
@ -30,21 +46,21 @@ local plugins = {
|
|||||||
"rcarriga/nvim-notify",
|
"rcarriga/nvim-notify",
|
||||||
},
|
},
|
||||||
opts = function()
|
opts = function()
|
||||||
return require "custom.configs.noice"
|
return require("custom.configs.noice")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
config = function()
|
config = function()
|
||||||
require "plugins.configs.lspconfig"
|
require("plugins.configs.lspconfig")
|
||||||
require "custom.configs.lspconfig"
|
require("custom.configs.lspconfig")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = function()
|
opts = function()
|
||||||
return require "custom.configs.null-ls"
|
return require("custom.configs.null-ls")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user