How to prevent NetBeans from remembering open files? - netbeans

When I start NetBeans, I don't want it to automatically open the files that were open when I last closed it.
The only way I found to do that is to delete the following files:
del /q "%APPDATA%\Netbeans\7.2.1\config\Windows2Local\Components\MultiView-java*"
Is there a better way, e.g. an option that prevents NetBeans from saving the state of the open files on exit?

I know the question is very old but the issue is still there :) and the solution is the following:
Set/Open the desired starting files, project and then go to menu Window > Reset Windows.
It will remember whatever you had. So if you close all documents and call window reset, you will have no default opened files, which might be great for some of us.

Related

How to prevent VS Code remembering files outside work folder?

My workflow with VS Code is to always use project folders on projects. This works great, but there's one thing that's messing things up right now;
When opening just a single file from another project while working in another project, lets's say webpack.config.js, I use Windows Explorer rightclick to open that file in VS Code. However, this always opens the file in the currently open VS Code instance.
This adds the file from that other folder now to the memory of the previously opened files in the open project while it has nothing to do with that project.
When using the quick file open of VS Code now it happens a lot VS Code opens a file from that other folder, only because that outside file has been opened once while I was working on this project.
This is error prone as now it happens a lot, especially when working fast, that the wrong, for instance, package.json or webpack.config.js file gets opened, because VS Code now also suggests files that are outside this project. That's pretty frustrating and causes changes to be made in the wrong files pretty quickly.
I know we can clear the editor history and have to do it a lot now. But to me that's the other way around, doesn't solve the real problem and when not done often the issue remains.
So I want to get rid of this issue and have the following questions:
1) How can we change the 'Open with Code' rightclick menuitem in Explorer to open files always in a new instance of VS Code?
2) Is there a config settings to disable the behaviour that VS Code remembers files that are outside of the current work folder?
Thanks in advance, this thing is bothering me for quite some time now!
How can we change the 'Open with Code' rightclick menuitem in Explorer to open files always in a new instance of VS Code?
I assume you are a Windows user. You can edit the context menu behavior from Regedit.
Follow the below steps:
Press Windows + R
Type regedit and press OK
Go to Computer\HKEY_CLASSES_ROOT\*\shell\VSCode\command in regedit
Add -n parameter to the command like below
It will help you to open every file in a new window when you use Open with Code.
For your second question, Is there a config settings to disable the behavior that VS Code remembers files that are outside of the current work folder?
Open VS Code settings
Search window.openFilesInNewWindow
Make it off to on like below
With this configuration, you can't open new files in the current workspace therefore technically you prevent VS Code remember outside files. Not directly but it helps.
I don't like how "recently opened" files are shown in VS Code Quick Open (Ctrl+P). I think OP is describing this behavior...
The behavior to remember "recently opened" files causes me problems when I mistakenly open a temporary/copy of my file, i.e.
C:/users/temp/code.js
... instead of the true file (i.e. located inside the currently-open VS Code project)
C:/git/source-control/code.js
...my confusion happens because because both files are listed among the options when I use Quick Open Ctrl+P and type "code"
For me , the Quick Open list also has the answer, any "recently-open" files should have an "X" icon on the right side. You may need to hover your mouse over the file you want to remove.
Click the "X" icon to "Remove from recently open". Quick Open will always be able to find files in your current project, even if you remove them from recently-open:
Please note I don't have access to regedit as suggested in the accepted answer; my answer here does not require regedit

How to prevent VSCode from asking me to save unsaved files?

After I saved a file, VSCode would jump to other files I've edited and asked me to save them as well. I don't want that behaviour as it moves me out of context from the current file I'm editing.
Anyone knows how to stop VSCode from doing that?
I know this is too late, but it might help other people.
Logically, VS code is correct, but another option can help you not get the popup asking to save the unsaved files. Look for the below option in VS code shortcut settings.
File.Save All Files (workbench.action.files.saveFiles)
This will only save previously saved files.
Hope this helps.
The only thing I'm aware of is to kill the vscode process, unfortunately I don't know how to identify the exact window I want to kill, so that usually means killing all vscode processes. They all reload when you open vscode the next time.

