74 lines
2.6 KiB
Lua
74 lines
2.6 KiB
Lua
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()
|
|
local cmp = require('cmp')
|
|
cmp.setup({
|
|
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 },
|
|
},
|
|
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
|
|
}
|
|
})
|
|
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
|
|
},
|
|
{
|
|
'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
|
|
}
|
|
|
|
}
|
|
|