Overwritten "default" shortcuts in macos are not used in vv
Steps to reproduce:
- Default shortcut for minimize is
<CMD-v> - Go to System Preferences > Keyboard > Shortcuts
- Change the shortcut for Minimize, for example
<CTRL-OPTION-CMD-m> - Start vv
- Go to insert mode
- Type
<CTRL-v> - Type
<CMD-m> - Notice nothing happens. For other
<CMD-...>shortcuts, this shows the shortcut. For example using<CMD-b>
Hi @bartheerman. Thank you for the feedback. I took the liberty to edit your original message to make the shortcuts visible. I will take a look at your issue shortly.
Hi @bartheerman. Sorry for the late answer. It seems doable. The problem is that we have to filter out the default system shortcuts here: https://github.com/vv-vim/vv/blob/main/packages/browser-renderer/src/input/keyboard.ts#L91
The shortcuts are hardcoded and I am unaware of a reliable way to get custom shortcuts using Electron API. But there is a way to get them using the defaults read NSGlobalDomain NSUserKeyEquivalents terminal command:
$ defaults read NSGlobalDomain NSUserKeyEquivalents
{
Minimize = "@~^m";
}
So we need to detect shortcuts overrides with this command and replace the hardcoded ones with them. I can work on this shortly.
Meanwhile you can modify this keyboard.ts file and build your version of the app.