一劳永逸!用 鼠须管 彻底解决 macOS 输入卡顿问题 🎯

4,219 阅读9分钟

macOS 用户在使用 中文输入法 时,常遭遇应用切换和输入的卡顿问题。

🍎 macOS 中文输入法卡顿问题

中文输入法卡顿问题

🌀 卡顿现象

长时间使用或多应用运行时,Mac 中文输入法应用切换缓慢、输入响应延迟。

🧩 卡顿原因

可能由系统设置、硬件限制或第三方应用冲突导致。

🛠️ 解决方案

  1. 终端命令:执行 kill -9 $(pgrep SCIM) 杀死“简体中文输入方式”进程,暂时解决卡顿。
  2. 工具使用:尝试 SCIMKiller 工具杀死输入法进程。
  3. 第三方输入法:考虑使用如 Rime 或搜狗、微信键盘等第三方输入法。

🚀 使用第三方输入法彻底解决 macOS 输入卡顿问题

如果你使用 Homebrew ,那么阅读命令行安装部分内容。

🖊️ 鼠须管+雾凇拼音+微信键盘皮肤

通过安装和配置鼠须管与 Input-Source-Pro,你可以彻底解决这个烦恼。

鼠须管是一款macOS 下的开源输入法,支持拼音、注音、仓颉、五笔等输入方案,它底层是RIME/中州韵输入法引擎,被誉为神级输入法。

rime

雾凇拼音是一个长期维护的简体词库。

rime-ice

微信键盘是微信官方出品的一款中文输入法。

WeType

🐭 安装鼠须管+雾凇拼音+微信键盘皮肤

brew install --cask squirrel
cd $HOME/Library
mv Rime Rime.old
git clone --depth=1 https://github.com/iDvel/rime-ice.git Rime
curl -o ~/Library/Rime/default.custom.yaml https://gist.githubusercontent.com/lewangdev/f8ebbba24f464e915fb7d36857fcbbe5/raw/4f4c0483a8fc8192208b044d2db91d8589758539/default.custom.yaml
curl -o ~/Library/Rime/squirrel.custom.yaml https://gist.githubusercontent.com/lewangdev/f8ebbba24f464e915fb7d36857fcbbe5/raw/4f4c0483a8fc8192208b044d2db91d8589758539/squirrel.custom.yaml

若不熟悉命令行操作,可选择手动安装:

  1. 手动下载并安装 鼠须管 0.16.2
  2. 打开 Finder,然后按 Shift+Command+G,输入 $HOME/Library,点击 Go
  3. 如果存在 Rime 文件夹, 重命名为 Rime.old
  4. 手动下载 rime-ice,解压缩并将文件夹重命名为 Rime,然后将其移动到 $HOME/Library
  5. 此链接 下载 default.custom.yaml 文件,将其移动到 $HOME/Library/Rime
  6. 此链接 下载 squirrel.custom.yaml 文件,将其移动到 $HOME/Library/Rime

输入法最终效果:

输入法最终效果

⌨️ Input Source Pro

Input Source Pro 是一款macOS 上的输入法辅助工具,它可以根据不同应用、不同网站来自动切换输入法,并可以在鼠标周围显示当前输入法状态。

Input-Source-Pro

🎉 安装 Input-Source-Pro

brew install input-source-pro

若不熟悉命令行操作,可选择手动安装:

下载 dmg 安装包 手动安装。

自动展示当前输入法

自动展示当前输入法

长按鼠标左键、切换输入法以及在切换 App 时,展示当前正在使用的输入法类型。

根据应用切换输入法

根据应用切换输入法

为不同 App 设定默认的输入法类型,在每次使用时不再浪费时间手动切换。当然啦,在使用 Spotlight 这类应用时也能自动切换。

根据网站切换输入法

根据网站切换输入法

通过自定义规则,能够根据浏览器当前页面自动切换输入法。目前已支持 Safari、Chrome、Edge、Firefox、Brave、Vivaldi 以及 Arc 浏览器。

📚 额外讨论

macOS 在使用 中文输入法 时,会在切换应用和在应用中输入时显著延迟。这个问题在打开任何应用几小时后会出现。当切换到 ABC 输入源或重新打开应用时,延迟暂时消失,但几小时后又会重现。重启 mac 或关闭 BetterDummy 并重启 mac 后,延迟问题会暂时解决,但再过几小时延迟又会重现[1][2]。更多了解可以查看Rime 鼠须管 配置雾凇拼音自定义配置,MacOS-like & Wechat-like Dark/Light Color Scheme For Rime

