My Mac has a British keyboard layout and the # symbol is entered with option-3, instead of shift-3 as with the US layout. This arrangement, though odd, works fine most of the time. However, when trying to edit a file with vim in a terminal, typing option-3 just takes vim out of edit mode.
I use # often for comments in scripting languages and for pre-processor directives in C.
How do I type #?