@@ -5,7 +5,8 @@ vim.opt.rtp:append('../nvim-lspconfig/')
55vim .opt .rtp :append (' ../guihua.lua/' )
66
77-- Add the treesitter parser install directory to runtimepath BEFORE loading plugins
8- vim .opt .rtp :append (vim .fn .stdpath (' data' ) .. ' /site' )
8+ local parser_install_dir = vim .fn .stdpath (' data' ) .. ' /site'
9+ vim .opt .rtp :prepend (parser_install_dir )
910
1011vim .cmd ([[
1112 runtime! plugin/plenary.vim
@@ -38,27 +39,14 @@ require('go').setup({
3839
3940require (' nvim-treesitter' ).setup ({
4041 -- Directory to install parsers and queries to
41- install_dir = vim . fn . stdpath ( ' data ' ) .. ' /site ' ,
42+ install_dir = parser_install_dir ,
4243})
4344
4445vim .o .swapfile = false
4546vim .bo .swapfile = false
4647
47- -- Don't create a FileType autocmd that calls vim.treesitter.start()
48- -- Treesitter will start automatically when needed
49- -- Just verify the parser is available when needed
50- vim .api .nvim_create_autocmd (' FileType' , {
51- pattern = { ' go' },
52- callback = function ()
53- -- Only verify, don't start
54- local has_parser = pcall (vim .treesitter .language .add , ' go' )
55- if not has_parser then
56- print (' Warning: Go parser not available' )
57- else
58- print (' Go parser is available' )
59- end
60- end ,
61- })
48+ -- Disable automatic treesitter start for now
49+ vim .g .ts_highlight_disable = true
6250
6351vim .cmd ([[ set completeopt+=menuone,noselect,popup]] )
6452vim .lsp .enable (' gopls' )
0 commit comments