Override search keyword default values
Created by: KattMingMing
Request Allow users to set preferred default values for search keywords.
-
Add search.keywordDefaultsto user configuration.search.keywordDefaultslets users override the default keyword values such ascase:notocase:smartcase. -
On search append the query with overwritten operators if the keyword was not present in the query and exists in search.keywordDefaults.
All keywords can be found here: https://docs.sourcegraph.com/user/search/queries
Example
Set default "case" keyword value to "smartcase" instead of "no".
// user settings
...
search.keywordDefaults: {
"case": "smartcase",
}
...
Example queries with overwritten keyword values
-
Search input field:
repo:github.com/gorilla/mux muxOn search:repo:github.com/gorilla/mux mux case:smartcase -
Search input field:
repo:github.com/gorilla/mux case:no muxOn search:repo:github.com/gorilla/mux case:no mux
Related issues: https://github.com/sourcegraph/sourcegraph/issues/2084 and https://github.com/sourcegraph/sourcegraph/issues/1817