Mac如何解决vi vim光标移动慢问题

时间:2024-05-21 17:56:17
作为一个vi党,从Ubuntu切换到mac时一直觉得觉得vim的光标移动速度好慢。经过查询后发现是因为mac键盘做了优化,键盘的按键开始重复键是400毫秒,按键重复时间间隔是300毫秒,就是说一秒钟hjkl移动速度只能移动三下光标,移动速度不慢才怪。由于mac系统设置的键盘重复延迟时间和按键重复时间间隔有限,满足不了需求。百度后发现有个叫Karabiner的神器,专门处理键盘映射,键盘灵敏度的工具,非常实用。
 Karabiner的github地址为
 https://github.com/tekezo/Karabiner


步骤一、生成安装包
 有以下两种方式获得Karabiner.dmg安装包
方法一、直接下载最新版本的稳定源
https://pqrs.org/osx/karabiner/
可以下载最新版本


方法二、下载源码并编译
1. 下载仓库
$ git clone https://github.com/tekezo/Karabiner.git
2. 进入源码目录
$ cd Karabiner
3. 查看tag标志
[email protected]:Karabiner$ git tag
version_10.0.0
version_10.1.0
version_10.10.0
version_10.11.0
version_10.12.0
version_10.13.0
version_10.14.0
version_10.15.0
version_10.16.0
version_10.17.0
version_10.18.0
version_10.19.0
version_10.2.0
version_10.20.0
version_10.21.0
version_10.22.0
4. 切换当前分支到最新分支version_10.22.0
[email protected]:Karabiner$ git checkout version_10.22.0
[email protected]:Karabiner$ git checkout version_10.22.0
5.编译
[email protected]:Karabiner$ make
6. 编译完
ject is not signed at all
Applications/Karabiner.app/Contents/Applications/Karabiner_multitouchextension.app: code object is not signed at all
In architecture: x86_64
Applications/Karabiner.app/Contents/Applications/Karabiner_AXNotifier.app: code object is not signed at all
In architecture: x86_64
Applications/Karabiner.app/Contents/Applications/Karabiner Preferences.app: code object is not signed at all
In architecture: x86_64
Applications/Karabiner.app/Contents/Applications/EventViewer.app: code object is not signed at all
In architecture: x86_64
Applications/Karabiner.app: code object is not signed at all
In architecture: x86_64
Create pkg
pkgbuild: Reading components from pkginfo/pkgbuild.plist
pkgbuild: Adding component at Applications/Karabiner.app
pkgbuild: Adding component at Library/Application Support/org.pqrs/Karabiner/Karabiner.signed.kext
pkgbuild: Adding top-level preinstall script
pkgbuild: Adding top-level postinstall script
pkgbuild: Wrote package to Karabiner-10.22.0/Installer.pkg
Fix Archive.bom
productbuild: Wrote product to Karabiner-10.22.0/Karabiner.sparkle_guided.pkg
Sign with Developer ID
productsign: error: Could not find appropriate signing identity for “79E265756C43F62E157DB5C8FA405B54428653F9”.
Make Archive
.......................
[email protected]:Karabiner$ ls
[email protected]:Karabiner$ ls
CONTRIBUTING.md       NEWS.md               pkginfo
DEVELOP.md            README.md             pkgroot
Karabiner-10.22.0.dmg Tests                 src
LICENSE.md            files                 util
Makefile              make-package.sh       version
成功编译了Karabiner-10.22.0.dmg,就是安装包。至于没有签名的警告没什么关系,防止能够正常使用
步骤二、安装
鼠标双击Karabiner-10.22.0.dmg就可以了,安装后重启系统。
步骤三、设置键盘重复键灵敏度
1. 打开Karabiner选择Key Repeat
2. 勾选Override the key repeat values of system
3. 分别填写“在重复延迟”和“重复时间间隔”,注意单位是毫秒
Mac如何解决vi vim光标移动慢问题

大功告成,再玩vim就很嗨了。