The following mapping doesn't work as expected:
cnoremap $ <esc>
I would expect that when I press $ in command line mode, it cancels the current command line and returns to normal mode.
But instead of that, it runs the current command line, and returns to normal mode (as if I had pressed the Return key).
Hello before exiting the command line.
Is it a normal behaviour, and how can I map a key to cancel the command line mode?