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

Sublime 4/Vintage模式:仅在编辑模式下启用按键按住重复功能

Mac下Sublime Vim模式兼容按键重复与重音字符的解决方案

方案1:仅Sublime全局支持按键按住重复

  • 打开终端,执行命令:
    defaults write com.sublimetext.ApplePressAndHoldEnabled -bool false
    
  • 重启Sublime Text后,在Sublime内按住任意键都会触发重复(包括Vim模式的h/j/k/l快速移动),其他Mac应用仍可正常按住键调出重音字符。

方案2:仅对h/j/k/l启用按住重复

通过自定义Sublime Vintage(Vim模式)的键绑定实现:

  1. 打开Preferences > Settings,添加以下配置:
    "vintage_use_ctrl_keys": true,
    "vintage_start_in_command_mode": true
    
  2. 打开Preferences > Key Bindings,添加以下键绑定规则:
    [
        {
            "keys": ["h"],
            "command": "move",
            "args": {"by": "characters", "forward": false},
            "context": [{"key": "setting.command_mode"}]
        },
        {
            "keys": ["j"],
            "command": "move",
            "args": {"by": "lines", "forward": true},
            "context": [{"key": "setting.command_mode"}]
        },
        {
            "keys": ["k"],
            "command": "move",
            "args": {"by": "lines", "forward": false},
            "context": [{"key": "setting.command_mode"}]
        },
        {
            "keys": ["l"],
            "command": "move",
            "args": {"by": "characters", "forward": true},
            "context": [{"key": "setting.command_mode"}]
        }
    ]
    
  3. 终端执行以下命令并重启Sublime:
    defaults write com.sublimetext.ApplePressAndHoldEnabled -bool false
    
    完成后,仅Vim命令模式下的h/j/k/l按住会触发重复移动,其他按键在编辑模式下仍可正常调出重音字符。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.05 11:05:21