解决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

参考:
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/

https://blog.csdn.net/MacwinWin/article/details/105157077

 
posted @ 2021-05-11 15:07  feiquan  阅读(593)  评论(0编辑  收藏  举报
如果是此文是转载文章,本人会附上转载链接,此篇文章的版权归原创作者所属,如果侵权请与我联系,我会删除此文。

若没有标明转载链接,此篇文章属于本人的原创文章,其版权所属:
作者:feiquan
出处:http://www.cnblogs.com/feiquan/
版权声明:本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
大家写文都不容易,请尊重劳动成果~ 这里谢谢大家啦(*/ω\*)