I have MacVim on a UK MacBook Pro. I can use the hash on TextMate by typing alt 3 but in vim this does not work. Do you know how I can type a hash using VIM on a UK MacBook Pro?

The problem is happening in any VI/VIM with a Mac with UK keyboard. If I am in insert mode, I type alt + 3 (hash char in a MacBook Pro UK keyboard) VI exists to insert mode.

link|improve this question
I had this exact problem, threw the stupid US keyboard that came with the Mac in the bin and plugged a Windows keyboard with a £ sign into my Mac. Worked great with vim! ;-) – Benj Dec 1 '11 at 17:37
1  
Vim in Terminal.app or iTerm2.app or in MacVim? Do you have troubles with {[ and co as well or is it only #? – romainl Dec 1 '11 at 18:40
only with # and {[ are. I do not want to use a Windows keyboard! – rtacconi Dec 10 '11 at 13:19
c'on! Anyone using a mac with vim? – rtacconi Dec 15 '11 at 9:17
feedback

migrated from stackoverflow.com Dec 3 '11 at 14:39

This question came from our site for professional and enthusiast programmers.

2 Answers

Alt (aka opt) + down arrow.

I found this by looking at Terminal Preferences and going to the Keyboard options. There's a list of keys and actions

link|improve this answer
feedback
cmd + '\'

gets you a '#' when RDPing to Windows from a MBP with Apple UK External Keyboard under Lion, maybe try this for Vim?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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