iterm2:如何select表情符号,或自动文本替换,或使用macOS "Symbol and text substitution"?

iterm2: How to select emoji, or do automatic text replacement, or use macOS "Symbol and text substitution"?

我希望能够轻松地将表情符号插入 iTerm2 终端(在 vim 中)。以下任一解决方案都不错:

  1. 在 iTerm2 或 vim 中有一个快速访问表情符号选择器(例如,喜欢 Slack 和 Discord :smile: 来获取)
  2. 使用 macOS 内置 "Symbol and text substitution" text replacements(系统偏好设置 > 键盘 > 文本 >(替换 | 为))。 (这些替换不会在 iTerm2 中发生)

以下确实有效,但比上面所需的解决方案慢/不太可取:
一种。打开 macOS Character Viewer (Ctrl + Cmd + Space)
b. Selectemoji
C。双击表情符号将其插入

iTerm2 版本:3.4.0beta10
macOS 版本:macOS Mojave 10.14.6

参考:https://gitlab.com/gnachman/iterm2/-/issues/5386

片段:iTerm2 具有 Snippets 功能,您可以将每个表情符号添加为单独的片段,然后 select 将片段粘贴:

到add/edit个片段:

Preferences > Shortcuts > Snippets

要查看工具带中的代码段:

(Menu bar) > Toolbelt > Snippets

打开工具带:

(Menu bar) > Toolbelt > Show Toolbelt
(keyboard shortcut: shift + cmd + B)

使工具带总是在新的windows中打开:

Preferences > Profiles > Window Settings for New Windows > Open toolbelt

如果使用 vim,请考虑为表情符号创建 vim 缩写。例如,给定以下 vim 缩写,在 vim 插入模式下键入 _smile 后,vim 将用 [=39 替换 <code>_smile =]:

:iabbrev _smile
:help abbreviations