diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /runtime/doc/insert.txt | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-aucmd_textputpost.tar.gz rneovim-aucmd_textputpost.tar.bz2 rneovim-aucmd_textputpost.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'runtime/doc/insert.txt')
-rw-r--r-- | runtime/doc/insert.txt | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index e608b431f2..ce2ec36ca3 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -114,12 +114,16 @@ CTRL-R {register} *i_CTRL-R* the last delete or yank '%' the current file name '#' the alternate file name - '*' the clipboard contents (X11: primary selection) + "*" the clipboard contents (X11: primary selection) '+' the clipboard contents '/' the last search pattern ':' the last command-line '.' the last inserted text + *i_CTRL-R_-* '-' the last small (less than a line) delete + register. This is repeatable using |.| since + it remembers the register to put instead of + the literal text to insert. *i_CTRL-R_=* '=' the expression register: you are prompted to enter an expression (see |expression|) @@ -221,11 +225,11 @@ CTRL-Y Insert the character which is above the cursor. able to copy characters from a long line. *i_CTRL-_* -CTRL-_ Switch between languages, as follows: - - When in a rightleft window, revins and nohkmap are toggled, +CTRL-_ Switch between insert direction, by toggling 'revins', as follows: + - When in a rightleft window, 'revins' is toggled, since English will likely be inserted in this case. - - When in a norightleft window, revins and hkmap are toggled, - since Hebrew will likely be inserted in this case. + - When in a norightleft window, 'revins' is toggled, + since a rightleft language will likely be inserted in this case. CTRL-_ moves the cursor to the end of the typed text. @@ -1081,6 +1085,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 or vim.fn.state("m") == "m" then + return + end + local char = vim.v.char + if vim.list_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'. @@ -1101,8 +1125,8 @@ cursor column will be replaced with the matches. If the returned value is larger than the cursor column, the cursor column is used. Negative return values: - -2 To cancel silently and stay in completion mode. - -3 To cancel silently and leave completion mode. + -2 To cancel silently and stay in completion mode. + -3 To cancel silently and leave completion mode. Another negative value: completion starts at the cursor column On the second invocation the arguments are: @@ -1154,7 +1178,7 @@ items: item with the same word is already present. empty when non-zero this match will be added even when it is an empty string - user_data custom data which is associated with the item and + user_data custom data which is associated with the item and available in |v:completed_item|; it can be any type; defaults to an empty string @@ -1392,7 +1416,7 @@ other versions of HTML. Features: - after "<" complete tag name depending on context (no div suggestion inside of an a tag); '/>' indicates empty tags - inside of tag complete proper attributes (no width attribute for an a tag); - show also type of attribute; '*' indicates required attributes + show also type of attribute; "*" indicates required attributes - when attribute has limited number of possible values help to complete them - complete names of entities - complete values of "class" and "id" attributes with data obtained from |