nvim-configs/lua/plugins/tsdev.lua

74 lines
2.6 KiB
Lua
Raw Normal View History

2024-10-06 13:13:53 +08:00
return {
{
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
opts = {},
config = function()
require('typescript-tools').setup({})
end
},{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
},
config = function()
2024-10-06 16:05:50 +08:00
local cmp = require('cmp')
cmp.setup({
2024-10-06 13:13:53 +08:00
completion = {
keyword_length = 1,
max_item_count = 6
},
sources = {
{ name = "nvim_lsp", keyword_length = 1, max_item_count = 6 },
{ name = "buffer", keyword_length = 1, max_item_count = 6 },
{ name = "path", keyword_length = 1, max_item_count = 6 },
2024-10-06 16:05:50 +08:00
},
mapping = {
['<C-n>'] = cmp.mapping(cmp.mapping.select_next_item(), {'i', 'c'}),
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item(), {'i', 'c'}),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- accept currently selected item
2024-10-06 13:13:53 +08:00
}
})
end
},{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function ()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "tsx", "typescript", "javascript", "html" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end
2024-10-06 16:05:50 +08:00
},
{
'stevearc/conform.nvim',
opts = {},
config = function()
require("conform").setup({
formatters_by_ft = {
-- lua = { "stylua" },
-- Conform will run multiple formatters sequentially
-- python = { "isort", "black" },
-- You can customize some of the format options for the filetype (:help conform.format)
-- rust = { "rustfmt", lsp_format = "fallback" },
-- Conform will run the first available formatter
javascript = { "prettierd" },
typescript = { "prettierd" },
css = { "prettierd" },
less = { "prettierd" },
html = { "prettierd" },
},
})
end
2024-10-06 13:13:53 +08:00
}
2024-10-06 16:05:50 +08:00
2024-10-06 13:13:53 +08:00
}