aboutsummaryrefslogtreecommitdiff
path: root/runtime/ftplugin/lua.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/ftplugin/lua.lua')
-rw-r--r--runtime/ftplugin/lua.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/runtime/ftplugin/lua.lua b/runtime/ftplugin/lua.lua
index 75deb6b190..e0f7e95cf6 100644
--- a/runtime/ftplugin/lua.lua
+++ b/runtime/ftplugin/lua.lua
@@ -1,4 +1,9 @@
-- use treesitter over syntax
vim.treesitter.start()
-vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n call v:lua.vim.treesitter.stop()'
+vim.bo.omnifunc = 'v:lua.vim.lua_omnifunc'
+vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
+
+vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
+ .. '\n call v:lua.vim.treesitter.stop()'
+ .. '\n setl omnifunc< foldexpr<'