From ecb4a4b7305af6b6329a764799196eb0fae65ce4 Mon Sep 17 00:00:00 2001 From: Ayush Mukherjee Date: Sat, 26 Apr 2025 03:45:01 +0530 Subject: [PATCH] add volar, setup volar for vue and ts, add fix for TS sync rendering to avoid syntax highlight flicker with huge files --- nvim/lua/user/basics.lua | 5 +++++ nvim/lua/user/lsp/mason.lua | 2 ++ nvim/lua/user/lsp/settings/volar.lua | 8 ++++++++ 3 files changed, 15 insertions(+) create mode 100644 nvim/lua/user/lsp/settings/volar.lua diff --git a/nvim/lua/user/basics.lua b/nvim/lua/user/basics.lua index 63da0aa..db2d851 100644 --- a/nvim/lua/user/basics.lua +++ b/nvim/lua/user/basics.lua @@ -22,8 +22,13 @@ vim.opt.cmdheight = 2 vim.opt.hidden = true vim.opt.termguicolors = true vim.opt.completeopt = { "menu", "menuone", "noselect" } +vim.opt.signcolumn = "yes" vim.o.guifont = "Roboto Mono for Powerline:h14" +-- temp solution to force sync parsing for treesitter due to flickering +-- see gh issue: https://github.com/neovim/neovim/issues/32660 +vim.g._ts_force_sync_parsing = true + vim.cmd([[ syntax on syntax enable diff --git a/nvim/lua/user/lsp/mason.lua b/nvim/lua/user/lsp/mason.lua index 606be0e..6082ab7 100644 --- a/nvim/lua/user/lsp/mason.lua +++ b/nvim/lua/user/lsp/mason.lua @@ -6,6 +6,8 @@ local servers = { --"phpactor", "intelephense", "emmet_language_server", + "volar", + "eslint", } require("mason").setup() diff --git a/nvim/lua/user/lsp/settings/volar.lua b/nvim/lua/user/lsp/settings/volar.lua new file mode 100644 index 0000000..1212262 --- /dev/null +++ b/nvim/lua/user/lsp/settings/volar.lua @@ -0,0 +1,8 @@ +return { + filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue'}, + init_options = { + vue = { + hybridMode = false, + }, + }, +}