Script Analytics

2016/01/12

Unable to write enclosing bracket with Atom ? You have a keybinding issue

I started using Atom as a Notepad++ substitute for some time now. I find it really convenient and extensible, however one thing bugged me for a few days...

I am a windows 10 user with a french keyboard and I was unable to add an enclosing bracket "altgr + )" or curly bracket "altgr + =". After a bit of digging, this is due to default keybinding.


Keybindings can be seen in the settings (File > Settings > Keybindings) :
They can be browsed/searched by keystroke, command, source or selector.

In order to override a keybinding, you need to modify the keymap file. There is a link in the keybindings settings but you can also use the command palette "ctrl + shift + p" and type keymap :

The keymap is a list of user defined keybinding. A keybinding looks like the following code :
'body':
  'cmd-i': 'namespace:event'

Two strange points :
  • "altgr" is handled as "ctrl-alt"
  • "altgr + )" is match by "ctrl-alt-[" instead of "ctrl-alt-)"
The following code will unset all the default beybindings involving "ctrl-alt-=" or "ctrl-atl-[" :
'atom-workspace atom-pane':
  'ctrl-alt-=': 'unset!'

'atom-workspace atom-text-editor:not([mini])':
  'ctrl-alt-[': 'unset!'

Enjoy your enclosing (curly) brackets !

No comments:

Post a Comment