Is there a keymap for Xcode that would make it behave the same as products from JetBrains? (IntelliJ keymap)
I tried Googling, but Google is completely useless in this case, as it presents results for the other way around (importing Xcode key map to IntelliJ products), when searching for "import intellij key bindings into xcode".
I'd prefer not to see myself reassigning all the bindings manually :)
I just created a repository with part of IntelliJ bindings migrated to an xCode template(including the custom duplicate line). Feel free to give it a look, try it and keep improving it. Sadly the only way we can achieve this is doing it manually.
https://github.com/FrangSierra/Xcode-IntelliJ-Keybinds
There is also another repository with the color theme of dark IntelliJ in case any of you could find it interesting!
https://github.com/FrangSierra/Xcode-IntelliJ-Dark-Color-Theme
I tested this using AppCode 2019.2 and Xcode 10. I first tried to find where the two IDEs keep their keymap files on disk.
Xcode keeps its keymap files in Library ▸ Developer ▸ Xcode ▸ UserData ▸ KeyBindings
and as a .idekeybindings
file. Opening it up in TextEdit revealed it's a plist-formatted file:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict/> </plist>
I was a little surprised to find it empty, but decided to try and manually trigger an update by setting a custom keybinding. Opening the file again reveals that Xcode only stores the diff of keybindings:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Menu Key Bindings</key> <dict> <key>Key Bindings</key> <array> <dict> <key>Action</key> <string>orderFrontAboutPanel:</string> <key>Alternate</key> <string>NO</string> <key>CommandID</key> <string>Xcode.IDEKit.CmdDefinition.AboutXcode</string> <key>Group</key> <string>Xcode Menu</string> <key>GroupID</key> <string>Xcode.IDEKit.MenuDefinition.Main</string> <key>GroupedAlternate</key> <string>NO</string> <key>Keyboard Shortcut</key> <string>~`</string> <key>Navigation</key> <string>NO</string> <key>Title</key> <string>About Xcode</string> </dict> </array> <key>Version</key> <integer>3</integer> </dict> </dict> </plist>
Then we turn to the Intellij platform. Luckily, I didn't have to do much hunting for these key files, because Intellij already documented them.
Keymaps for Intellij are located under ~/Library/Preferences/IntelliJIdea2019.2/keymaps
. In my case (using AppCode), it was under ~/Library/Preferences/AppCode2019.2/jba_config/mac.keymaps/
To my surprise, it was also empty. Trying to set a manual keybind resulted in similar behavior to what I saw in Xcode:
<keymap version="1" name="Default for macOS copy" parent="Mac OS X 10.5+"> <action id="EditorBackwardParagraph"> <keyboard-shortcut first-keystroke="shift ctrl meta alt back_quote" /> </action> </keymap>
Unfortunately this was also confirmed by the same doc as linked above, which states:
Each keymap file contains only the differences relative to the parent keymap.
So, unless you have every single keybinding as custom, there is currently no way to export keybindings from one to another. Sure, you can do it manually, but as you said that's counterproductive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With