You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

VSCode中smart select grow不遵循单词分隔符及驼峰忽略问题问询

VSCode 智能选择(smartSelect.grow)自定义配置方案

1. 让命令遵循editor.wordSeparators,直接选中完整的items-center

默认情况下,VSCode的editor.action.smartSelect.grow会把连字符-分隔的部分当作子单词,光标在items-ce|nter时会优先选中center。要改成直接选中整个items-center,只需调整以下配置:

  • 打开设置面板(快捷键Ctrl+,/Cmd+,),搜索editor.smartSelect.selectSubwords,将其设置为false。关闭该选项后,智能选择会遵循editor.wordSeparators的定义(默认包含-),把items-center视为完整单词,执行grow时直接选中[items-center]。
  • 确认editor.wordSeparators中包含-(默认已配置,无需额外修改)。

2. 让智能选择拆分驼峰命名,选中后半段而非整体

如果希望光标在camelCa|se时,第一次grow选中Case而非整个camelCase,需要调整如下:

  • 在设置中找到editor.smartSelect.selectSubwords,将其设置为true。开启该选项后,VSCode会识别驼峰命名的边界,把大写字母开头的片段当作子单词,执行grow时就会选中camel[Case]。

注意:上述两个配置互斥——selectSubwords设为false时,连字符和驼峰都会被视为完整单词;设为true时,两者都会被拆分为子单词。若要同时满足两种需求,VSCode原生配置无法实现,需借助第三方扩展自定义逻辑。

内容的提问来源于stack exchange,提问作者qlyde

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.23 21:47:28