Reputation: 1533
It is very useful that in ST3 you can copy a whole line with just ctrl+c, the only problem is that this command also copies the "return" or new line character, so for example when you copy a line and paste in a console it will run the command immediately. This is undesirable because I will want to first edit the command before running it. This forces me to manually highlight the line.
Is there a plugin or an easy way to cope the line where the cursor is without including the new line character?
Upvotes: 4
Views: 1957
Reputation: 9428
You can replace the default behavior by creating a Sublime Text macro and a key bind for it on the Ctrl+C
key:
Packages/User/SelectLineNoEOL.sublime-macro
[
{ "command": "move_to", "args": { "to": "hardbol" } },
{ "command": "move_to", "args": { "to": "eol", "extend": true } },
{ "command": "copy" },
]
Default.sublime-keymap
{ "keys": ["ctrl+c"], "command": "run_macro_file",
"args": {"file": "res://Packages/User/SelectLineNoEOL.sublime-macro"},
"context":
[
{
"key": "selection_empty", "operator": "equal",
"operand": true, "match_all": false,
},
],
},
I think I had saw another thread with a plugin which does this, but I could not find it.
Related threads:
Upvotes: 4