I have set a default path to look for scripts.
But on a new worksheet Ctrl+o doesn't open the default folder and leads to temp folder location, whereas ctrl+S opens to the default path set at preferences.
Both actions should lead to the same folder right.
Is my understanding correct ?
What should i do to correct this ?
That preference tells sql developer where to look for scripts when you execute them, via
#script.sql
It has no bearing on what folders you see when opening or saving a file.
Now, once you do open a file from that directory, the next time you go to Open/Save a file, you'll see that directory listed on the left for quicker navigation.
Related
I have a problem opening my file from winSCP using Vscode editor. It display deleted even though the file is still existing. I notice that when there is deleted in filename my pc is creating temp folder when I save it and the deleted file will save there and not in the server.
I try to open the file using double click and it display delete but when I try to open it using right click then click open there is no deleted in filename. I also try to delete the temp folder and open again the file the deleted is gone. There is no issue when there is no deleted in filename it save directly in server and not creating temp folder. It's weird I don't know what happen. Please someone could explain me why is this happening.
Go to the Editor Preference Dialog for VS-Code in winSCP and uncheck the line "External editor opens each file in separate window (process)"
I was playing around with my VSCode Settings Sync, and accidentally replaced my settings.json file with another one from a fresh install, as a consequence, I lost my entire settings.json configuration.
Is there a way to recover the lost settings.json file?
I checked my backups, however, it seems that I one cannot go back into the /Users/mf/Library/Application Support/Code/User/Sync folder.
Yes you can get them back.
They are saved on the hard-drive if your settings are set to their default values.
The universal method (works the same for all systems) is to hit the [F1] key, then type the command below into the input, until you see the option. When you do see the option click on it to open the directory.
Settings Sync: Open Backups Folder
The other option you have is to view the data in VSCode using the following VSCode command from your quick input using the [F1] key followed by the same instructions for the command above.
Settings Sync: Show Synced Data
There should be several saved versions of your settings, unless you have changed your configuration for settings sync in the settings menu, or in your user/workspace settings.json file.
Personally I like to just open backup folders and pullout what I need. If you are like me, and you use Ubuntu then the path below is the path used by VSCode to store backed-up keybindings & Settings.json instances. You can pullout what ever you need from that directory.
~/.config/Code/User/settings.json
If you need to restore the backed up files, you can visit this link, it demonstrates how to return to a previous editor configuration:
RESTORE PREVIOUS VS CODE CONFIGURATION:
https://code.visualstudio.com/docs/editor/settings-sync#_restoring-data
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.
In the visual studio code, it has commands to Copy Path and Copy Relative Path (Ctrl+Shift+p->File: Copy Path of Active File). Is there a way I could copy the active file name instead of the whole path?
If there is no way copy the active file name. Is there a way I could write a script or something which creating a new command based on existing Copy Path and showing the new command in the Command Palette?
The extension Copy file name works like a charm!
CTRL+ALT+F gives you filename and CTRL+ALT+E gives the filename.extension.
open your file on vscode> select file as active file> Ctrl+Shift+P > Alt+Shift+C
now you can use Ctrl+V to paste this path any where you want.
step1. first install "copy file name" extension from extensions(ctrl+shift+X) in your vscode.
step2. then use ctrl+alt+e for copying the full file_name with file_extension(like .cpp or .py or .java etc..).
or ctrl+alt+f for for copying the file_name
without file_extension.
It is been a while but I found if you want to write a script using the currently opened file, create a new task in task.json and calling some scripts in the task might be a good option.
Basically, ${file}, ${fileBasename} and ${fileDirname} are the variables that can be used in your script file.
Useful reference:
https://code.visualstudio.com/docs/editor/variables-reference
As an alternative, if you see the active file in the "Explorer" view, you can type F2 once you select it.
With VSCode 1.71 (Aug. 2022), you can type F2 and:
1st press => prefix
2nd press => all
3rd press => suffix
4th press => cycles back around to prefix
This has been release to VSCode insider today, for you to test/play with it.
Without using any extensions, here's a combination of key shortcuts you can use to copy the path of the current file. It's a bit cumbersome but with some practice can be faster than doing the same using the mouse.
Ctrl+Shift+E to open and focus the Explorer pane.
The current file will be selected automatically by default.
F2 to start renaming the file.
This will select the file name without file extension.
(optional) Ctrl+A to include the file extension in the selection.
Ctrl+C to copy.
Escape to abort renaming (or just click anywhere).
no need any extensions, Ctrl+K --> Ctrl+Shift+C, then you will get relative path
Is it possible to have VSCode always have a particular folder ("Directory A") open, so the files inside can be searched using Ctrl + P?
It seems the standard behaviour is that my current "added folder" (i.e. "Directory A") get removed whenever I open a file from a different location ("Directory B").
Closing VSCode and re-opening it always returns me to the last used file (i.e. opening "Directory B" and NOT "Directory A").
How can I force VSCode to always have a certain folder open please?
NB, I've looked into "workspaces" but this doesn't help as whenever opening a file not in the workspace, it seems to close the workspace.
Add Directory A to your workspace using File > Add Folder to Workspace...
Then rather than opening Directory B when you launch VSCode, open the .vscode-workspace file for the workspace that contains both directories.
If there are multiple files in your workspace which match the filename you're searching for using CTRL+P, all the matching files will show up.
The solution, at least on linux, is to create a script with the following content (let's call the script code-standard-path ):
#!/bin/bash
code /path/to/standardDir-or-standardworkspace "$1"
Then from caja right click on a file : open with -> other application.
Then select the command code-standard-path and check Remember this application for "..." files.
Now everytime you double-click on the specific file from whatever location, vscode will open in that predefined directory or workspace.
You can move a bit further and pass the standard path as first argument to the script (e.g. use code "$1" "$2"). So on the open with menu you provide each time the script like this: code-standard-path /path/to/standardDir-or-standardworkspace.
This gives you the ability to open a differrent standard path depending on the file you open (e.g. for .c, .java, .html)
Had the same issue. But there is an easy fix:
On the menu bar go to file File > Preferences > Settings > Window and under Restore Windows select the option preserve.
This will ALWAYS reopen the last session, no matter if you start VS from shell, desktop shortcut or by opening a file.
Open settings File > Preferences > Settings Or by clicking (ctrl + comma)
Type "include" in search bar
Find "Search > Quick Open: Include History"
Uncheck the option