When I try to open file or folder in VsCode, Windows file dialog doesn't open. Instead, a box appears in the top-middle of VsCode to open file/folder.
How can I use Windows file dialog again?
Windows file dialog is default to open file/folder. But somehow I changed it to simple one. If you want to use "Simple Dialog" you should add the following lines to settings.json:
"files.simpleDialog.enable": true
To get back Windows file dialog, remove that line or change true to false.
Related
There are some guides in stackoverflow for opening multiple windows in Visual Studio. But it is inside the Visual Studio they are talking about.
Here is what I want. There is one txt file called A.txt in my desktop, I right click it and the context option shows Open With Code, and I open it. There is another txt file called B.txt in my desktop. While I right clit it and open it with visual studio code, both the two files are in the same window.
Is there any setting that the two files can be opened in two windows?
Not sure why you want that but actually there is a setting which behaves like you want when turned to "On":
Window: Open Files In New Window Controls whether files should open in
a new window when using a command line or file dialog. Note that there
can still be cases where this setting is ignored (e.g. when using the
--new-window or --reuse-window command line option).
You can find it via: User -> Window -> New Window
You can quickly open the settings dialog by pressing CTRL + ,
I was so used to the way of opening a file in Emacs, by just C-x C-f and typing and tab-completing, without needing to use a mouse. In VS Code, I have to go through a "open file" system dialogue using a mouse to find my file. But when opening a file in SSH server, VS Code offers a built-in dialogue to find your file, by just typing and auto-complete. Is there a way to use the "open SSH file" dialogue to open local files, or a similar way by just typing and tab complete?
Add the following setting in your JSON config:
"files.simpleDialog.enable": true
This does not open the native file browser for local files. Instead, you can search for them in the same manner as you would do for remote files:
Contrary to changing the terminal to the present working directory in VSCode, I'm looking for a way to get the present working directory in the focused integrated terminal and then highlight it in the Explorer. One way to do this would be using code ., but that opens up a new workbench if you're in a child directory. Is there a native way or an extension that supports doing this? Both command palette and keyboard shortcuts would work.
So far, I can't find any APIs for:
Reading the CWD from the active terminal.
Changing the selected file in Explorer.
A workaround is to use code ./some-file to open it in the active Explorer.
I have small problem with VSCode folder, that opened by default.
Problem description: I start new instance of VSCode (trough File->New Window), and then if I choose File->Open Folder it opens dialog with my Windows user folder as starting point (C:\Users\MyUser)
Question: How can I change that folder in settings (if it possible)? So by default it will show as start point for example D:\development\ ?
At the time I write this answer, this is not possible. There are two problems on Windows, and one problem on Mac and Linux:
VS Code does not provide a default path to the file dialog 1. It does remember the last folder that you opened a file in, but that path cannot be used as a default because it is overwritten constantly.
On Windows only, Electron ignores the default path when creating a file dialog if the default path is a directory 2.
An extension also cannot solve this, because extensions are not allowed to modify the File menu 3.
I think the best option at this point is to pin a folder to the Quick Access area in Windows Explorer, as suggested in a comment, or to put an actual shortcut in the user profile folder.
Workspaces and File > Open Recent may also be helpful if you often open the same folders.
Your main problem is that you are unable to open your specific folder in VScode.
To solve that you can simply open the terminal/cmd in that specific window by just typing cmd in your search bar or just by pressing shift+right-click in that folder.
Now your cmd is open and you just have to type "code ." in the cmd and press enter to open the current folder in your VSCode.
In case that code . doesn't work for you then you have to add the Vscode in the environment variables of your windows.
Visual Studio doesn't provide a specific feature to open a specific path. But there is a solution to your problem. You are saying that you want D:\develpment as a default when you open VS Code. You can go to that specific directory or create shortcut to desktop then click right click on that folder and then click on open with code. If you didnot see open with code then reinstall your VS code and check on open with code when you are reinstalling VS Code.
make a shortcut on the desktop for vscode and then modify it and add the folder after the .exe command. This will default open that folder when you double click on it.
Visual Studio Code can be installed in two ways - User setup and System setup. I strongly believe you have User setup installed in your PC. Try re-installing it System-wide. That should probably fix your problem.
For more information: https://code.visualstudio.com/docs/setup/windows#_user-setup-versus-system-setup
PS: A lot more information is needed, you can share a screenshot of the window and elaborate more on it.
I'm trying to set up VS Code such that when the program is just opened (not via the context menu for a file or clicking on a file) a new blank text file is open and ready to start typing in - similar to when Notepad++ is opened - or most other text editors, for that matter.
Searching for "VS Code open with new file" and many variants only brings me to articles/posts about opening a new file in a new tab or window. That's not what I'm trying to do.
File > Preferences > Settings
Search for startupEditor
Change
"workbench.startupEditor": "welcomePage"
to
"workbench.startupEditor": "newUntitledFile"
or select newUntitledFile from dropdown
In File > Preferences > Settings there is the following option listed under the Window section:
// Controls how windows are being reopened after a restart. Select 'none' to always start with an empty workspace, 'one' to reopen the last window you worked on, 'folders' to reopen all windows that had folders opened or 'all' to reopen all windows of your last session.
"window.restoreWindows": "none",
Using the editor in the right pane you can add:
"window.restoreWindows": "none"
Which will open an empty workspace with a link that says "new file". It's not exactly the solution you're looking for but it's the closest one I'm aware of.
This also stopped working for me. But I created a shortcut on my Taskbar like the following, and it does what I was looking for:
"C:\Users\myname\AppData\Local\Programs\Microsoft VS Code\Code.exe" C:\Users\myname\Downloads\Untitled