(I put the tl;dr bit at the top)
How can i bind F10 for Vim so that when I hit F10 while inside command (Ex) mode that the command in the command buffer is not actually executed?
I have already tried the one thing that I know to do for the situation which is
cnoremap <F10> <ESC>
Background information follows...
I have a binding which for historical (arbitrary) reasons I have been using the F10 key to conditionally control my unix systems. So basically what I needed to tell Vim to do is when I hit F10 either have this function the same as the Esc key (to exit insert mode for example) or do some other action if already in normal mode (such as move to next pane in tmux
).
So that is the background that you didn't ask for about why I am binding Esc rather than mapping my Esc key at the OS level. It's a "smart" unintuitive crazy thing but it's intuitive for yours truly now :)
This has worked fantastically well through a small number of hundreds of thousands of lines of code over many years since I started doing this but one quirk remains.