mirror of
https://github.com/tuxdotrs/tawm.git
synced 2025-07-05 20:56:33 +05:30
add typescript-tools plugin
This commit is contained in:
@ -4,33 +4,11 @@ local capabilities = configs.capabilities
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
local servers = { "tsserver", "tailwindcss", "eslint", "gopls" }
|
||||
|
||||
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
|
||||
local servers = { "tailwindcss", "eslint", "gopls" }
|
||||
|
||||
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
|
||||
lspconfig[lsp].setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end
|
||||
|
@ -1,65 +1,64 @@
|
||||
local M = {}
|
||||
|
||||
M.treesitter = {
|
||||
ensure_installed = {
|
||||
-- defaults
|
||||
"vim",
|
||||
"lua",
|
||||
ensure_installed = {
|
||||
-- defaults
|
||||
"vim",
|
||||
"lua",
|
||||
|
||||
-- web dev
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
-- web dev
|
||||
"html",
|
||||
"css",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
|
||||
-- nix
|
||||
"nix",
|
||||
-- nix
|
||||
"nix",
|
||||
|
||||
-- go
|
||||
"go",
|
||||
"gomod",
|
||||
"gowork",
|
||||
"gosum",
|
||||
},
|
||||
-- go
|
||||
"go",
|
||||
"gomod",
|
||||
"gowork",
|
||||
"gosum",
|
||||
},
|
||||
}
|
||||
|
||||
M.mason = {
|
||||
ensure_installed = {
|
||||
-- defaults
|
||||
"lua-language-server",
|
||||
"stylua",
|
||||
"luacheck",
|
||||
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",
|
||||
-- web dev
|
||||
"css-lsp",
|
||||
"html-lsp",
|
||||
"prettierd",
|
||||
"eslint-lsp",
|
||||
"eslint_d",
|
||||
"tailwindcss-language-server",
|
||||
|
||||
-- nix
|
||||
"nil",
|
||||
-- nix
|
||||
"nil",
|
||||
|
||||
-- go
|
||||
"gopls",
|
||||
"goimports",
|
||||
"gofumpt",
|
||||
"gomodifytags",
|
||||
"impl",
|
||||
"iferr",
|
||||
"staticcheck",
|
||||
"delve",
|
||||
},
|
||||
-- go
|
||||
"gopls",
|
||||
"goimports",
|
||||
"gofumpt",
|
||||
"gomodifytags",
|
||||
"impl",
|
||||
"iferr",
|
||||
"staticcheck",
|
||||
"delve",
|
||||
},
|
||||
}
|
||||
|
||||
M.telescope = {
|
||||
defaults = {
|
||||
winblend = 40,
|
||||
pumblend = 40,
|
||||
},
|
||||
defaults = {
|
||||
winblend = 40,
|
||||
pumblend = 40,
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
|
5
pkgs/nvchad/nvim/lua/configs/ts.lua
Normal file
5
pkgs/nvchad/nvim/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,
|
||||
})
|
@ -95,5 +95,20 @@ local plugins = {
|
||||
"folke/neodev.nvim",
|
||||
event = "VeryLazy",
|
||||
},
|
||||
|
||||
-- Language specific plugins
|
||||
{
|
||||
"pmizio/typescript-tools.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||
config = function()
|
||||
require("configs.ts")
|
||||
end,
|
||||
ft = {
|
||||
"javascript",
|
||||
"typescript",
|
||||
"javascriptreact",
|
||||
"typescriptreact",
|
||||
},
|
||||
},
|
||||
}
|
||||
return plugins
|
||||
|
Reference in New Issue
Block a user