aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/insert.txt
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
commit931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch)
treed8c1843a95da5ea0bb4acc09f7e37843d9995c86 /runtime/doc/insert.txt
parent142d9041391780ac15b89886a54015fdc5c73995 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-userreg.tar.gz
rneovim-userreg.tar.bz2
rneovim-userreg.zip
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'runtime/doc/insert.txt')
-rw-r--r--runtime/doc/insert.txt42
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