You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ The [Lua][lua] file type plug-in for [Vim][vim] makes it easier to work with Lua
12
12
13
13
* The ['completefunc'][cfu] option is set to allow completion of Lua 5.1 keywords, global variables and library members using Control-X Control-U
14
14
15
+
* The ['omnifunc'][ofu] option is set to allow dynamic completion of all modules installed on the system using Control-X Control-O, however it needs to be explicitly enabled by setting the `lua_complete_omni` option because this functionality may have undesired side effects!
16
+
15
17
* Several [text-objects][tob] are defined so you can jump between blocks and functions
16
18
17
19
* A pretty nifty hack of the [matchit plug-in][mit] is included: When the cursor is on a `function` or `return` keyword the `%` mapping cycles between the relevant keywords (`function`, `return`, `end`), this also works for branching statements (`if`, `elseif`, `else`, `end`) and looping statements (`for`, `while`, `repeat`, `until`, `end`)
@@ -64,6 +66,19 @@ To disable completion of library functions you can set this option to false (0).
64
66
65
67
When you type a dot after a word the Lua file type plug-in will automatically start completion. To disable this behavior you can set this option to false (0).
66
68
69
+
### The `lua_complete_omni` option
70
+
71
+
This option is disabled by default for two reasons:
72
+
73
+
* The omni completion support works by enumerating and loading all installed modules. **If module loading has side effects this can have unintended consequences!**
74
+
* Because all modules installed on the system are loaded, collecting the completion candidates can be slow. After the first run the completion candidates are cached so this will only bother you once (until you restart Vim).
75
+
76
+
If you want to use the omni completion despite the warnings above, execute the following command:
77
+
78
+
:let g:lua_complete_omni = 1
79
+
80
+
Now when you type Control-X Control-O Vim will hang for a moment, after which you should be presented with an enormous list of completion candidates :-)
81
+
67
82
## Contact
68
83
69
84
If you have questions, bug reports, suggestions, etc. the author can be contacted at <peter@peterodding.com>. The latest version is available at <http://peterodding.com/code/vim/lua-ftplugin> and <http://github.com/xolox/vim-lua-ftplugin>. If you like this plug-in please vote for it on [Vim Online][script].
@@ -85,6 +100,7 @@ This software is licensed under the [MIT license](http://en.wikipedia.org/wiki/M
0 commit comments