VS Code - Search for text in all files in a directory

后端 未结 15 1024
深忆病人
深忆病人 2020-12-12 09:32

Is there a way to search for text in all files in a directory using VS Code?

I.e., if I type \"find this\" in my search, it will search through all the files in the

相关标签:
15条回答
  • 2020-12-12 10:01

    This action is not bound to a key by default, to bind it do this:

    1. File > Preferences > Keyboard Shortcuts (Ctrl+K, Ctrl+S)
    2. Search for "find folder"
    3. Press the + icon on the left of "filesExplorer.findInFolder" search result
    4. Enter your desired key combination
    0 讨论(0)
  • 2020-12-12 10:02

    Press Ctrl + Shift + F

    click on 3 dots under search box.

    type your query in search box

    type ./FOLDERNAME in files to include box and click Enter

    Alternative way to this is, Right click on folder and select Find in Folder

    0 讨论(0)
  • 2020-12-12 10:02

    Search across files - Press Ctrl+Shift+F

    Find - Press Ctrl+F

    Find and Replace - Ctrl+H

    For basic editing options follow this link - https://code.visualstudio.com/docs/editor/codebasics

    Note : For mac the Ctrl represents the command button

    0 讨论(0)
  • 2020-12-12 10:05

    And by the way for you fellow googlers for selecting multiple folders in the search input you separate your directories with a comma. Works both for exclude and include

    Example: ./src/public/,src/components/

    0 讨论(0)
  • 2020-12-12 10:05
    1. Enter Search Keyword in search (CTRL + SHIFT + F)

    2. Exclude unwanted folder's/files by using exclude option (!)

      ex: !Folder/File*

    3. Hit Enter

    Search results gives you desired result

    0 讨论(0)
  • 2020-12-12 10:14

    In VS Code...

    1. Go to Explorer (Ctrl + Shift + E)
    2. Right click on your favorite folder
    3. Select "Find in folder"

    The search query will be prefilled with the path under "files to include".

    0 讨论(0)
提交回复
热议问题