I have the following (pseudo code) mapping working:
nmap <expr> key some-expr ?
\ 'cmd1<Bar>:cmd3<CR><Bar>:cmd4<CR>' :
\ 'cmd2<Bar>:cmd3<CR><Bar>:cmd4<CR>'
As you can see the conditional selects between cmd1 and cmd2, but both execute cmd3 and cmd4.
I'd like to move cmd3 and cmd4 outside of the conditional as in
nmap <expr> key some-expr?'cmd1':'cmd2'<Bar>:cmd3<CR><Bar>:cmd4<CR>
The problem is I get cmd1 or cmd2 to execute, but never cmd3 or cmd4.
I know I could move this to a function but I'd like to understand the syntax.
Thank you