-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically advance to the next line after pressing F9 #3115
Comments
I can easily make F9 to advance to the next line, but I think it's much nicer to use cells. Please remember that cells are comments (so there's nothing special about them) of the form #%% One cell
#%% Another cell They are just interpreted by Spyder to break a file in regions that can be evaluated independently of the rest :-) But there's no problem in running However, @ckaldemeyer please let me know if this is a really important feature for you and/or your team or colleagues, and I'll add it to the next Spyder release :-) |
Hi Carlos, thanks for your answer! I know the concept of cells and already make use of it in certain scripts to group semantical connected blocks of code. But I think a shortcut "run current line and advance" would be a nice addition to go through procedural scripts line by line without having to define cells. I think this would be a valuable feature for many users that use Python for data analysis and statistics coming from languages like R. And I know various people from my institution who would appreciate it. My opinion on the implementation: A definable keyboard shortcut under "Preferences > Keyboard shortcuts" would also be o.k. Thanks a lot! Cheers |
@ckaldemeyer, I think making F9 to move to the next line is the thing to do (instead of introducing a new shortcut that does something slightly different :-). @goanpeca, what do you think? |
Agree on F9 move to the next line 👍 |
@ccordoba12 and @goanpeca : That's great, thanks! Will it be in the next version? And what are your plans on the releases? Do your have a fix cycle or release as time allows you? Best! |
We have bugfix releases for the 2.3 branch, but they are limited to really critical bugs (like freezes and crashes). That's why I tagged this issue for Spyder 3.0. We hope to release it next month :-) |
Thanks a lot! |
Very much needed..looking forward to it..! |
I made a pull request to address this. If the user selects some text in the editor and then presses F9, the existing behaviour is to run the selection. I chose not to move the cursor to the next line in that case, because it's not clear (to me) that that is the right thing to do. |
👍 |
@jitseniesen, I think what you did is the right thing to do, i.e. don't move the cursor to the next line if there's text selected :-) |
Can we add an option to stop this auto advancing behavior please? Most times when I run the code line-by-line, I would like to check the result after running each line. So after running
I can immediately go shift-right to highlight A and F9 to print A. |
Hello, In RStudio, the CTRL + RETURN command skips past comments to whatever the next command line would be. This is great as you can quickly work through a file with comments. Most importantly, though, if there is a command that spans multiple lines, such as a dictionary or loop, it will run the whole thing and move on. Could this be incorporated as a new command? I've found this hotkey allows me to keep my fingers on the keyboard. Navigating and editing feels very natural. |
Hey @rfeir, we'll try to address your request in Spyder 6.1, to be released in six months or so. |
There's already a question on stackoverflow that perfectly describes my question:
I know some people in my working group and other institutions that would already like to have such a shortcut for procedural data analysis scripts, plotting, ...
Is there a way to realize that behaviour (without using code cells)?
The text was updated successfully, but these errors were encountered: