I can’t write the open square bracket in Sublime Text 2 – How to find out why

sublime-text-2

I'm running Sublime Text 2 on Windows x64 with the following packages installed:

  • Package Control
  • CoffeeScript
  • EncodingHelper
  • GIT
  • MarkDown Preview
  • Python PEP8 Lint
  • Stylus
  • SFTP
  • Theme – Soda

I had installed all these packages before I started coding and noticed that the open square bracket ([) can't be written in the editor. On my Norwegian keyboard that's ALTGR+8. I have all these packages (Except the Soda theme) on all my other development machines as well, but they are all Ubuntu machines.

I'm wondering how I can figure out what the problem is. I'm assuming that some key bind has overwritten ALTGR+8 but nothing happens when I use it. Is there a verbose- or debug mode I can use to figure out what's going on? Alternatively, is there perhaps a hack I can deploy to set the ALTGR+8 key-bind to write the open square symbol?

Thanks

Best Answer

I had this issue too, and couldn't write [, ] and }, but with different packages. I'm using Danish keyboard layout, so AltGr+8, AltGr+9 and AltGr+0 were the troubling keys for me.

My solution was to use Find in files to search for the keybinding files in all packages for the corresponding keybindings that was overriding my default keybindings to write brackets.

Preferences -> Browse packages copy the path, return to SublimeText and press Ctrl + Shift + F to search in files, and paste the path in the Where field. In my case, I needed to search for alt+ctrl+8, alt+ctrl+9 and alt+ctrl+0 and uncomment the lines which had the corresponding keybindings - if you still need to use the shortcuts, you can change them to another combination.

Works flawlessly. :)