Visual Studio Code: shortcut to open a certain file
You can try the extension HTML Related Links v0.15.1 and the command htmlRelatedLinks.openFile
to open a local file. Specify the full path.
At first I did not had this extension installed in the remote computer. VSC complained that the command htmlRelatedLinks.openFile
did not exist. That means that the VSC remote window uses the local key binding file but executes the commands on the remote machine. This means you have different key bindings if you are at the physical keyboard of the remote machine compared to a remote connection. The same goes if you have set your XDISPLAY (??) environment variable (for Linux systems, remote display)
You tried it with v0.14 (see comment) and found out that VSC uses the scheme vscode-remote
(not documented).
I modified the extension so we can set the scheme of the URI.
Using scheme file
did not work. In local VSC all local file URIs have this scheme.
But if we use the scheme vscode-local
(that you have found somewhere) I was able to open a file from the local disk in the remote VSC instance with a key-binding.
{
"key": "ctrl+i n", // or any other combo
"command": "htmlRelatedLinks.openFile",
"args": {
"file": "C:\\Projects\\Notes\\notes.txt",
"method": "vscode.open",
"viewColumn": "split",
"useScheme": "vscode-local"
}
}