Mercurial > vim
diff runtime/doc/map.txt @ 22958:e7c125224b1a
Update runtime files
Commit: https://github.com/vim/vim/commit/4466ad6baa22485abb1147aca3340cced4778a66
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 21 13:16:30 2020 +0100
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 21 Nov 2020 13:30:04 +0100 |
parents | 6d50182e7e24 |
children | 99ef85ff1af4 |
line wrap: on
line diff
--- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1,4 +1,4 @@ -*map.txt* For Vim version 8.2. Last change: 2020 Nov 12 +*map.txt* For Vim version 8.2. Last change: 2020 Nov 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -319,13 +319,16 @@ Example of using <Cmd> halfway Insert mo 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) |autocmd| was invoked. +command: it is executed as if an (unrestricted) |autocommand| was invoked. Note: - Because <Cmd> avoids mode-changes it does not trigger |CmdlineEnter| and |CmdlineLeave| events, because no user interaction is expected. - For the same reason, |keycodes| like <C-R><C-W> are interpreted as plain, unmapped keys. +- The command is not echo'ed, no need for <silent>. +- 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. - In Select mode, |:map| and |:vmap| command mappings are executed in Visual mode. Use |:smap| to handle Select mode differently. @@ -1238,9 +1241,9 @@ Otherwise, using "<SID>" outside of a sc If you need to get the script number to use in a complicated script, you can use this function: > - function s:SID() - return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$') - endfun + func s:ScriptNumber() + return matchstr(expand('<SID>'), '<SNR>\zs\d\+\ze_') + endfunc The "<SNR>" will be shown when listing functions and mappings. This is useful to find out what they are defined to.