Sublime Forum

Ctrl+C with nothing selected

#1

Ctrl+C when there is no text selected copies an entire line. This always surprises me when it happens, and it happens a lot since I am the type of person who can’t manage to hit Ctrl+V to paste reliably.

When the text I have on the clipboard is from a cut command within the same document (usually the case) I have to hit Ctrl+Z a few times to undo the cut, hit Ctrl+X to cut again, and then find the old place and paste correctly this time.

When the text is from another program or tab within sublime text, I have to switch over to it, find a way to get the same selection, and then copy it over to the place I want to paste.

Both of these are time-consuming and break up my workflow. Most other text editors simply ignore Ctrl+C when there is no selection, which is great because I can just correct my keystroke and I am off again. Perhaps this is already implemented as an option, in which case this is simply a +1 vote for making that the default (I would love to know how to do this though, since I can’t figure it out). Otherwise, I think Sublime Text should definitely implement this.

0 Likes

#2

Hi,

This should do it - I’m not sure if it’s the best way to this but it works. Add the following lines to your “User Key Bindings” file (this can be found in the Preferences menu). Now you should have ctrl+c and ctrl+x disabled when you don’t have any text selected.

<binding key="ctrl+c" command=""><context name="allSelectionsEmpty" value="true"/></binding> <binding key="ctrl+x" command=""><context name="allSelectionsEmpty" value="true"/></binding>

0 Likes

#3

search the forum, it was already discussed few times, as far as i can recall.

0 Likes

#4

Ahh, thanks guys, guess I must have missed it.

0 Likes