spyder-ide / spyder

Official repository for Spyder - The Scientific Python Development Environment
https://www.spyder-ide.org
MIT License
8.27k stars 1.61k forks source link

Feature Suggestion: Cut current line #8574

Open skjerns opened 5 years ago

skjerns commented 5 years ago

This is a function I have been missing since a long time (since I first used it in other IDEs e.g VBStudio back in 2005). Often I want to duplicate the current line elsewhere. Right now I have to select the line with my mouse and press CTRL+X to cut it.

Do you think it would be possible to add a keyboard-shortcut for cutting the current line in the editor/console?

Once again props for this very good yet simple IDE, I've been using very extensively!

ccordoba12 commented 5 years ago

There's a shortcut to remove the current line, but it doesn't add its contents to the clipboard. What about if we do just that? Would that be enough for you @skjerns?

skjerns commented 5 years ago

if it would copy the just-cut line to the clipboard, that would be exactly what I need! thank you for the quick response :)

ccordoba12 commented 5 years ago

Ok, we'll implement this for Spyder 4.

skjerns commented 5 years ago

super cool!

bcolsen commented 5 years ago

Is there any reason that ctrl-x and ctrl-c couldn't act on the whole line if nothing is selected?

Currently if nothing is selected those shortcuts do nothing. It could be convenient if they copied or cut the current line the cursor is in if nothing is selected.

jnsebgosselin commented 5 years ago

There's a shortcut to remove the current line, but it doesn't add its contents to the clipboard. What about if we do just that?

I'm not sure that having my clipboard content overridden every time I remove the current line with Ctrl+d is something I like... this will have an important impact on my workflow.

Is there any reason that ctrl-x and ctrl-c couldn't act on the whole line if nothing is selected?

I prefer this solution, or use new shorcuts derived from these.

bcolsen commented 5 years ago

I'm not sure that having my clipboard content overridden every time I remove the current line with Ctrl+d is something I like... this will an important impact on my workflow.

I was going to mention this as well.

skjerns commented 5 years ago

I was also assuming a new shortcut and not overriding the current one.

gurditsbedi commented 3 years ago

Was this implemented? I am using Spyder 5.0.5.

If not, I can try to implement. Pointing me to necessary files will help.

wheyVanilla commented 1 year ago

Is there any updates for this one?

ccordoba12 commented 1 year ago

Sorry, we haven't implemented this due to lack of time. But we'll try to do it for Spyder 6, to be released before the end of the year.

Yugadeep commented 1 year ago

Okay, I'm low-key excited about this feature. I've wanted quick selecting line/ quick cutting line for the longest time.