spyder-ide / spyder

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

Suggestion for keyboard shortcut to custom script #6856

Open ale152 opened 6 years ago

ale152 commented 6 years ago

Hello,

I've been using Spyder for the last couple of months and I love all the "matlab-like" features. One of the things I miss the most, though, is the possibility to create shortcuts to custom scripts. In matlab, it's possible to create a shortcut (described here) which is a piece of code that is executed with a combination of keys. This is extremely useful for very basic commands, like "close all", "figure,plot(x)", or "figure,imagesc(x)" and similar. These shortcuts can be easily accessed with a keyboard shortcut and make the workflow extremely quick.

Would it be possible to implement a similar custom shortcut into Spyder? My idea is that a new bar could be created, where each button stores some very short script that is executed with the same functionality of "right click, run selection".

Thank you, Alessandro

ccordoba12 commented 6 years ago

Would it be possible to implement a similar custom shortcut into Spyder?

It doesn't seem so easy to implement and it's not something we have the time to do it right now. You could try to do it, if this is important to you.

CAM-Gerlach commented 6 years ago

@ale152 Also, a similar feature—designating a "main" script to run on command on a per-project basis, is currently planned to be part of @andfoy 's improvements to projects in Spyder 4.