views:

213

answers:

2

When using TextMate on a Mac for HTML (and indeed any other language) I can't enter the hash (#) symbol using the keyboard. British keyboards have a £ symbol on the 3 key which displaces the hash symbol.

In several other Mac application, you can press alt+3 to get the hash symbol, but in TextMate, that doesn't work.

Is there an alternative that more experienced Mac programmers than me know of?

+1  A: 

For programming it's generally a good idea to switch to a US keyboard layout - this only really affects the use of shift-3 vs option-3 (£ and # get toggled - you can still get £ via option-3).

System Preferences -> Language & Text -> Input Sources -> U.S. (and check "Show Input menu in menu bar" for convenient toggling between US and UK keyboard layouts).

Paul R
Thanks for the answer. I find it hard to believe that there's no alternative, especially for such a common character in HTML/CSS/Apache.conf/etc. On Windows you could Alt+NumPad it in, and I suppose I was hoping for some operating system level solution that would work across all applications.
Drew Noakes
It sounds like a TextMate bug to me, since all other apps will happily accept option-3 when using a UK keyboard layout. Personally I don't even like the UK keyboards themselves (funny return keys etc) so I get mine from the US, with the # printed above the 3, where nature intended it to be. ;-)
Paul R
+1  A: 

Doesn't Alt-3 work for you?

I just checked it on my MBP and it works fine. (I had to first enable/activate another keyboard by: system preference > Language & Text > Input Sources > (the check the boxes next the languages you want to enable. Close Sys Pref, then click on flag in upper right hand corner of your menubar. Then click on either "Show Keyboard Viewer" or "Show Character Viewer"--either will show you this key binding.

My bust--Paul's answer wasn't in when i first looked at this Q; only noticed it after i fired off my (obviously redundant) answer.

doug
Alt-3 isn't working. The keyboard viewer indicates that Alt+3 should work, but it doesn't. The character viewer gives the unicode character but no keybinding. If this works for you, then what bundle do you have selected when it's working? I'm using 'Plain Text'.
Drew Noakes