mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
runtime(vim): Update base-syntax, improve :map highlighting (#14141)
Improve :map command highlighting. - Fix multiline RHS matching, allow continued lines and comments. - Allow ^V-escaped whitespace in LHS. - Handle map-bar properly and allow trailing commands. Fixes issue #12672. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -19,3 +19,69 @@ imapclear <buffer>
|
||||
lmapclear <buffer>
|
||||
cmapclear <buffer>
|
||||
tmapclear <buffer>
|
||||
|
||||
|
||||
" :help map-bar
|
||||
|
||||
" <Bar> '<' is not in 'cpoptions'
|
||||
map _l :!ls <Bar> more^M:echo "rhs"<CR>
|
||||
" \| 'b' is not in 'cpoptions'
|
||||
map _l :!ls \| more^M:echo "rhs"<CR>
|
||||
" ^V| always, in Vim and Vi
|
||||
map _l :!ls | more^M:echo "rhs"<CR>
|
||||
|
||||
map lhs :search('foo\\|bar')<CR>:echo "rhs"<CR>
|
||||
|
||||
|
||||
" multiline RHS
|
||||
|
||||
map <leader>baz
|
||||
\ :echo (<bar>
|
||||
\
|
||||
\'bar')<cr>
|
||||
"\ comment
|
||||
|
||||
map lhs
|
||||
"\ comment
|
||||
\ echo "foo"
|
||||
|
||||
map lhs
|
||||
"\ comment
|
||||
\ echo "foo"
|
||||
|
||||
map lhs
|
||||
"\ comment
|
||||
\ echo "foo"
|
||||
|
||||
map l hs
|
||||
"\ comment
|
||||
\ echo "foo"
|
||||
|
||||
map l hs
|
||||
"\ comment
|
||||
\ echo "foo"
|
||||
|
||||
map lhs rhs
|
||||
map l h s rhs
|
||||
|
||||
map lhs
|
||||
"\ comment (matches as RHS but harmless)
|
||||
echo "clear"
|
||||
|
||||
|
||||
" Issue #12672
|
||||
|
||||
nnoremap <leader>foo :echo call(
|
||||
"\ comment
|
||||
\ {x->x},
|
||||
\ ['foo'])<cr>
|
||||
|
||||
nnoremap <leader>bar :echo (
|
||||
\
|
||||
\ 'bar')<cr>
|
||||
|
||||
|
||||
" Example:
|
||||
" /autoload/netrw.vim
|
||||
|
||||
if !hasmapto('<Plug>NetrwOpenFile') |nmap <buffer> <silent> <nowait> % <Plug>NetrwOpenFile|endif
|
||||
|
Reference in New Issue
Block a user