附上前文的两个配置文件:

# default.custom.yaml

patch:
  # 菜单
  menu:
    page_size: 8  # 候选词个数
    # alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨, ⑩ ]  # 修改候选项标签
    # alternative_select_keys: ASDFGHJKL  # 如编码字符占用数字键,则需另设选字键
    # ascii_mode、inline、no_inline、vim_mode 等等设定,可参考 /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml
  # 中西文切换
  #
  # 【good_old_caps_lock】 CapsLock 切换到大写或切换中英。
  # (macOS 偏好设置的优先级更高,如果勾选【使用大写锁定键切换“ABC”输入法】则始终会切换输入法)
  #
  # 切换中英:
  # 不同的选项表示:打字打到一半时按下了 CapsLock、Shift、Control 后: 
  # commit_code  上屏原始的编码,然后切换到英文
  # commit_text  上屏拼出的词句,然后切换到英文
  # clear        清除未上屏内容,然后切换到英文
  # inline_ascii 无输入时,切换中英;有输入时,切换到临时英文模式,按回车上屏后回到中文状态
  # noop         屏蔽快捷键,不切换中英,但不要屏蔽 CapsLock
  ascii_composer:
    good_old_caps_lock: true  # true | false
    switch_key:
      Caps_Lock: clear  # commit_code | commit_text | clear
      Shift_L: clear     # commit_code | commit_text | inline_ascii | clear | noop
      Shift_R: clear     # commit_code | commit_text | inline_ascii | clear | noop
      Control_L: noop   # commit_code | commit_text | inline_ascii | clear | noop
      Control_R: noop   # commit_code | commit_text | inline_ascii | clear | noop
# squirrel.custom.yaml

