https://github.com/ranyitz/vscode-search-presets
Create custom search presets for vscode
https://github.com/ranyitz/vscode-search-presets
presets search vscode vscode-extension
Last synced: 7 months ago
JSON representation
Create custom search presets for vscode
- Host: GitHub
- URL: https://github.com/ranyitz/vscode-search-presets
- Owner: ranyitz
- License: mit
- Created: 2022-09-16T00:04:51.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-25T19:47:00.000Z (11 months ago)
- Last Synced: 2025-03-17T14:52:56.851Z (7 months ago)
- Topics: presets, search, vscode, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=ranyitz.search-presets
- Size: 463 KB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
# VSCode Search Presets
> vscode extension to configure search presets
Sometimes you want to search through a specific set of files, you can use vscode's search include/exclude configurations to filter the results.
There are some common workflows that are repeated throughout your day, like searching only test files, only source files, only `package.json` files, etc.
This extension lets you configure presets which configure your search by typing a single command.
## Installation
[Click Here](https://marketplace.visualstudio.com/items?itemName=ranyitz.search-presets)
## How to use it?
Use the command palette and type `Search Presets` Or use one of the shortcuts:
- Windows: `Shift + Alt + F`
- Mac: `Shift + Alt + F`## How does it know what query to take?
It will resolve the query in the following order
- A query which is configured for the preset.
- Highlighted text in VSCode.
- Clipboard text
- Empty query> Unfortunatly at the moment, [there is no API for reading the current query in the search widget](https://github.com/microsoft/vscode/issues/152301#issuecomment-1250070003)
## Extension Settings
#### filesToInclude
Files to include in the search
#### filesToExclude
Files to exclude from the search
#### isCaseSensitive
Match Case (Aa)
#### matchWholeWord
Match Whole Word (_ab_)
#### isRegex
Use Regular Expressions (.\*)
#### triggerSearch
Trigger search after selecting a preset
#### query
Enforce a specific search query
### Custom Preset Configuration
> null means that the preset will not override the existing search configuration
```
"search-presets.custom": {
[PresetName]": {
"filesToInclude": string | null,
"filesToExclude": string | null,
"isCaseSensitive": boolean | null,
"matchWholeWord": boolean | null,
"isRegex": boolean | null,
"triggerSearch": boolean | null,
"query": string | null
}
}
```### Global Configurations
> Apply as defaults for all preset configurations
```
"search-presets.isCaseSensitive": boolean | null,
"search-presets.matchWholeWord": boolean | null,
"search-presets.isRegex": boolean | null,
"search-presets.triggerSearch": boolean | null
```## Default presets
> If you don't configure anything, this are the presets you'll get
```json
"search-presets.custom": {
"Tests": {
"filesToInclude": ".test.*, .spec.*, .e2e.*, .driver.*"
},
"Source Files": {
"filesToExclude": "*.test.js, *.driver.*, *.json"
},
"package.json": {
"filesToInclude": "package.json"
}
}
```