How can I change the keymap to have Delete Line working with cmd-d?


On my keymap.cson file I am trying:

  'cmd-d': 'editor:delete-line'

But it doesn’t seem to be working. Any idea?



There is some helpful information here:


Thanks @leedohm for pointing me into the right direction.

On the mentioned article it talks out about the Keybinding Resolver:

cmd-shift-p + Keybinding Resolver: Toggle

With that panel open, and reproducing the cmd-d I saw another keybinding was taking preference above the one I was writting, so I just needed to change it to:

'.platform-darwin .editor':
  'cmd-d': 'editor:delete-line'

And now it works! :smile:

Thanks again!


Unfortunately this did not work for me, I have tried to use cmd-delete to fire the same command:

'.platform-darwin .editor':
    'cmd-delete': 'editor:delete-line'

The keybinding resolver still only reports:

editor:backspace-to-beginning-of-line   .editor


Nevermind, figured it out. cmd-backspace was what I’m after.
The above post didn’t work either since it also needed ‘backspace’ instead of delete.

I’m using the wired mac keyboard, so even though they key says “delete” it’s actually backspace.

Hope this helps somebody.


I think this setting has broken in 1.1.0 , as this no longer works :angry:


The .editor selector has been deprecated for a long time. You may want to change it to atom-text-editor? Also, if you’re not on OS X, .platform-darwin should be replaced with the proper platform selector.


I realize this.

'.platform-darwin .atom-text-editor':
  'cmd-backspace': 'unset!'
  'cmd-delete': 'unset!'
  'cmd-backspace': 'editor:delete-line'
  'cmd-delete': 'editor:delete-line'

Here are the settings tried.


.editor is a class … atom-text-editor is an element. Try removing the period before atom-text-editor in your example.


That does help, but it doesn’t seem to work consistently. Especially when

'.platform-darwin atom-text-editor':
  'cmd-backspace': 'unset!'
  # 'cmd-delete': 'unset!'
  'cmd-backspace': 'editor:delete-line'
  # 'cmd-delete': 'editor:delete-line'


I’m getting ready to head into a meeting, I’ll take a look at it when I get out and see if I can help figure it out.


I’ll try an make an animated gif.


this worked for me. thanks.


Sorry for dropping the ball, I used just this and it seems to work properly and consistently:

'.platform-darwin atom-text-editor':
  'cmd-backspace': 'editor:delete-line'


Yeah I haven’t seen the transient bug lately; 1.20 might have fixed it.