How to navigate with VS code explorer

别来无恙 提交于 2019-12-11 22:59:28

问题


This is a question about the VS code explorer window navigation.

In the Windows Explorer application, I can instantly navigate down to any file that I choose. If the windows explorer window shows my folders or files in ascending name sequence, I can quickly select any of the entries below by typing the first letter of the file/folder that I'm looking for. For instance, if I type in "C", the selection instantly goes down to the first file/folder that begins with C. This has been the default Windows navigation for as far back as I can remember. So am I able to do this in the VS code explorer? My projects are rather long and having to scroll down to say the 50th(or 100th) file is kind of a pain. So is this feature or something like it available in VS code? The explorer window shows the file/folders in ascending sequence so this should be possible. If this is not a feature in VS code, what is the recommended way to navigate throughout the VS code explorer?


回答1:


See keyboard navigation in the explorer:

There are now three different types of keyboard navigation in trees: simple, highlight, and filter. In both highlight and filter, typing in a tree will display a widget (control) at the top of the tree, which indicates that you are now navigating the tree:

[see the demo at the link above.] So you can filter or highlight matching folders or files if you type which the explorer has focus.

Try this setting:

"workbench.list.keyboardNavigation": "filter" 
     // see other options under this setting: highlight and simple

and explorer will filter out all non-matching folders/files. I wish it would automatically open those folders with matching files within but it doesn't. The folder is highlighted or passes the filter but it doesn't open.

In this demo (using the filter setting), first I pressed Ctrl-Shift-E to get Explorer focus (or you could just click anywhere in the explorer) and started typing.

Escape will clear the search and return the full explorer tree.



来源:https://stackoverflow.com/questions/56508281/how-to-navigate-with-vs-code-explorer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!