Can I configure VSCode to auto copy my file to another file whenever I save? - visual-studio-code

I am new to VSCode. Is there a way VSCode can auto save all my saves to a sequence of files? For example, my file is named foo.c, after some editing, the first time I save the file, there is a file foo.c_1 generated, the 2nd time foo.c_2, the 3rd foo.c_3, etc.
savevers.vim is what I have been using for vim. It is super convenient, say, when I want to retrieve a version I did the day before.
[Update] Yes, thanks life888888, timeline works great, it saves the history after I close and reopen the project folder.

Related

Don't automatically open externally changed files in VS Code

Every time I rename a component and the editor changes that name in other files, they all get opened. Is there some option to make it not to do that?

VSCode: find and replace, but open edited files without saving them

When I perform a find and replace across all files, edits are made, the files are saved, but they are not opened.
Can I configure vscode to open those files that it edited, and not save them until I press ctrl+shift+s? I seem to remember it working that way once.

How to refresh content of opened files in VS Code?

I'm looking for a way to refresh the content of a file opened in editor after it was changed by other tool.
For instance I'm using angular command line which makes changes to files but VS Code doesn't refresh the content after that and I can't see any of that. What's worse when I try to save the file, VS Code by default tries to save the old content upon the newer (asks before of course, but still its not what I'm looking for).
I didn't find any keybindings for refresh the editor's content. Maybe there are any extensions?
Thank you.
It should reload itself automatically, but I had a machine that stopped auto-refreshing. I'd change the file externally (with vim or whatever), and the file I had in the editor wouldn't pop and refresh itself, which it used to do. It turned out to be a git-related extension. I disabled it, and autorefresh returned. If you haven't already, try it with extensions off.

Eclipse: Two Linked Resources pointing to same physical file are opening twice in Editor

I had to create multiple linked resources pointing to a single physical file in an Eclipse project. The problem is, whenever I try to open these two files, the editor opens each file in a separate tab, it won't direct me to the already opened file.
This is different from how VisualStudio works. VisualStudio has an option to add an existing file to a project. A single file can be used in multiple projects. Whenever we open both files, VS will direct us to the already opened file, it won't open the file in a new tab.
It's possible that developers open/edit multiple files at the same time and not notice that the same physical file was opened more than once. This behavior can potentially cause a lot of problems, for example, if File 1 is modified but not saved, and later File 2 is modified then saved, all modifications previously done in File 1 will be lost.
Is there any preference to turn-off/on this behavior? If not, can I implement this hook as a plugin?

Can I search Netbeans' local history?

In one of the previous versions of one of my file in a Netbeans project I wrote code that I later removed, and now I want to retrieve it. However now I can't find it when I manually go to previous versions, as I have many versions in the local history of this file, and I don;t remember when exactly I wrote this code.
Is there a way to run a search on the local history of this file?
I saw in this answer that the local history is kept in this path
<HOME>/.netbeans/<NB_VERSION>/var/filehistory where HOME is my user home and NB_VERSION is the version of NetBeans (e.g. 7.0).
I tried running AgentRansack on that directory, but to no avail.
I recently had to solve this problem and figured it out. Netbeans stores local history files in your user directory as mentioned above. Inside that folder are numbered directories. It's pretty easy to guess which one you need based on the modification date of the folder (if you know when you last looked at it, so that doesn't help you much). In side the numbered folders is another folder with a hashed name, and inside of that folder is a set of files: a data file, and numbered files. The data file can be read with a binary file reader, and if viewed in ascii mode will show the filename that this history belongs to. The numbered files are actually zip files and they have full versions of the file in them. Just unzip those and open with a text editor if they are plain text files.
Hope this helps you out, but I realize its probably too late now. I had to figure this out because I had opened a remote file with netbeans (a file that was not associated with a project), and couldn't get back into the Local History because the file didn't have a project. However I could see it in the Local history by reading the data file, and I just guessed that the other files were zipped by the fact that they started with "PK" in the binary viewer. Once I put it all together I was home free.