On Di, 26 Apr 2022, dado wrote:
> 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. Try something like the following: nmap <expr> (key some-expr ? 'cmd1<Bar>' : 'cmd2<Bar>') .. ':cmd3<CR><Bar>:cmd4<CR>' Note sure about all the `<Bar>`s and `<CR>`s :) Best, Christian -- Der raffinierteste Druck ist manchmal der Händedruck. -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20220427080210.GC3822443%40256bit.org.
