This extension enables the user to open a file under the current cursor position. Just right-click on a pathname within a open document and select the
open file under cursor option (or just press
Alt + P without right-click).
If the file is found by vscode then it will open a new tab with this file.
If the string is has an tailing number separated by a colon (i.e.
:23) it will open the file at the specified line number.
:23:45 means line 23 column 45.
It is also possible to select one or more text segments in the document and open them.
You have a document, containing some text, that exists in a folder, say
In that file the path strings could look like as follows:
[...] c:\Users\guest\Documents\Temp\stuff.txt [...] "..\..\administrator\readme.txt" [...] "..\user\readme.txt:33" [...]
With this extension you can right-click on such a path and choose
open file under cursor and VSCode will open a new tab with that file.
- support file string selection(s), or, no selection and auto detect path outside quotes or within quotes
- support opening multiple files at a time. (Either a multi-lined selection or multiple selections.)
- path lookup from multiple locations to find nearest match: absolute, current document's folder, workspace, workspace's
src, defined search paths, etc.
- line and column positioning with
- possible to open like
someClass. (Use case insensitive file system to support the different in letter case.)
/path/to/sthto be lookup as both absolute and relative path. Useful for code like
projectFolder + '/path/to/sth'.
- support opening single or multiple files from Linux
grepoutput with line number, which has the line pattern
file:line[:column]:content(content is discarded).
- fallback to VS Code's "Quick Open" input box if file not found. (For handy custom search, or find containing files if the path is a folder in the workspace.)
- include a simple "Open file like this file" command to call Quick Open with current file's relative path (without file extension), for lookup files like it.
Path Lookup Detail
Relative paths are relative to the these folders (in listed order):
Currently opened document's folder, and
(if it is within a workspace folder) the document's parent folders (up to the workspace folder).
All workspace folders, and their sub-folders listed in the option
All search paths in the option
- Absolute paths
\), if not found, are searched like relative paths too.
~/...paths not found from user's home, the step 2 of "Relative paths" is searched if option