Often I wish to run / edit a code snippet in a fresh file, and not lose it - but don't seek to save it in any particular directory, especially not the project / previous file's directory. It'd help to have a settable "default" directory, just like a default file title (Untitled), to which one could save with a dedicated command - thus not having to manually search for one (and bypassing any selection prompts).
Hi @OverLordGoldDragon,
We need to discuss the importance of this feature request with the rest of the team. I'll let you know what we decide.
Hi @OverLordGoldDragon,
Can you please provide us a concrete example of this functionality? Like the user cases you'll like to add
Thanks!
@steff456 Sure; demo:
main.py
), which is undesiredSo instead, there could be an extra option to save to a default directory - and Spyder would increment the name appropriately if needed (e.g. untitled4
-> untitled5
):
This looks very confusing and I don't think we'll add something like that.
I understand your idea of having scratchpad kind of files, but we'd need to come up with a better user experience for that concept.
@ccordoba12 The idea is to have a one shortcut/click save of a file to a user-defined "default" directory; doesn't seem more confusing than configuring the working directory or startup script.
One _could_ simplify to saving it to .spyder-py3/defaultsave
, just like /autosave
, with maybe some notification of where the save went to, and "You can configure this directory in Preferences", with the "Don't show this again" option - so the user's informed of how the feature works. ... actually this is less simple but it sure ought to be less confusing.
Hey @OverLordGoldDragon, thanks for taking the time to post this issue and giving insight into a part of how you work in Spyder! I want to make sure I鈥檓 understanding the problem well and that we look into a solution that will resolve the root of the problem, so I have a few clarifying questions.
default
(or similar) directory created by a user that they can choose from the Save as? It sounds like because it takes more than a single click or keyboard shortcut, but are there other reasons too?Thanks again!
@isabela-pf Thanks for taking interest.
It's to not have to open a fresh new Spyder, with its own project (or lack of). Example: I'm unit-testing a package, and someone shares an unrelated code I awaited. I need to edit the code several times and re-run it with a fresh namespace; also rather not lose it by accident. This requires saving.
The user most likely won't know how the feature works, and won't have said directory configured. So, Spyder could (1) make its own default
and simply notify the user that that's where the file went to, and that it can be changed via Preferences, or (2) prompt the user to select such a directory. (2) involves an extra step, and may be less beginner-friendly, but is otherwise fine.
Standalone. Though, it could draw from files in the same default directory if the "working directory" is set to the file's.
I agree this could be useful and a simple interaction. There are a have a few UI changes that would need to be implemented to support it.
First, I agree it should appear In the File menu as previously mentioned. I also agree that grouping it in the menu with other save options is the right choice.
Second, it makes sense to provide preferences for the user to configure save location and file name. I鈥檝e also shown what sound like they should be the default options: save to some kind of unique, Spyder designated directory (I made up one) and give the default name Untitled. It should look like this:
Third, I don鈥檛 know what shortcut would make sense for this, but having it at least able to be assigned a shortcut manually sounds important to minimize the actions needed for a quick save.
Talking with other Spyder team members brought up the question of how to handle these files if they are open when Spyder is closed. I think they can function like all other files and reopen the next time Spyder is opened.
Feedback is always welcome, especially since I might be missing the nuances of this feature.
@isabela-pf Excellent, all looks good and better; quicksave
's more succinct. Unsure what's meant by "open when Spyder is closed", but I'd go with "treat like any other save".
Didn't expect this to gain traction - glad it's being seriously considered. Lately I've had untitled
s piling up in projects, and fun times renumbering them all when moving to a common directory.
Unsure if PyCharm has this; could be a point to list in those "Spyder vs PyCharm" articles.