aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/eval.txt8
-rw-r--r--runtime/doc/map.txt21
-rw-r--r--runtime/doc/repeat.txt1
3 files changed, 17 insertions, 13 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 05fdf2f5bb..09c44a88af 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -4270,10 +4270,10 @@ The input is in the variable "line", the results in the variables "file",
getting the scriptnames in a Dictionary ~
*scriptnames-dictionary*
-The |:scriptnames| command can be used to get a list of all script files that
-have been sourced. There is no equivalent function or variable for this
-(because it's rarely needed). In case you need to manipulate the list this
-code can be used: >
+The `:scriptnames` command can be used to get a list of all script files that
+have been sourced. There is also the `getscriptinfo()` function, but the
+information returned is not exactly the same. In case you need to manipulate
+the output of `scriptnames` this code can be used: >
" Get the output of ":scriptnames" in the scriptnames_output variable.
let scriptnames_output = ''
redir => scriptnames_output
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 164e2d4ec5..37158e2e76 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -290,7 +290,7 @@ Therefore the following is blocked for <expr> mappings:
- Moving the cursor is allowed, but it is restored afterwards.
- If the cmdline is changed, the old text and cursor position are restored.
If you want the mapping to do any of these let the returned characters do
-that. (Or use a |<Cmd>| mapping instead.)
+that, or use a |<Cmd>| mapping instead.
You can use getchar(), it consumes typeahead if there is any. E.g., if you
have these mappings: >
@@ -324,20 +324,22 @@ be seen as a special key.
*<Cmd>* *:map-cmd*
The <Cmd> pseudokey begins a "command mapping", which executes the command
-directly (without changing modes). Where you might use ":...<CR>" in the
+directly without changing modes. Where you might use ":...<CR>" in the
{rhs} of a mapping, you can instead use "<Cmd>...<CR>".
Example: >
- noremap x <Cmd>echo mode(1)<cr>
+ noremap x <Cmd>echo mode(1)<CR>
<
-This is more flexible than `:<C-U>` in visual and operator-pending mode, or
-`<C-O>:` in insert-mode, because the commands are executed directly in the
-current mode (instead of always going to normal-mode). Visual-mode is
+This is more flexible than `:<C-U>` in Visual and Operator-pending mode, or
+`<C-O>:` in Insert mode, because the commands are executed directly in the
+current mode, instead of always going to Normal mode. Visual mode is
preserved, so tricks with |gv| are not needed. Commands can be invoked
-directly in cmdline-mode (which would otherwise require timer hacks).
+directly in Command-line mode (which would otherwise require timer hacks).
+Example of using <Cmd> halfway Insert mode: >
+ nnoremap <F3> aText <Cmd>echo mode(1)<CR> Added<Esc>
Unlike <expr> mappings, there are no special restrictions on the <Cmd>
command: it is executed as if an (unrestricted) |autocommand| was invoked
-or an async event event was processed.
+or an async event was processed.
Note:
- Because <Cmd> avoids mode-changes (unlike ":") it does not trigger
@@ -350,7 +352,7 @@ Note:
- In Visual mode you can use `line('v')` and `col('v')` to get one end of the
Visual area, the cursor is at the other end.
- *E5520*
+ *E1255* *E1136*
<Cmd> commands must terminate, that is, they must be followed by <CR> in the
{rhs} of the mapping definition. |Command-line| mode is never entered.
@@ -636,6 +638,7 @@ not to be matched with any key sequence. This is useful in plugins
*<MouseMove>*
The special key name "<MouseMove>" can be used to handle mouse movement. It
needs to be enabled with 'mousemoveevent'.
+The |getmousepos()| function can be used to obtain the mouse position.
*<Char>* *<Char->*
To map a character by its decimal, octal or hexadecimal number the <Char>
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 23030761dd..8644ce4b38 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -336,6 +336,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
:scr[iptnames] List all sourced script names, in the order they were
first sourced. The number is used for the script ID
|<SID>|.
+ Also see `getscriptinfo()`.
:scr[iptnames][!] {scriptId} *:script*
Edit script {scriptId}. Although ":scriptnames name"