VScode: Is there a way to hide symlink results from Goto file.. (quick file open) in VScode? And search in general?
Asked Answered
S

2

15

When one searches or uses the Goto file (Quick open) command (cmd+P), the search automatically includes everything from symlink folders. This makes the quick open literary useless if there is a significant symlink folder.

Compare with Atom or Sublime, they only display the 'real' files in their quick opens.

image

Is there a way to exclude the symlinks? Or is this a feature request?

PS:

In project search, one can forcefully exclude paths, so I exclude the big symlink folders, but it's manual, not persistent, and it still does not affect ctrl+P.

Spalato answered 15/7, 2019 at 18:2 Comment(0)
H
14

There is a setting that will disable search from following symlinks. Disable:

Search: Follow Symlinks

Hyacinthhyacintha answered 15/3, 2020 at 3:13 Comment(1)
Now, if only we could use files.exclude and search.exclude with symlinks! As it stands you can't exclude symlinks or their subfolders.Schema
R
0

I would love to know if anyone has a better solution to this. I use my terminal to open VSCode so my solution was to use a bash function to open vscode with the realpath of the directory like this:

function vscr() {
    python -c "import os,sys; target=os.path.realpath(os.path.expanduser(sys.argv[1])); os.execv('/usr/local/bin/code', ['', target])" "$1"
}

so effectively vscr <symlink> expands to code <realpath>

Resume answered 21/2, 2020 at 22:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.