summaryrefslogtreecommitdiff
path: root/mnv/runtime/syntax/testdir/input/mnv_ex_map.mnv
blob: 31103f5dd715881aa9606427aadc2b95a3015f00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
" MNV :map commands
" MNV_TEST_SETUP hi link mnvMapLhs Identifier
" MNV_TEST_SETUP hi link mnvMapRhs Todo
" MNV_TEST_SETUP hi link mnvMapRhsContinue Todo


map!
map! lhs rhs
map 
map lhs rhs

map <buffer><expr><nowait><script><silent><special><unique> lhs rhs
map <buffer> <expr> <nowait> <script> <silent> <special> <unique> lhs rhs

" :map special arguments are case sensitive, <BUFFER> is the LHS
map <BUFFER> rhs

map <Leader>lhs      rhs
map <LocalLeader>lhs rhs

map lhs <Leader>rhs
map lhs <LocalLeader>rhs

map lhs <Plug>rhs

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 MNV 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"


" Differentiate map() from :map

map ( :echo "open-paren"<CR>

call map(list, 'v:val')
call map (list, 'v:val')

function Foo()
  map ( :echo "open-paren"<CR>
  call map(list, 'v:val')
  call map (list, 'v:val')
endfunction

def Foo()
  map ( :echo "open-paren"<CR>
  map(list, 'v:val')
  # :map LHS=(list, RHS='v:val')
  map (list, 'v:val')
enddef


" Issue  #12672

nnoremap <Leader>foo :echo call(
  "\ comment
  \ {x->x},
  \ ['foo'])<CR>

nnoremap <Leader>bar :echo (
  \
  \ 'bar')<CR>


" Example:
"   /autoload/netrw.mnv

if !hasmapto('<Plug>NetrwOpenFile')          |nmap <buffer> <silent> <nowait> %	<Plug>NetrwOpenFile|endif