Cut Entire Line


In a lot of editors, the ability to cut an entire line is supported by CTRL/CMD+X, but only when no characters are highlighted. I’ve looked at the keybindings and at the moment the action for CMD+X on my mac is core:cut, which I suppose only works when there are characters selected. This would be another little productivity bonus :smile:


The quickest way I’ve found to do this is ⌘+L to highlight a line, then just ⌘+X. Granted, that’s 2 combinations to type, but fairly quick.

I’ve noticed that ⌘+X when no characters are selected just does a forward delete (without adding the letter to the clipboard). I don’t know if that is intentional or not…


I think you may like this:


CTRL+k cuts a line, and it puts it into the global clipboard (as opposed to the app specific one that CTRL+k uses elsewhere on OS X).


I wonder if they will start merging some of these features or making them default to the browser because it seems like this functionality should be default.


Funny how they already have the code for it in their doco

atom.commands.add 'atom-text-editor', 'custom:cut-line', ->
  editor = atom.workspace.getActiveTextEditor()

Can they just add this easily.


you can use control+shift+k to cut which ever line your curser is on.


Hahahaha too funny.