VS Code: when I close a sub-folder and return to the file, the sub-folder reopens

I've always developed with Sublime Text, but I feel that VS Code is much better, so I want to get started.
I have a problem please (with Sidebar of VS Code):
When I open a sub-folder in my project, and I open a file that is inside, I like to manually close this sub-folder (because I like to see the architecture of the project, etc.) and to continue working on its files which are already open in my editor.
For example (I work with Laravel): if I open a "User.php" file which is in the "App/Modals" folder, then I manually close the "App/Modals" folder, then I will work in another file, then I come back to work in "User.php", the "App/Modals" folder reopens by itself ...
I do not have this behavior with Sublime Text, nor with PHP Storm.
SVP: Is there a regulation to prevent this behavior?
Thank you.
There's an option to make this feature (it's not something that's just happening to you, it's a feature of VSCode) go away. Go to settings (ctrl + , or cmd + , on mac) and search for "explorer.autoReveal". Make sure it's unchecked, or set it to false in your setting's json.
Just by the way, I don't know if you did, or you didn't know what to search, but you should try to solve this kind of problems by googling for an answer. For instance, I didn't know the answer, but a simple 'disable auto opening folder vs code' in google brought me several results. Just a recommendation, so that you can learn how to solve your own problems and be more efficient.

Keep the emacs BROWSE file up to date while editing

I'm trying to use a source browser for a c++ project without using a big IDE.
My current favorite text editor is emacs.
I found a solution that fit well to my needs which is the ebrowse (not intrusive, can very easily add sources of third part dependancy...).
My problem is that it does not stay up to date while I edit a file already ebrowsed.
eg if I add a method, it will not appear in the tree, and I didn't find a command to update it.
I tried to do a script that execute the ebrowse command line with an (global-auto-revert-mode t) t try to automatically keep the open BROWSE file updated, but it complain about editing externally modificated file.
There is a solution or should I quit to redo the BROWSE file each time then reload it ?
Thanks a lot
PS: I already saw ecb, it is a bit heavy from my point of view, and there is an annoying known bug that force me to trick by an ugly way ecb permission denied bug http://blog.gmane.org/gmane.emacs.code-browser/page=2

missing source files

This is NOT a life or death issue. I do have a backup from 2 or 3 days ago. - I think the answer to this may be "Learn to always save & backup your files every night, before you turn out the lights and go home" but just in case there is a happier answer, here goes.
I was programing some Android/Java stuff in Eclipse. I left the machine on with eclipse open and a couple of source java/xml files open inside of eclipse and gave up for the night. When I sat down at the machine this morning, I had a message that windows had preformed an update, and had re-booted my machine. after re-logging in and opening Eclipse it showed the source files in edit windows and they looked normal, but as soon as I tried to type in the edit window, I got some kind of a message that "Files are derived, do I really want to edit them" (I could be wrong on the exact wording. I didn't copy the text down before hitting no or Cancel or whatever the choice was that I thought would get me out of there without doing anything). after I left that screen, it showed me a now blank edit window for the source files. I closed that and and tried to re-open the file from the Package Explorer, but it wouldn't open. So I closed Eclipse and took a look in the /src directory and it appears the source files are gone. I do have a backup from a couple of days ago, so it's not a life or death problem to go back, but my real questions are.
1- Is this a normal occurrence when a machine boots/power fails/crashes unexpectedly with source files open in Eclipse?
2 - Did I answer the "Files are derived..." question wrong? is there something I could have done at that point to rescue the file?
Any comments welcome. - Joe
If you remember where your files were, you could right click on the parent in the Project Explorer > Restore from History or Replace With > Local History.
This feels like a very basic local VCS.
Even though this is not an endless history, you can extend the size allowed for Eclipse to keep such previous versions.