Well, you start with cursor on your text, Ctrl+H and type replacement. But surprisingly i was not able to found any shorcut for actual replace or replace all action, rather than tabbing 5(!) times or moving my hand for a mouse.
Straightforward enter does nothing, tabbing to replace button and entering replaces, but throws me into the editor. VisualStudio-like Alt+A does nothing.
Am i missing something in spyder shortcuts?
The shortcut for replace is Ctrl + R.
I have the same issue with Spyder, I don't know why this has not been implemented in the editor.
The work around I currently have for multiple replace is to :
Copy the replacement term to the clipboard
Search(Find/Replace) for the term to replace
Use F3 to select the next term
Use paste Ctrl+V to replace it
Back to step [3] to find the next term
Hope this helps!
EDIT:
According to Spyder dev @carlos below. Since v3.2 This has now been implemented and you may just press and move to the next term.
(Spyder developer here) Since Spyder 3.2 you will be able to press Enter in the replace field to replace the current selection and automatically move to the next one.
Are you on MacOS
? There is an issue on github suggesting that the CMD+H shortcut is assigned to "hide spyder". An update will bind CMD+R as a replacement. As this has just been merged, it will take a few days before a dmg
is available for MacOS. In the meantime you can go to Preferences --> Keyboard shortcuts --> editor: replace text and change the shortcut binding.
Reference:
https://github.com/spyder-ide/spyder/issues/2914
Why just not use Notepad++?
In spyder editor, select the entire code (Ctrl+A), copy it (Ctrl+C) and paste it (Ctrl+V) into Notepad++. Then hit Ctrl+F, click on the "Replace" tab/menu (or you can use Tab to navigate) on the window that opens, write the string/value you want to find/replace, write the string/value you want to replace with, hit replace (or replace all: Alt+A; it will replace in the entire code). Do it as many times as you want/need - depending on how many unique values/strings you want to replace in the code. At any stage you can do Ctrl+Z to undo some actions or move the code from spyder editor to Notepad++ again (if you need to). Finally, select all, copy and paste it in the spyder editor and you're done.
It would be nice if spyder had this functionality implemented since it'd speed up the process but until then you can use this workaround. That's what i do also.
Video on how to do it (not mine):
https://www.youtube.com/watch?v=I6-7GBY0ZHY