mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
Problem:
Neovim's Lua ftplugin doesn't set `'foldmethod'`, though Vim one sets it 1341176e7b/runtime/ftplugin/lua.vim (L66-L68)
Solution:
Set it
12 lines
421 B
Lua
12 lines
421 B
Lua
-- use treesitter over syntax
|
|
vim.treesitter.start()
|
|
|
|
vim.bo.includeexpr = [[v:lua.require'vim._ftplugin.lua'.includeexpr(v:fname)]]
|
|
vim.bo.omnifunc = 'v:lua.vim.lua_omnifunc'
|
|
vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
|
vim.wo[0][0].foldmethod = 'expr'
|
|
|
|
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
|
|
.. '\n call v:lua.vim.treesitter.stop()'
|
|
.. '\n setl omnifunc< foldexpr< foldmethod< includeexpr<'
|