How do I combine mapped commands into another mapping?
For example, I have two mapped commands, each of which enters a bracketed string at the end of the current line, and then leaves the cursor on the line following:
nmap <leader>wtf A<Tab>(wtf!?)<CR><ESC>l
nmap <leader>eh A<Tab>(eh?)<CR><ESC>l
Each of them work as expected individually.
When I reuse them both in another mapping, the new command executes the first but not the second:
nmap <leader>c1 \wtf\eh
I tried using <leader>
at the head of each sub-command. It again, executes the first and not the second.
nmap <leader>c2 <leader>wtf<leader>eh
I tried also separating the sub-commands with a <bar>
operator in the new mapping. That does the same thing: executes the first but not the second.
nmap <leader>c3 \wtf<bar>\eh
A regular bar operator generates an error upon its definition (E10: \ should be followed by /, ? or &
):
nmap <leader>c4 \wtf | \eh
How can I combine these simple commands by invocation in another mapping?