From f398e3a61abbf802b49867d2f533be1b0725c0d7 Mon Sep 17 00:00:00 2001 From: Phạm Bình An <111893501+brianhuster@users.noreply.github.com> Date: Sun, 23 Feb 2025 22:57:16 +0700 Subject: feat(ftplugin): set Lua 'omnifunc' to vim.lua_omnifunc #32491 Problem: - Many other ftplugin have defined 'omnifunc', but the Lua one doesn't define one, even though there is `vim.lua_omnifunc()` - Users may want "stupid" completion to fix Lua config with `nvim --clean` in case they breaks it Solution: Set 'omnifunc' to 'v:lua.vim.lua_omnifunc' in ftplugin/lua.lua --- runtime/doc/insert.txt | 5 +++++ runtime/doc/news.txt | 3 +++ 2 files changed, 8 insertions(+) (limited to 'runtime/doc') diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 06f1a4e73d..8072b41466 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1502,6 +1502,11 @@ both major engines implemented element, even if this is not in standards it will be suggested. All other elements are not placed in suggestion list. +LUA *ft-lua-omni* + +Lua |ftplugin| sets 'omnifunc' to |vim.lua_omnifunc()|. + + PHP *ft-php-omni* Completion of PHP code requires a tags file for completion of data from diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 05d14600f8..e8ec6d1820 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -239,6 +239,9 @@ DEFAULTS • |[b|, |]b|, |[B|, |]B| navigate through the |buffer-list| • |[|, |]| add an empty line above and below the cursor +• Options: + • Lua |ftplugin| sets |'omnifunc'| to `"v:lua.vim.lua_omnifunc"`. + • Snippet: • `` in Insert and Select mode maps to `vim.snippet.jump({ direction = 1 })` when a snippet is active and jumpable forwards. -- cgit