init
This commit is contained in:
14
nvim/lua/plugins/extras/lang/web/angular-extended.lua
Normal file
14
nvim/lua/plugins/extras/lang/web/angular-extended.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
{ import = "plugins.extras.lang.web.typescript-extended" },
|
||||
{ import = "plugins.extras.lang.web.html-css" },
|
||||
{ import = "lazyvim.plugins.extras.lang.angular" },
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"angular",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
51
nvim/lua/plugins/extras/lang/web/astro-extended.lua
Normal file
51
nvim/lua/plugins/extras/lang/web/astro-extended.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
local inlay_hints_settings = {
|
||||
parameterNames = { enabled = "all" },
|
||||
parameterTypes = { enabled = true },
|
||||
variableTypes = { enabled = true },
|
||||
propertyDeclarationTypes = { enabled = true },
|
||||
functionLikeReturnTypes = { enabled = true },
|
||||
enumMemberValues = { enabled = true },
|
||||
}
|
||||
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.astro" },
|
||||
{ import = "plugins.extras.lang.web.typescript-extended" },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
astro = {
|
||||
settings = {
|
||||
typescript = {
|
||||
updateImportsOnFileMove = { enabled = "always" },
|
||||
inlayHints = inlay_hints_settings,
|
||||
},
|
||||
javascript = {
|
||||
updateImportsOnFileMove = { enabled = "always" },
|
||||
inlayHints = inlay_hints_settings,
|
||||
},
|
||||
},
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
|
||||
require("ts-error-translator").translate_diagnostics(err, result, ctx, config)
|
||||
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx, config)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"dmmulroy/ts-error-translator.nvim",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"astro",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
22
nvim/lua/plugins/extras/lang/web/graphql.lua
Normal file
22
nvim/lua/plugins/extras/lang/web/graphql.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
{ import = "plugins.extras.lang.web.typescript-extended" },
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"graphql-language-service-cli",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {},
|
||||
opts = {
|
||||
servers = {
|
||||
graphql = {
|
||||
filetypes = { "graphql", "javascript", "javascriptreact", "typescript", "typescriptreact" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
99
nvim/lua/plugins/extras/lang/web/html-css.lua
Normal file
99
nvim/lua/plugins/extras/lang/web/html-css.lua
Normal file
@@ -0,0 +1,99 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"html",
|
||||
"css",
|
||||
"scss",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
emmet_language_server = {},
|
||||
html = {},
|
||||
cssmodules_ls = {},
|
||||
css_variables = {},
|
||||
cssls = {
|
||||
lint = {
|
||||
compatibleVendorPrefixes = "ignore",
|
||||
vendorPrefix = "ignore",
|
||||
unknownVendorSpecificProperties = "ignore",
|
||||
|
||||
-- unknownProperties = "ignore", -- duplicate with stylelint
|
||||
|
||||
duplicateProperties = "warning",
|
||||
emptyRules = "warning",
|
||||
importStatement = "warning",
|
||||
zeroUnits = "warning",
|
||||
fontFaceProperties = "warning",
|
||||
hexColorLength = "warning",
|
||||
argumentsInColorFunction = "warning",
|
||||
unknownAtRules = "warning",
|
||||
ieHack = "warning",
|
||||
propertyIgnoredDueToDisplay = "warning",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"emmet-language-server",
|
||||
"html-lsp",
|
||||
"cssmodules-language-server",
|
||||
"css-variables-language-server",
|
||||
"css-lsp",
|
||||
"htmlhint",
|
||||
"stylelint",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = function(_, opts)
|
||||
local stylelint = "stylelint"
|
||||
|
||||
local function add_linters(tbl)
|
||||
for ft, linters in pairs(tbl) do
|
||||
if opts.linters_by_ft[ft] == nil then
|
||||
opts.linters_by_ft[ft] = linters
|
||||
else
|
||||
vim.list_extend(opts.linters_by_ft[ft], linters)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
add_linters({
|
||||
["html"] = { "htmlhint" },
|
||||
["css"] = { stylelint },
|
||||
["scss"] = { stylelint },
|
||||
["less"] = { stylelint },
|
||||
["sugarss"] = { stylelint },
|
||||
["vue"] = { stylelint },
|
||||
["wxss"] = { stylelint },
|
||||
["javascript"] = { stylelint },
|
||||
["javascriptreact"] = { stylelint },
|
||||
["typescript"] = { stylelint },
|
||||
["typescriptreact"] = { stylelint },
|
||||
})
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"html",
|
||||
"css",
|
||||
"sass",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
18
nvim/lua/plugins/extras/lang/web/htmx.lua
Normal file
18
nvim/lua/plugins/extras/lang/web/htmx.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
htmx = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"htmx-lsp",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
32
nvim/lua/plugins/extras/lang/web/php-extended.lua
Normal file
32
nvim/lua/plugins/extras/lang/web/php-extended.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.php" },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"phpdoc",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"olimorris/neotest-phpunit",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-phpunit"] = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"php",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
51
nvim/lua/plugins/extras/lang/web/svelte-extended.lua
Normal file
51
nvim/lua/plugins/extras/lang/web/svelte-extended.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
local inlay_hints_settings = {
|
||||
parameterNames = { enabled = "all" },
|
||||
parameterTypes = { enabled = true },
|
||||
variableTypes = { enabled = true },
|
||||
propertyDeclarationTypes = { enabled = true },
|
||||
functionLikeReturnTypes = { enabled = true },
|
||||
enumMemberValues = { enabled = true },
|
||||
}
|
||||
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.svelte" },
|
||||
{ import = "plugins.extras.lang.web.typescript-extended" },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
svelte = {
|
||||
settings = {
|
||||
typescript = {
|
||||
updateImportsOnFileMove = { enabled = "always" },
|
||||
inlayHints = inlay_hints_settings,
|
||||
},
|
||||
javascript = {
|
||||
updateImportsOnFileMove = { enabled = "always" },
|
||||
inlayHints = inlay_hints_settings,
|
||||
},
|
||||
},
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
|
||||
require("ts-error-translator").translate_diagnostics(err, result, ctx, config)
|
||||
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx, config)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"dmmulroy/ts-error-translator.nvim",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"svelte",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
20
nvim/lua/plugins/extras/lang/web/tailwind-extended.lua
Normal file
20
nvim/lua/plugins/extras/lang/web/tailwind-extended.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "plugins.extras.ui.inline-fold" },
|
||||
{
|
||||
"MaximilianLloyd/tw-values.nvim",
|
||||
keys = {
|
||||
{ "<leader>cT", "<cmd>TWValues<cr>", desc = "Tailwind CSS values" },
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"tailwindcss",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
104
nvim/lua/plugins/extras/lang/web/typescript-extended.lua
Normal file
104
nvim/lua/plugins/extras/lang/web/typescript-extended.lua
Normal file
@@ -0,0 +1,104 @@
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
{ import = "plugins.extras.lang.json-extended" },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
vtsls = {
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
|
||||
require("ts-error-translator").translate_diagnostics(err, result, ctx, config)
|
||||
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx, config)
|
||||
end,
|
||||
},
|
||||
init_options = {
|
||||
preferences = {
|
||||
disableSuggestions = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"javascript",
|
||||
"jsdoc",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"dmmulroy/tsc.nvim",
|
||||
opts = {
|
||||
auto_start_watch_mode = false,
|
||||
use_trouble_qflist = true,
|
||||
flags = {
|
||||
watch = false,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>ct", ft = { "typescript", "typescriptreact" }, "<cmd>TSC<cr>", desc = "Type Check" },
|
||||
{ "<leader>xy", ft = { "typescript", "typescriptreact" }, "<cmd>TSCOpen<cr>", desc = "Type Check Quickfix" },
|
||||
},
|
||||
ft = {
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
},
|
||||
cmd = {
|
||||
"TSC",
|
||||
"TSCOpen",
|
||||
"TSCClose",
|
||||
"TSStop",
|
||||
},
|
||||
},
|
||||
{
|
||||
"dmmulroy/ts-error-translator.nvim",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"nvim-neotest/neotest-jest",
|
||||
"adrigzr/neotest-mocha",
|
||||
"marilari88/neotest-vitest",
|
||||
},
|
||||
opts = {
|
||||
adapters = {
|
||||
["neotest-jest"] = {
|
||||
jestCommand = "npm test --",
|
||||
jestConfigFile = "custom.jest.config.ts",
|
||||
env = { CI = true },
|
||||
cwd = function()
|
||||
return vim.fn.getcwd()
|
||||
end,
|
||||
},
|
||||
["neotest-mocha"] = {
|
||||
command = "npm test --",
|
||||
env = { CI = true },
|
||||
cwd = function()
|
||||
return vim.fn.getcwd()
|
||||
end,
|
||||
},
|
||||
["neotest-vitest"] = {},
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>tw", function() require('neotest').run.run({ jestCommand = 'jest --watch ' }) end, desc = "Run Watch" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"react",
|
||||
"typescript",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
38
nvim/lua/plugins/extras/lang/web/vue-2.lua
Normal file
38
nvim/lua/plugins/extras/lang/web/vue-2.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vue",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
vuels = {},
|
||||
volar = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vetur-vls",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vue-2",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
51
nvim/lua/plugins/extras/lang/web/vue-3-extended.lua
Normal file
51
nvim/lua/plugins/extras/lang/web/vue-3-extended.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
local inlay_hints_settings = {
|
||||
parameterNames = { enabled = "all" },
|
||||
parameterTypes = { enabled = true },
|
||||
variableTypes = { enabled = true },
|
||||
propertyDeclarationTypes = { enabled = true },
|
||||
functionLikeReturnTypes = { enabled = true },
|
||||
enumMemberValues = { enabled = true },
|
||||
}
|
||||
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.vue" },
|
||||
{ import = "plugins.extras.lang.web.typescript-extended" },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
volar = {
|
||||
settings = {
|
||||
typescript = {
|
||||
updateImportsOnFileMove = { enabled = "always" },
|
||||
inlayHints = inlay_hints_settings,
|
||||
},
|
||||
javascript = {
|
||||
updateImportsOnFileMove = { enabled = "always" },
|
||||
inlayHints = inlay_hints_settings,
|
||||
},
|
||||
},
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
|
||||
require("ts-error-translator").translate_diagnostics(err, result, ctx, config)
|
||||
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx, config)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"dmmulroy/ts-error-translator.nvim",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vue-3",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user