解決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/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章