Home > OS >  Is it possible to save file locations in Visual Studio Code to navigate between folders?
Is it possible to save file locations in Visual Studio Code to navigate between folders?

Time:05-11

I have a Visual Studio Code project with lots of files in lots of subfolders. As I am working on my code I need to navigate back and forth through all of these different (sub-)locations which is very tedious. Is there a way to save links to files to quickly access them?

CodePudding user response:

With the extension HTML Related Links you can create a file with relative paths to files and have a Related Links View in the Explorer bar. This View can be locked to the file with the links.

  1. Create a file in the workspace root: filelinks.txt

    file: subdir1/file1.py
    file: subdir1/file2.py
    file: subdir2/file3.json
    file: subdir2/file4.xml
    

    You can add line numbers at the end of the filepath: @123

  2. Add the following setting:

    "html-related-links.include": {
        "plaintext": [
          { "find": "file:\\s ((?!.*?@). ?)" },
          { "find": "file:\\s ((?=.*?@). ?)@(\\d )", "lineNr": "$2" }
        ]
      }
    
  3. When you view the file filelinks.txt, press the lock button in the the Related Links View

  4. When you add or remove files the view is updated.

  • Related