1. Install the vscode path-alias
plugin
Open vscode editor -> Ctrl+Shift+X
open 扩展:商场
-> search path-alias
-> install
2. Custom path alias configuration
Open vscode editor -> Ctrl+Shift+P
open 命令面板
-> search settings.json
-> select Preferences: Open User Settings(JSON)
-> add the following configuration
"pathAlias.aliasMap": {
"@": "${cwd}/src"
}
which can be used ${cwd}
instead of the absolute path of the current working directory. For example, if I want to use the directory @
representing my working directory src
, then I only use it in the configuration "@": "${cwd}/src"
.
3. File jump of path alias
After the configuration is complete, use Ctrl+鼠标左键
it to realize the file jump of the path alias.