VSCode Switch Off Editor History - visual-studio-code

How to make VSCode to use only current project files when using dialog for quick file open by name or we always have to clean editor history so recent files won't be showing there?

This setting:
Search > Quick Open: Include History
Whether to include results from recently opened files in the file
results for Quick Open.
Uncheck it to set it to false.

Related

How to disable VSCode from remembering opened editors in the folder I opened before?

After I use VSCode to open a folder and some editors for the files, I close the folder. When I close and reopen the folder, VSCode opens the editors I opened last time.
How to prevent VSCode from reopening the editors I opened last time?
I have already set "window.restoreWindows": "none". When I exit directly from VSCode, it won't restore windows. I am saying when I reopen a folder, the editors I opened last time before I close the folder, will still be opened.
To stop Visual Studio Code from opening your previous folder all the time, then you have to edit settings.json.
To achieve this, open the settings.json. Do this by following the steps below.
Open the Command Palette by pressing F1.
Type, "Open settings".
When you see the options, select Open Settings (JSON).
After that, add the following option.
{
"window.restoreWindows": "none"
}
This should prevent Visual Studio Code from opening the previous folder when launching the application.
I just open vscode from my terminal, it's way faster and efficient in my opinion.
Just browse to your wished folder and write "code ." in your terminal.
Follow this process
Open VS Code, goto file>preferences>settings.
search for restore Window or click on Window tab then find restore window .select none from selection.
https://i.stack.imgur.com/FLx4a.png
https://i.stack.imgur.com/TAuHT.png
https://i.stack.imgur.com/B8W5a.png

VSCode: files not in project open in a separate window

When I double click a file to open it from the finder, it opens in the currently open/focused project/window. IMO, this is a bad default.
I need files to open in the current window ONLY if they are in the project of that window.
Can this be set? Where do I set it?
There is a way to do it. You can add this line to your project's or global settings file.
"window.openFilesInNewWindow": "on",
Note
If you are using the cli tool there is also an easy way to do it:
code yourfile --new-window

How to reopen last opened file in vscode

If i close the vscode editor after saving a file and reopen the editor again, the session is not restored. I am unable to find the file in open recent. The only way how can I open the file is navigating to the directory in open menu. Thats very annoying is it some problem with my editor or default behaviour?
You must have a folder opened to restore previously opened files.
Go to 'File' menu
Open folder
Select a folder (my documents for example)
Now open any files, close vscode and re-open. Your files are still in the editor.
"window.restoreWindows": "all" will do ;)
The complete settings are
"window.restoreWindows": "all",
"files.hotExit":"onExitAndWindowClose",
Note that with:
VSCode 1.42 (Jan. 2020) it does work even in case of "hot exit" (unexpected exits): see "Visual Studio Code never reopens previous file or folder".
VSCode 1.51 (Oct. 2020), that will also restore a search tab if you had one (issue 102659 resolved by issue 99694, and commit 8bf0e20)

Visual studio code, exclude directory from "go to file" option (ctrl + p)

I am using vscode, and I would like to exclude some directories (with webpack bundles) from 'go to file' option in vscode.
I tried to exclude them by "search.exclude" and "files.exclude". That worked in files tree and in search, but I still can find these files by 'go to file'.
Do you know how to do this?
As #adamesque stated, to exclude files from quick open you can either add them to files.exclude or search.exclude setting.
The issue then is that Quick Open also stores recent items, even from excluded paths.
Fortunately, VSCode now have a command File: Clear Recently Opened!
EDIT: As I needed to replace a Disk path while keeping my recent files I found where they are stored. It's in the storage.json file which is under /Users/imac/Library/Application Support/Code/storage.json on macOS and AppData\Roaming\Code\storage.json on Windows.
I thought I had this exact problem, and all the relevant issues I could find in the VS Code GitHub project seemed to have been fixed (see https://github.com/Microsoft/vscode/issues/19029, https://github.com/Microsoft/vscode/issues/6502).
In my case, because I had previously opened some of the files in those excluded directories, they still showed up in "Go To File" in the "Recently Opened" section, which made me think the exclusion feature wasn't working.
Turns out I just had to manually remove those items from history to keep them from showing up. Open the Command Palette, run Remove from History, and then select the a file to remove. You may need to do this for each file you'd previously opened from an "excluded" dir, but after this is done, they shouldn't show up anymore in the "Go to File" menu.
Hope this helps!
Version 1.44:
now we have an option in the settings.
If you tipe "Goto file" in the setting search bar, the editor opens up a Search:Exclude section, and you can add a folder or files.
CTRL + SHIFT + P, then select File: Clear Recently Opened

Editing files with netbeans without setting up project

Is there a way to use netbeans as a simple text editor, without setting up a project?
I am interested in using netbeans features as a text editor, especially for making quick changes on remote servers.
Yes, of course you can use it as a text editor. Just Open Netbeans and select File > Open File and select the file to open from the file chooser dialog. Make changes and click Save.
If you want to edit files on network locations, again do File > Open File and paste the location of your remote file.