0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00
vim/runtime/syntax/testdir/input/vim_ex_map.vim

88 lines
1.2 KiB
VimL
Raw Normal View History

" Vim :map commands
map!
map! lhs rhs
map
map lhs rhs
call map(list, 'v:val')
call map (list, 'v:val')
mapclear <buffer>
mapclear! <buffer>
nmapclear <buffer>
vmapclear <buffer>
xmapclear <buffer>
smapclear <buffer>
omapclear <buffer>
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