Skip to content

SearchEditor: Open new editor with args #95582

@wansa9

Description

@wansa9

I'd like to define a keybinding to open a new search editor with args like workbench.action.findInFiles. The following is what I want to define:

    {
        "key": "ctrl+shift+g",
        "command": "search.action.openNewEditor",
        "args": {
            "query": "${selectedText}",
            "filesToInclude": "${relativeFileDirname}"
        },
        "when": "editorTextFocus"
    }

Context: I work on a project which has a lot of files and directories. "Find in Files" takes a long time so I want to limit search target under a specified directory. #95420 is similar but I want to open search editors for different directories so "search.searchEditor.experimental.reusePriorSearchConfiguration": true doesn't fit my cases.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions