Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from Dec 3 '11 at 14:39

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

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
Vim in or 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
Did you ever find the solution? I've just come across this issue... – mylescc Jan 8 '15 at 11:40
cmd + '\'

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

share|improve this answer

Alt (aka opt) + .

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

share|improve this answer

In newer Macs this issue is fixed. For older Macs you can map the # to a combination of keys. See the Vim wiki site.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .