解决mac下vscode等应用中vim光标无法快速移动

在使用vscode 或者jupyterlab的时候,可能会习惯将编辑器的键盘布局映射为vim的,但出现了一个问题,macbook的长按‘hjkl’移动光标的功能好像不能用了,想要移动光标只能一下一下的敲,非常不方便,全局开启\关闭和分应用开启\关闭这个功能的方法如下:

# 全局开启
>>> defaults write -g ApplePressAndHoldEnabled -bool false
# 全局关闭
>>> defaults write -g ApplePressAndHoldEnabled -bool true
# vscode开启
>>> defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
>>> defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool true
# firefox开启
>>> defaults write org.mozilla.firefox ApplePressAndHoldEnabled -bool false
# firefox关闭
>>> defaults write org.mozilla.firefox ApplePressAndHoldEnabled -bool true

那么另一个问题来了,命令中com.microsoft.VSCode、org.mozilla.firefox这些怎么知道呢?
这就需要导出defaults文件,在里面找

# 导出
>>> defaults read > defaults.txt

还有就是强烈建议修改mac的键盘设置,你会发现键盘的打字速度和以前相比简直快得飞起!!!
在这里插入图片描述

参考:
https://www.theguild.nl/how-to-enable-or-disable-the-press-and-hold-menu-in-mac-os-x/
http://blog.fireyang.com/2018/01/16/mac-visual-studio-code-vim-hold-key-bug/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值