diff options
Diffstat (limited to 'runtime/doc/insert.txt')
-rw-r--r-- | runtime/doc/insert.txt | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index de1b850a3f..a1e0675b36 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1081,6 +1081,26 @@ Stop completion *compl-stop* CTRL-X CTRL-Z Stop completion without changing the text. +AUTO-COMPLETION *compl-autocomplete* + +To get basic "autocompletion" without installing a plugin, try this script: >lua + + local triggers = {"."} + vim.api.nvim_create_autocmd("InsertCharPre", { + buffer = vim.api.nvim_get_current_buf(), + callback = function() + if vim.fn.pumvisible() == 1 then + return + end + local char = vim.v.char + if vim.tbl_contains(triggers, char) then + local key = vim.keycode("<C-x><C-n>") + vim.api.nvim_feedkeys(key, "m", false) + end + end + }) +< + FUNCTIONS FOR FINDING COMPLETIONS *complete-functions* This applies to 'completefunc', 'thesaurusfunc' and 'omnifunc'. |