feat(lsp): Set up vtsls, vue_ls, install miscellaneous plugins
This commit is contained in:
@@ -3,10 +3,16 @@ local settings = {
|
||||
---@type lspconfig.settings.lua_ls
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
hint = {
|
||||
enable = true,
|
||||
},
|
||||
runtime = {
|
||||
version = "LuaJIT",
|
||||
},
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = vim.list_extend({ vim.fn.expand("$VIMRUNTIME") }, vim.api.nvim_get_runtime_file("lua", true)),
|
||||
},
|
||||
workspace = { checkThirdParty = false, library = vim.list_extend({ vim.fn.expand('$VIMRUNTIME') }, vim.api.nvim_get_runtime_file('lua', true)) },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
4
init.lua
4
init.lua
@@ -1,3 +1,7 @@
|
||||
-- Disable netrw
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.localmapleader = " "
|
||||
|
||||
|
||||
@@ -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" },
|
||||
|
||||
@@ -12,6 +12,14 @@
|
||||
"rev": "619363c30309d29ffa631e67c8183f2a72caa373",
|
||||
"src": "https://github.com/stevearc/conform.nvim"
|
||||
},
|
||||
"gitsigns.nvim": {
|
||||
"rev": "dd3f588bacbeb041be6facf1742e42097f62165d",
|
||||
"src": "https://github.com/lewis6991/gitsigns.nvim"
|
||||
},
|
||||
"lualine.nvim": {
|
||||
"rev": "221ce6b2d999187044529f49da6554a92f740a96",
|
||||
"src": "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
"mason-lspconfig.nvim": {
|
||||
"rev": "0a695750d747db1e7e70bcf0267ef8951c95fc83",
|
||||
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
|
||||
@@ -20,6 +28,10 @@
|
||||
"rev": "16ba83bfc8a25f52bb545134f5bee082b195c460",
|
||||
"src": "https://github.com/mason-org/mason.nvim"
|
||||
},
|
||||
"none-ls.nvim": {
|
||||
"rev": "f9d557ac7cd28a3a993b5ea49716498bd540b01f",
|
||||
"src": "https://github.com/nvimtools/none-ls.nvim"
|
||||
},
|
||||
"nvim-autopairs": {
|
||||
"rev": "7b9923abad60b903ece7c52940e1321d39eccc79",
|
||||
"src": "https://github.com/windwp/nvim-autopairs"
|
||||
@@ -28,6 +40,10 @@
|
||||
"rev": "9573948c38bfabeec353ae7dd7d3ffec4c506a6b",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-tree.lua": {
|
||||
"rev": "07f541fcaa4a5ae019598240362449ab7e9812b3",
|
||||
"src": "https://github.com/nvim-tree/nvim-tree.lua"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"rev": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c",
|
||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
@@ -52,6 +68,10 @@
|
||||
"rev": "bb66b815aff01e87b2e26be995116be8d2f91474",
|
||||
"src": "https://github.com/romus204/tree-sitter-manager.nvim"
|
||||
},
|
||||
"vim-fugitive": {
|
||||
"rev": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0",
|
||||
"src": "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
"warcraft-api.nvim": {
|
||||
"rev": "c016bc54ed62bca5058cc3bd7553e429dd8caf37",
|
||||
"src": "https://github.com/Tyrannican/warcraft-api.nvim"
|
||||
|
||||
Reference in New Issue
Block a user