Skip to content

Instantly share code, notes, and snippets.

@twiceyuan
Created November 2, 2018 02:22
Show Gist options
  • Save twiceyuan/f10c3271df6505a4255d70771d150798 to your computer and use it in GitHub Desktop.
Save twiceyuan/f10c3271df6505a4255d70771d150798 to your computer and use it in GitHub Desktop.
[iTerm 命令前或者命令后加字符快捷键] #macOS
  1. 在 Keys 里添加快捷键,选择 Send Hex Code
  2. 0x1 为跳转到目前输入命令的最前面,0x5 跳转到目前输入命令的最后
  3. 输入的命令可以用 xxd 获取。比如获取 sudo 的 hex code 可以用 echo -n 'sudo ' | xxd
 ~ echo -n 'sudo ' | xxd
00000000: 7375 646f 20                             sudo

这样最终的 hex code 就是 0x1(跳转最前) 0x73 0x75 0x64 0x6f 0x20('sudo '的 hex code) 0x5(跳转最后)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment