vote up 2 vote down star
1

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 #?

flag

migrated from stackoverflow.com

3 Answers

vote up 2 vote down check

Another option: Ctrl-K, Shift-N, b

link|flag
Yes. That works. – Will Harris Aug 21 at 18:30
vote up 1 vote down

In Terminal's settings, un-check 'Use option as meta key'. It's under the 'Settings' tab's 'Keyboard' pane.

link|flag
vote up 0 vote down

Does Ctrl-V, Option-3 work?

link|flag
No. I just get ^[3 ("\x1b3"). – Will Harris Aug 21 at 18:14

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.