microsoft/vscode

Local history: allow to configure entries location to be relative to workspace

badrelmers opened this issue · 12 comments

I hope we can have an option to save the backup file relative to the original file (inside .vscode for example). like local history does.

why not use local history if it does what I want? because it was not updated for 2 years and have a lot of bugs that makes it unusable for me: for example it stopped working with the single file mode, I have to open a folder in vscode otherwise it does not work...)

If I understand this request correctly, a setting to configure where to store local history entries, maybe with support for a relative path to store into the workspace is desired here?

a setting to configure where to store local history entries

yes exactly

maybe with support for a relative path to store into the workspace is desired here?

yes with relative path, but I hope it will work in the single file mode too (without needing to use a workspace/folder). this is how local history worked before vscode changed something internally.

Where would the history be stored into when in single file mode where no folder is opened?

Where would the history be stored into when in single file mode where no folder is opened?

relative to the file I m working on, inside a folder. for example .vscode/History or .history or some configurable path from settings.

Yeah true, that would be consistent. But you might end up with a lot of .vscode folders for every "loose" file you edit in.

But you might end up with a lot of .vscode folders for every "loose" file you edit in.

This is not a problem at all, this is how notepad++ works too (and also the local history), it works very well, I feel safe when I see these backup folders near my files, and I can fully and easily control the backup files, and I can move the parent folder without losing the backup files, and I can rename or delete the original file and still be able to find easily the backup file...

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Z-E-D commented

it stopped working with the single file mode, I have to open a folder in vscode otherwise it does not work...)

How do you get that "single file mode"? Currently, every single file that I open in VSCode, even these that are not inside the current workspace, are saved to the Local History.

I would like that VSCode save files to the Local History only if they are part of the currently opened workspace. I don't want it to make file backups for each and every file that I want to edit in VSCode, even my shopping lists and playlist files.

There is a workbench.localHistory.exclude setting that is somewhat helping but not ideal, sounds like a new feature request to file.

@Z-E-D I use a batch (.bat) to open vscode, and I use the portable vscode (zip file).
so this is how I open vscode to get the single file mode:
code.exe -r myfile
but remember that vscode will open itself in the same mode it had when you close it, so to test this first close any open folder using File>Close Folder or File>Close Workspace.

but why this now that vscode has implemented the local history and it works as you want it.

Z-E-D commented

Thanks for responses. I am using VSCode in portable mode, but I would like to avoid creating batch files if I just want to edit a simple file of any kind, just to prevent making its backup.

I just opened a new issue for my request (#146649).

By the way, I agree that VSCode should have an option for saving backup files (local history entries) in the folders relative to the original files.

This would be great as I'd imagine that in my environment (editing files on a shared drive) it would allow my colleagues to also view the file history.

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!