patch:
  # ascii_mode、inline、no_inline、vim_mode 等等设定,可参考 /Library/Input Methods/Squirrel.app/Contents/SharedSupport/squirrel.yaml
  app_options:
    #com.raycast.macos:
    #  ascii_mode: true   # 初始爲西文模式
    #com.microsoft.VSCode:
    #  ascii_mode: true   # 初始爲西文模式
    #  vim_mode: true
    #md.obsidian:
    #  ascii_mode: true   # 初始爲西文模式
    #  vim_mode: true
    #org.alacritty:
    #  ascii_mode: true   # 初始爲西文模式
    #com.jetbrains.intellij:
    #  ascii_mode: true
    #  vim_mode: true
  
  style:
    # 选择皮肤,亮色与暗色主题
    #color_scheme: purity_of_form_custom
    #color_scheme_dark: purity_of_form_custom
    #color_scheme: macos_light
    #color_scheme_dark: macos_dark
    color_scheme: wechat_light
    color_scheme_dark: wechat_dark
  
    # 预设选项:(可被皮肤覆盖;如果皮肤没写,则默认使用这些属性。)
    text_orientation: horizontal  # horizontal | vertical
    inline_preedit: true
    corner_radius: 10
    hilited_corner_radius: 0
    border_height: 0
    border_width: 0
    line_spacing: 5
    spacing: 10
    #candidate_format: '%c. %@'
    #base_offset: 6
    font_face: 'Lucida Grande'
    font_point: 21
    #label_font_face: 'Lucida Grande'
    label_font_point: 18
    #comment_font_face: 'Lucida Grande'
    comment_font_point: 18
  
  # 皮肤列表
  preset_color_schemes:
    macos_light:
      name: "MacOS 浅色/MacOS Light"
      author: 小码哥
      font_face: "PingFangSC"          # 字体及大小
      font_point: 16
      label_font_face: "PingFangSC"    # 序号字体及大小
      label_font_point: 12
      comment_font_face: "PingFangSC"  # 注字体及大小
      comment_font_point: 16
      candidate_format: "%c\u2005%@\u2005" # 编号 %c 和候选词 %@ 前后的空间
      candidate_list_layout: linear   # 候选排布:层叠 stacked | 行 linear
      text_orientation: horizontal    # 行文向: 横 horizontal | 纵 vertical
      inline_preedit: true            # 拼音位于: 候选框 false | 行内 true
      translucency: false             # 磨砂: false | true
      mutual_exclusive: false         # 色不叠加: false | true
      border_height: 1                # 外边框 高
      border_width: 1                 # 外边框 宽
      corner_radius: 5                # 外边框 圆角半径
      hilited_corner_radius: 5       # 选中框 圆角半径
      surrounding_extra_expansion: 0 # 候选项背景相对大小?
      shadow_size: 0                 # 阴影大小
      line_spacing: 5                # 行间距
      base_offset: 0                 # 字基高
      alpha: 1                       # 透明度,0~1
      spacing: 10                    # 拼音与候选项之间的距离 (inline_preedit: false)
      color_space: srgb                       # 色彩空间: srgb | display_p3
      back_color: 0xFFFFFF                    # 底色
      hilited_candidate_back_color: 0xD75A00  # 选中底色
      label_color: 0x999999                   # 序号颜色
      hilited_candidate_label_color: 0xFFFFFF # 选中序号颜色
      candidate_text_color: 0x3c3c3c          # 文字颜色
      hilited_candidate_text_color: 0xFFFFFF  # 选中文字颜色
      comment_text_color: 0x999999            # 注颜色
      hilited_comment_text_color: 0xFFFFFF    # 选中注颜色
      text_color: 0x424242                    # 拼音颜色 (inline_preedit: false)
      hilited_text_color: 0xFFFFFF            # 选中拼音颜色 (inline_preedit: false)
      candidate_back_color: 0xFFFFFF          # 候选项底色
      # preedit_back_color:                   # 拼音底色 (inline_preedit: false)
      hilited_back_color: 0xD75A00            # 选中拼音底色 (inline_preedit: false)
      border_color: 0xFFFFFF                  # 外边框颜色
  
    macos_dark:
      name: "MacOS 深色/MacOS Dark"
      author: 小码哥
      font_face: "PingFangSC"          # 字体及大小
      font_point: 16
      label_font_face: "PingFangSC"    # 序号字体及大小
      label_font_point: 12
      comment_font_face: "PingFangSC"  # 注字体及大小
      comment_font_point: 16
      candidate_format: "%c\u2005%@\u2005" # 编号 %c 和候选词 %@ 前后的空间
      candidate_list_layout: linear   # 候选排布:层叠 stacked | 行 linear
      text_orientation: horizontal    # 行文向: 横 horizontal | 纵 vertical
      inline_preedit: true            # 拼音位于: 候选框 false | 行内 true
      translucency: false             # 磨砂: false | true
      mutual_exclusive: false         # 色不叠加: false | true
      border_height: 1                # 外边框 高
      border_width: 1                 # 外边框 宽
      corner_radius: 5                # 外边框 圆角半径
      hilited_corner_radius: 5       # 选中框 圆角半径
      surrounding_extra_expansion: 0 # 候选项背景相对大小?
      shadow_size: 0                 # 阴影大小
      line_spacing: 5                # 行间距
      base_offset: 0                 # 字基高
      alpha: 1                       # 透明度,0~1
      spacing: 10                    # 拼音与候选项之间的距离 (inline_preedit: false)
      color_space: srgb                       # 色彩空间: srgb | display_p3
      back_color: 0x1f1e2d                  # 底色
      hilited_candidate_back_color: 0xD75A00  # 选中底色
      label_color: 0x999999                   # 序号颜色
      hilited_candidate_label_color: 0xFFFFFF # 选中序号颜色
      candidate_text_color: 0xe9e9ea          # 文字颜色
      hilited_candidate_text_color: 0xFFFFFF  # 选中文字颜色
      comment_text_color: 0x999999            # 注颜色
      hilited_comment_text_color: 0x999999    # 选中注颜色
      text_color: 0x808080                    # 拼音颜色 (inline_preedit: false)
      hilited_text_color: 0xFFFFFF            # 选中拼音颜色 (inline_preedit: false)
      candidate_back_color: 0x1f1e2d          # 候选项底色
      # preedit_back_color:                   # 拼音底色 (inline_preedit: false)
      hilited_back_color: 0xD75A00            # 选中拼音底色 (inline_preedit: false)
      border_color: 0x050505                  # 外边框颜色
  
    wechat_light:
      name: "微信浅色/Wechat Light"
      author: 小码哥
      font_face: "PingFangSC"          # 字体及大小
      font_point: 16
      label_font_face: "PingFangSC"    # 序号字体及大小
      label_font_point: 13
      comment_font_face: "PingFangSC"  # 注字体及大小
      comment_font_point: 16
      candidate_format: "%c\u2005%@\u2005" # 编号 %c 和候选词 %@ 前后的空间
      candidate_list_layout: linear   # 候选排布:层叠 stacked | 行 linear
      text_orientation: horizontal    # 行文向: 横 horizontal | 纵 vertical
      inline_preedit: true            # 拼音位于: 候选框 false | 行内 true
      translucency: false             # 磨砂: false | true
      mutual_exclusive: false         # 色不叠加: false | true
      border_height: 1                # 外边框 高
      border_width: 1                 # 外边框 宽
      corner_radius: 5                # 外边框 圆角半径
      hilited_corner_radius: 5       # 选中框 圆角半径
      surrounding_extra_expansion: 0 # 候选项背景相对大小?
      shadow_size: 0                 # 阴影大小
      line_spacing: 5                # 行间距
      base_offset: 0                 # 字基高
      alpha: 1                       # 透明度,0~1
      spacing: 10                    # 拼音与候选项之间的距离 (inline_preedit: false)
      color_space: srgb                       # 色彩空间: srgb | display_p3
      back_color: 0xFFFFFF                    # 底色
      hilited_candidate_back_color: 0x79af22  # 选中底色
      label_color: 0x999999                   # 序号颜色
      hilited_candidate_label_color: 0xFFFFFF # 选中序号颜色
      candidate_text_color: 0x3c3c3c          # 文字颜色
      hilited_candidate_text_color: 0xFFFFFF  # 选中文字颜色
      comment_text_color: 0x999999            # 注颜色
      hilited_comment_text_color: 0x999999    # 选中注颜色
      text_color: 0x424242                    # 拼音颜色 (inline_preedit: false)
      hilited_text_color: 0x999999            # 选中拼音颜色 (inline_preedit: false)
      candidate_back_color: 0xFFFFFF          # 候选项底色
      # preedit_back_color:                   # 拼音底色 (inline_preedit: false)
      hilited_back_color: 0x79af22            # 选中拼音底色 (inline_preedit: false)
      border_color: 0xFFFFFF                  # 外边框颜色
  
    wechat_dark:
      name: "微信深色/Wechat Dark"
      author: 小码哥
      font_face: "PingFangSC"          # 字体及大小
      font_point: 16
      label_font_face: "PingFangSC"    # 序号字体及大小
      label_font_point: 13
      comment_font_face: "PingFangSC"  # 注字体及大小
      comment_font_point: 16
      candidate_format: "%c\u2005%@\u2005" # 编号 %c 和候选词 %@ 前后的空间
      candidate_list_layout: linear   # 候选排布:层叠 stacked | 行 linear
      text_orientation: horizontal    # 行文向: 横 horizontal | 纵 vertical
      inline_preedit: true            # 拼音位于: 候选框 false | 行内 true
      translucency: false             # 磨砂: false | true
      mutual_exclusive: false         # 色不叠加: false | true
      border_height: 1                # 外边框 高
      border_width: 1                 # 外边框 宽
      corner_radius: 5                # 外边框 圆角半径
      hilited_corner_radius: 5       # 选中框 圆角半径
      surrounding_extra_expansion: 0 # 候选项背景相对大小?
      shadow_size: 0                 # 阴影大小
      line_spacing: 5                # 行间距
      base_offset: 0                 # 字基高
      alpha: 1                       # 透明度,0~1
      spacing: 10                    # 拼音与候选项之间的距离 (inline_preedit: false)
      color_space: srgb                       # 色彩空间: srgb | display_p3
      back_color: 0x151515                    # 底色
      hilited_candidate_back_color: 0x79af22  # 选中底色
      label_color: 0x999999                   # 序号颜色
      hilited_candidate_label_color: 0xFFFFFF # 选中序号颜色
      candidate_text_color: 0xbbbbbb          # 文字颜色
      hilited_candidate_text_color: 0xFFFFFF  # 选中文字颜色
      comment_text_color: 0x999999            # 注颜色
      hilited_comment_text_color: 0xFFFFFF    # 选中注颜色
      text_color: 0xbbbbbb                    # 拼音颜色 (inline_preedit: false)
      hilited_text_color: 0x999999            # 选中拼音颜色 (inline_preedit: false)
      candidate_back_color: 0x151515          # 候选项底色
      # preedit_back_color:                   # 拼音底色 (inline_preedit: false)
      hilited_back_color: 0x79af22            # 选中拼音底色 (inline_preedit: false)
      border_color: 0x292929                  # 外边框颜色

以上步骤帮助你从根本上解决 macOS 的输入卡顿问题,享受流畅的输入体验!