Possible to chain actions together somehow?


In Sublime ctrl-x will cut the whole line in which the cursor is located. Is there a way to mimic this behaviour in Atom?


That’s the beauty of Atom.

Add this code to your init.coffee file:

atom.workspaceView.command 'custom:cutline', ->
  editor = atom.workspace.getActiveEditor()
  editor.selectLine() if not editor.getSelectedText()

The add this to your keymap.cson file:

  'cmd-x': 'custom:cutline'

Conditional keybinding behaviour

Beautiful! Thanks! Much appreciated!


I took @AbeEstrada code and added copy and paste functions.