Change keymap for Tree View:Toggle in Atom?

atom-editor, keymapping

Solution

I went through the same problem! It was a pain in the ass because i needed to use my own shortcuts but atom's keybinding are different from my latin-qwerty-keyboard, so while playing around with atom and looking for some good information, i came out with this solution:

Problem:

When i type in my windows Ctrl-Alt-\ Atom's keybinding is Ctrl-Alt-]

Or if i want '@' i need to type Ctrl-Alt-q but Atom's keybinding does this 'autoflow:reflow-selection' instead.

Solution:

1._ Go to Settings->Keybindings. Once you're there, in the search bar, find the keybinding you want to change. For example if i want to change Ctrl-Alt-q, so i type: Q and it'll filter all keybindings with this letter.

2._Then to modify it, click int the copy&paste small-icon next to the keybinding you want to modify, it is at Keystroke column. (it will copy the code lines that you need so that you can modify it)

3._ Once you copied the keybinding, go to File->Open Your Keymap and it'll open a tab with the keymap.cson file. Put your cursor at the end and paste there the lines you copied in step#2. It should show something like this:

'.platform-win32 .editor, .platform-linux .editor':
  'ctrl-alt-q': 'autoflow:reflow-selection'

4._ Now you can change atom's behavior. I'll erase 'autoflow:reflow-selection' and write 'unset!' so that it shows the arroba.

'.platform-win32 .editor, .platform-linux .editor':
  'ctrl-alt-q': 'unset!'

Now when i type Ctrl-Alt-q in atom editor it shows the arroba, finally! If you want it to do something else, instead of writting 'unset!' you just need to put whatever you want it to do.

Note: If you want to know the atom's keybindings so that you can change some of them, use the keybinding resolver, go to Packages->Keybinding Resolver->Toggle.

Here i post the changes i did in my keymap.cson in order to use my atom editor with my latin-qwerty-keyboard.

'atom-workspace atom-text-editor:not([mini])':
  "ctrl-alt-[": "unset!",
  "ctrl-alt-]": "unset!",
  'ctrl-/': 'unset!'
  'ctrl-7': 'editor:toggle-line-comments'
  'ctrl-alt-8': 'tree-view:recursive-collapse-directory'
  'ctrl-alt-8': 'editor:fold-current-row'
  'ctrl-alt-9': 'editor:unfold-current-row'
'.platform-win32 .editor, .platform-linux .editor':
  'ctrl-alt-q': 'unset!'
'.platform-win32 .find-and-replace, .platform-linux .find-and-replace':
  'ctrl-alt-/': 'unset!'
  'ctrl-alt-7': 'find-and-replace:toggle-regex-option'
'.platform-win32 .project-find, .platform-linux .project-find':
  'ctrl-alt-/': 'unset!'
  'ctrl-alt-7': 'project-find:toggle-regex-option'

Cheers!

Problem

I'm getting started with customizing the Atom Editor and have gotten stumped attempting to change the key mapping for Tree View:Toggle. I put this in my user keycap.cson file: `'.editor': 'ctrl-t': 'Tree View:Toggle' ` But it doesn't work. Looking at Preferences->Keybindings I see it listed as I'd expect: `ctrl-t Tree View:Toggle User .editor` What did I do wrong? Update: Changing to: ` '.editor': 'ctrl-t': 'tree-view:toggle' ` didn't fix the problem. The Key Binding Resolver shows that the command was recognized, but it didn't toggle the tree view. See this screenshot: http://cl.ly/image/3A2X1p350v2Q Any other thoughts on this?

Original source