主要是通过宏变量实现自动传递搜索参数的效果, 避免忘记记录一下.
修改 keybindings.json 视情况添加以下内容:
[
{
"key": "ctrl+shift+f",
"command": "workbench.action.findInFiles",
"args": {
"triggerSearch": true,
"query": "${selectedText}",
}
},
{
"key": "ctrl+shift+alt+f",
"command": "search.action.openNewEditor",
"args": {
"filesToInclude": "${fileBasename}",
"showIncludesExcludes": true,
"triggerSearch": true,
"focusResults": true,
"query": "${selectedText}",
"contextLines": 0
}
}
]