feat(lsp): Set up vtsls, vue_ls, install miscellaneous plugins
This commit is contained in:
@@ -2,11 +2,23 @@ local conform = require("conform")
|
||||
|
||||
---@type conform.setupOpts
|
||||
local options = {
|
||||
formatters = {
|
||||
phpcbf = {
|
||||
command = "phpcbf",
|
||||
args = { "-" },
|
||||
stdin = true,
|
||||
exist_codes = { 0, 1 },
|
||||
},
|
||||
},
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
php = { "phpcbf" },
|
||||
javascript = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
vue = { "eslint_d" },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
timeout_ms = 5000,
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
}
|
||||
|
||||
19
lua/lsp.lua
19
lua/lsp.lua
@@ -5,16 +5,33 @@ require("mason-lspconfig").setup({
|
||||
"lua_ls",
|
||||
"stylua",
|
||||
"intelephense",
|
||||
"eslint",
|
||||
"vtsls",
|
||||
"vue_ls",
|
||||
},
|
||||
})
|
||||
|
||||
local telescope = require("telescope.builtin")
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
desc = "LSP Keymaps",
|
||||
desc = "LspAttach",
|
||||
callback = function(args)
|
||||
local bufnr = args.buf
|
||||
local options = { buffer = bufnr }
|
||||
|
||||
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = "\u{F057}",
|
||||
[vim.diagnostic.severity.WARN] = "\u{F071}",
|
||||
[vim.diagnostic.severity.HINT] = "\u{F0EB}",
|
||||
[vim.diagnostic.severity.INFO] = "\u{F05A}",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Navigation
|
||||
utils.nmap("<leader>gt", telescope.lsp_type_definitions, "Go to Type Definition", options)
|
||||
utils.nmap("<leader>gd", telescope.lsp_definitions, "Go to Definition", options)
|
||||
|
||||
@@ -21,6 +21,9 @@ vim.pack.add({
|
||||
-- Code formatting
|
||||
{ src = "https://github.com/stevearc/conform.nvim" },
|
||||
|
||||
-- Code linting (non-LSP sources)
|
||||
{ src = "https://github.com/nvimtools/none-ls.nvim" },
|
||||
|
||||
-- Appearance
|
||||
{ src = "https://github.com/rose-pine/neovim", name = "rose-pine" },
|
||||
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
|
||||
@@ -32,6 +35,10 @@ vim.pack.add({
|
||||
-- Miscellaneous
|
||||
{ src = "https://github.com/windwp/nvim-autopairs" },
|
||||
{ src = "https://github.com/folke/which-key.nvim" },
|
||||
{ src = "https://github.com/nvim-lualine/lualine.nvim" },
|
||||
{ src = "https://github.com/nvim-tree/nvim-tree.lua" },
|
||||
{ src = "https://github.com/tpope/vim-fugitive" },
|
||||
{ src = "https://github.com/lewis6991/gitsigns.nvim" },
|
||||
|
||||
-- WoW Addon API
|
||||
{ src = "https://github.com/Tyrannican/warcraft-api.nvim" },
|
||||
|
||||
Reference in New Issue
Block a user