Sublime Forum

Is there a way to cut an emtpy line, but not fill clipboard?

#1

I think the feature of copy/pasting on non selections is great, but I use ctrl+x a lot to remove empty lines, which also clears my clipboard.

Sure, this makes sense, but I would like to enjoy the benefit of ctrl+x and if the selection is empty, not to replace the existing clipboard. Does anyone know of a way to make this possible?

Sublime Text Tips has a hint going into this direction, but it’s not quite what I am looking for.

0 Likes

#2

To delete line, ctrl+shift+k on Windows/Linux.

1 Like

#3

The default keybinding file contains the following:

{ "keys": ["ctrl+shift+k"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },

if it works for you, then you could create a user keybinding for ctrl+x to run this macro file when the selection is empty.

1 Like