Sublime Forum

Nano-like ctrl+u "uncut line" key binding?


I have been using Nano faithfully for the past 15 years, and Sublime Text for the past few months.

In Nano, the easiest way to move a line of code is to cut line using crtl+k, move the cursor, and uncut the line using crtl+u.

I would love to have this capability in ST.

I’ve already created a custom key binding:

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

That was easy because the key binding already exist in ST, all I had to do was remove the shift key.

I am wondering if this is doable from a custom key binding, or whether this functionality would require something more complex.



Without any selection in place, you can cut the current line (or current lines if you have more the one cursor) with ctrl+x, move the cursor and then just paste it with ctrl+v.

Also, you can move up or down the current line (or selection) with ctrl+shift+up/down. It’s pretty handy for short movements.

1 Like



That works perfectly.

Thanks for the response.