Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Spyder IDE, how do you return from "goto definition"?

Description of the problem:

I like to jump around code a lot with the keyboard but I am hitting a wall of usability in Spyder IDE. I can use the "goto definition" feature to jump to the definition of some function but then I can't go back to where my cursor was (so it takes a while to manually find where I was before because there might be many lines of code).

So for example there is a constant X=5 in the same file and when I use "goto definition" I can see what that constant is but then there is no way to go back. Or another example is a function from another file where "goto definition" takes me to that other file... but now I can't find the other file I was on (because there may be many files open).

In the 30+ year old vi you can goto the definition and return with ctrl-] and ctrl-t. In the 14+ year old Eclipse the equivalent to "goto definition" would be approximately F3 to go to the definition. And then to return would be alt-left.

running Spyder version 2.2.4.

Question:

Using Spyder IDE, can you return from "goto definition"? If you can, how do you return from "goto definition"?

What I've tried:

I have a keyboard shortcut for "previous cursor position" set to Alt Left but "previous cursor position" doesn't do anything when I hit the key. (The default keyboard shortcut is ctrl-alt-left which conflicts with the Cinnamon-dekstop-manager keyboard shortcut for switching workspaces and so I had to remap the above mentioned keyboard shortcut.)

like image 869
Trevor Boyd Smith Avatar asked Sep 02 '15 16:09

Trevor Boyd Smith


People also ask

How do you go back on a Spyder?

(Spyder maintainer here) You can use the shortcuts Ctrl + Alt + Left and Ctrl + Alt + Right to move to the previous/next cursor position, respectively.

How do you operate a Spyder IDE?

Running Spyder You can launch it in any of the following ways: From the command line: Type spyder in your terminal (or Anaconda prompt on Windows). From Anaconda Navigator: Scroll to Spyder under Home, and click Launch. *Windows Only*: Launch it via the Start menu shortcut.

What does #%% do in Spyder?

You can divide your scripts into as many cells as needed, or none at all—the choice is yours. You can separate cells by lines starting with either: #%% (standard cell separator) # %% (standard cell separator, when file has been edited with Eclipse)

How do you wrap text on Spyder?

To turn on the Word Wrap feature, go to View > Toggle Word Wrap or click the Edit Display icon in the Code Editor toolbar (it's the second-to-last one on the right) and select Toggle Word Wrap. You can also set the program preferences to keep this feature on by default.


1 Answers

Spyder have a one strange bug. Shortcut "Previous cursor position" only work if "Source toolbar" is present.

Turn on "View -> Toolbars -> Source toolbar". You can try it.

like image 102
Dolk13 Avatar answered Sep 27 '22 20:09

Dolk13