This commit is contained in:
2025-08-01 14:11:46 +02:00
parent 4d30d7f9fa
commit bbea041283
2 changed files with 25 additions and 30 deletions

View File

@@ -1,14 +1,6 @@
-- TODO: Read until 817
-- external requirements
-- - use nvm and install @vue/typescript-plugin globally
-- then ts_ls will use it for vue parsing. It is already in the arch install script.
--local nvm_bin = os.getenv('nvm_home'):gsub('\n[^\n]*$', '') -- remove line endings
--local node_version = vim.fn.system('nvm current'):gsub('\n[^\n]*$', '') -- remove line endings
--local vue_typescript_plugin_path = vim.fs.normalize(nvm_bin .. '\\' .. node_version .. '\\node_modules\\@vue\\typescript-plugin')
-- Paths for working with vue
local vue_typescript_plugin_path = vim.fs.normalize '~/node_modules/@vue/typescript-plugin'
local vue_language_server_path = vim.fn.stdpath 'data' .. '/mason/packages/vue-language-server/node_modules/@vue/language-server'
print(vue_language_server_path)
local vue_language_server_path = vim.fs.normalize(vim.fn.stdpath 'data' .. '/mason/packages/vue-language-server/node_modules/@vue/language-server')
-- "<leader>sh" to [s]earch the [h]elp documentation.
@@ -570,6 +562,11 @@ require('lazy').setup({
vtsls = {
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
settings = {
typescript = {
format = {
enable = false,
},
},
vtsls = {
tsserver = {
globalPlugins = {
@@ -586,6 +583,11 @@ require('lazy').setup({
},
eslint = {
flags = { debounce_text_changes = 500 },
settings = {
codeActionOnSave = {
enable = true,
},
},
-- on_attach = function(client, bufnr)
-- client.server_capabilities.documentFormattingProvider = true
-- if client.server_capabilities.documentFormattingProvider then
@@ -649,7 +651,6 @@ require('lazy').setup({
'xmlformatter',
'isort',
'black',
'debugpy',
'prettierd',
'json-lsp',
})
@@ -689,7 +690,7 @@ require('lazy').setup({
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
local disable_filetypes = { c = true, cpp = true, vue = true }
if disable_filetypes[vim.bo[bufnr].filetype] then
return nil
else
@@ -705,12 +706,6 @@ require('lazy').setup({
-- python = { "isort", "black" },
--
-- You can use 'stop_after_first' to run the first available formatter from the list
javascript = { 'eslint-lsp' },
typescript = { 'eslint-lsp' },
esmodule = { 'eslint-lsp' },
vue = { 'eslint-lsp' },
typescriptreact = { 'eslint-lsp' },
javascriptreact = { 'eslint-lsp' },
xml = { 'xmlformatter' },
python = { 'black', 'isort' },
json = { 'prettierd' },

View File

@@ -46,18 +46,18 @@ return {
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()
-- Only run the linter in buffers that you can modify in order to
-- avoid superfluous noise, notably within the handy LSP pop-ups that
-- describe the hovered symbol using Markdown.
if vim.opt_local.modifiable:get() then
lint.try_lint()
end
end,
})
-- local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
-- vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
-- group = lint_augroup,
-- callback = function()
-- -- Only run the linter in buffers that you can modify in order to
-- -- avoid superfluous noise, notably within the handy LSP pop-ups that
-- -- describe the hovered symbol using Markdown.
-- if vim.opt_local.modifiable:get() then
-- lint.try_lint()
-- end
-- end,
-- })
end,
},
}