mirror of
https://github.com/neovim/neovim.git
synced 2026-08-19 02:24:46 -05:00
Problem: Neovim's Lua ftplugin doesn't set `'foldmethod'`, though Vim one sets it https://github.com/vim/vim/blob/1341176e7b800238b30a137c1ea1a31ca2c3d488/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<'
|