feat: web development lsps and update
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@ spell/
|
||||
.luarc.json
|
||||
|
||||
.direnv
|
||||
Session.vim
|
||||
|
||||
@@ -61,6 +61,7 @@ vim.o.mousemoveevent = true
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||
|
||||
local HTML_LIKE = { "astro", "html", "svelte", "templ", "vue" }
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function(server_name)
|
||||
@@ -69,6 +70,13 @@ require("mason-lspconfig").setup_handlers({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
["emmet_ls"] = function()
|
||||
require("lspconfig").emmet_ls.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { table.unpack(HTML_LIKE) },
|
||||
})
|
||||
end,
|
||||
["lua_ls"] = function()
|
||||
require("neodev").setup()
|
||||
require("lspconfig").lua_ls.setup({
|
||||
@@ -84,7 +92,36 @@ require("mason-lspconfig").setup_handlers({
|
||||
require("lspconfig").html.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "html", "svg", "xml" },
|
||||
filetypes = { table.unpack(HTML_LIKE), "svg", "xml" },
|
||||
})
|
||||
end,
|
||||
["htmx"] = function()
|
||||
require("lspconfig").htmx.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { table.unpack(HTML_LIKE) },
|
||||
})
|
||||
end,
|
||||
["unocss"] = function()
|
||||
require("lspconfig").unocss.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { table.unpack(HTML_LIKE) },
|
||||
})
|
||||
end,
|
||||
["templ"] = function()
|
||||
vim.filetype.add({ extension = { templ = "templ" } })
|
||||
require("lspconfig").templ.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "templ" },
|
||||
})
|
||||
end,
|
||||
["gopls"] = function()
|
||||
require("lspconfig").gopls.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "templ", "go", "gomod", "gowork", "gotmpl" },
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
require('nvim-treesitter.install').prefer_git = true;
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = { 'lua', 'vim', 'vimdoc', 'bash', 'javascript' },
|
||||
require("nvim-treesitter.install").prefer_git = true
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = { "lua", "vim", "vimdoc", "bash", "javascript" },
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
|
||||
@@ -39,7 +39,9 @@
|
||||
"tmux.nvim": { "branch": "main", "commit": "53ea7eab504730e7e8397fd2ae0133053d56afc8" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "ce882460cf3db12e99f8bf579cbf99e331f6dd4f" },
|
||||
"vim-obsession": { "branch": "master", "commit": "fe9d3e1a9a50171e7d316a52e1e56d868e4c1fe5" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
|
||||
"vimtex": { "branch": "master", "commit": "f9b19d09ee6f0ba70dad0b5c2e710dd700681000" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
|
||||
}
|
||||
@@ -5,13 +5,13 @@ vim.g.maplocalleader = " "
|
||||
-- vim.g.loaded_netrwPlugin = 1;
|
||||
|
||||
vim.wo.number = true
|
||||
vim.o.mouse = true
|
||||
vim.o.mouse = 'a'
|
||||
|
||||
-- True colors
|
||||
vim.o.termguicolors = true
|
||||
|
||||
-- Enable filetype plugins
|
||||
vim.o.filetype = true
|
||||
vim.o.filetype = 'on'
|
||||
|
||||
-- Enable spell checking by default
|
||||
vim.o.spell = true
|
||||
@@ -22,7 +22,7 @@ vim.o.relativenumber = true
|
||||
vim.o.signcolumn = "number"
|
||||
|
||||
-- Set indentation
|
||||
vim.o.noexpandtab = true
|
||||
vim.o.expandtab = false
|
||||
vim.o.tabstop = 4
|
||||
vim.o.softtabstop = 4
|
||||
vim.o.shiftwidth = 4
|
||||
|
||||
@@ -231,6 +231,10 @@ return {
|
||||
{ "mhartington/formatter.nvim" },
|
||||
{ "tpope/vim-fugitive" },
|
||||
{ "tpope/vim-rhubarb" },
|
||||
{
|
||||
"tpope/vim-obsession",
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
"kdheepak/lazygit.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
@@ -245,6 +249,6 @@ return {
|
||||
"laytan/cloak.nvim",
|
||||
},
|
||||
{
|
||||
"lervag/vimtex"
|
||||
"lervag/vimtex",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user