为什么要修改快捷键?
- 公认快捷键不够人性化,不符合科学,会手指脱离f,j坐标
- 自己的一套快捷键可以轻松上手任意开发工具,何乐而不为?
吐槽
网上全是一堆快捷键的操作教程,然而并没有发现有导入导出的教程,可是作为快捷键修改强迫症患者,从eclipse 到android studio, 都被我定制成了自己的快捷键,可是xcode竟然不支持导出,这完全是受不了的,必须研究,吐槽xcode垃圾也没用,事实上,就运行速度。
我这2手的mac 2016版本秒杀我的window笔记本 中的 cloin c开发工具 ,c代码写完运行n久, 而mac打开软件, 编译 c代码速度都是神速了。
我不知道ma c版本的c lo in开发工具速度如何。。
分析
首先,mac版本的Android studio 清理代码如下;
终端输入命令:
rm -Rf
~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf
~/Library/Application\
Support/AndroidStudio*
rm -Rf
~/Library/Logs/AndroidStudio*
rm -Rf
~/Library/Caches/AndroidStudio*
那么找出Xcode的配置文件我觉得应该不是难事,那么我就直接分析了哈。
结果没分析出来,但是我倒是理解了这个东西和window差不多,弄到了自己用户目录下的隐藏数据目录了。 这个目录隐藏了,
开始教程
我给大家找出来了,顺便贴上代码直接复制 到桌面。
备份快捷键到桌面的终端代码如下:
备份快捷键文件到桌面
cp ~/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings ~/Desktop
还原代码快捷键文件
也是一样的,改一下代码就可以
cp ~/Desktop/Default.idekeybindings ~/Library/Developer/Xcode/UserData/KeyBindings/Default.idekeybindings
手动拷贝的方法
先把目录显示出来
显示隐藏目录
defaults write com.apple.finder AppleShowAllFiles -bool true 此命令显示隐藏文件
defaults write com.apple.finder AppleShowAllFiles -bool false 此命令关闭显示隐藏文件
进入此目录
命令运行之后需要重新加载Finder:快捷键option+command+esc,选中Finder,重新启动即可
手动进入目录
~/Library/Developer/Xcode/UserData/KeyBindings
![](https://i-blog.csdnimg.cn/blog_migrate/1a367d7fbf668be3926d0a6f82bd9893.png)
image.png
最后分享我的配置文件其实我的打开内容如下
<?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>moveCurrentLineDown:</string>
<key>Alternate</key>
<string>NO</string>
<key>CommandGroupID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineDown</string>
<key>CommandID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineDown</string>
<key>Group</key>
<string>Editor Menu for Asset Catalog Comparison</string>
<key>GroupID</key>
<string>Xcode.IDESourceCodeComparisonEditor.MenuDefinition.Editor</string>
<key>GroupedAlternate</key>
<string>NO</string>
<key>Keyboard Shortcut</key>
<string>^s</string>
<key>Navigation</key>
<string>NO</string>
<key>Parent Title</key>
<string>Structure</string>
<key>Title</key>
<string>Move Line Down</string>
</dict>
<dict>
<key>Action</key>
<string>moveCurrentLineDown:</string>
<key>Alternate</key>
<string>NO</string>
<key>CommandGroupID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineDown</string>
<key>CommandID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineDown</string>
<key>Group</key>
<string>Editor Menu for Playground</string>
<key>GroupID</key>
<string>Xcode.IDEPegasusPlaygroundEditor.MenuDefinition.Editor</string>
<key>GroupedAlternate</key>
<string>NO</string>
<key>Keyboard Shortcut</key>
<string>^s</string>
<key>Navigation</key>
<string>NO</string>
<key>Parent Title</key>
<string>Structure</string>
<key>Title</key>
<string>Move Line Down</string>
</dict>
<dict>
<key>Action</key>
<string>moveCurrentLineDown:</string>
<key>Alternate</key>
<string>NO</string>
<key>CommandGroupID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineDown</string>
<key>CommandID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineDown</string>
<key>Group</key>
<string>Editor Menu for Source Code</string>
<key>GroupID</key>
<string>Xcode.IDEPegasusSourceEditor.MenuDefinition.Editor</string>
<key>GroupedAlternate</key>
<string>NO</string>
<key>Keyboard Shortcut</key>
<string>^s</string>
<key>Navigation</key>
<string>NO</string>
<key>Parent Title</key>
<string>Structure</string>
<key>Title</key>
<string>Move Line Down</string>
</dict>
<dict>
<key>Action</key>
<string>moveCurrentLineDown:</string>
<key>Alternate</key>
<string>NO</string>
<key>CommandGroupID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineDown</string>
<key>CommandID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineDown</string>
<key>Group</key>
<string>Editor Menu for Source Code Comparison</string>
<key>GroupID</key>
<string>Xcode.IDESourceCodeComparisonEditor.MenuDefinition.Editor</string>
<key>GroupedAlternate</key>
<string>NO</string>
<key>Keyboard Shortcut</key>
<string>^s</string>
<key>Navigation</key>
<string>NO</string>
<key>Parent Title</key>
<string>Structure</string>
<key>Title</key>
<string>Move Line Down</string>
</dict>
<dict>
<key>Action</key>
<string>moveCurrentLineUp:</string>
<key>Alternate</key>
<string>NO</string>
<key>CommandGroupID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineUp</string>
<key>CommandID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineUp</string>
<key>Group</key>
<string>Editor Menu for Asset Catalog Comparison</string>
<key>GroupID</key>
<string>Xcode.IDESourceCodeComparisonEditor.MenuDefinition.Editor</string>
<key>GroupedAlternate</key>
<string>NO</string>
<key>Keyboard Shortcut</key>
<string>^w</string>
<key>Navigation</key>
<string>NO</string>
<key>Parent Title</key>
<string>Structure</string>
<key>Title</key>
<string>Move Line Up</string>
</dict>
<dict>
<key>Action</key>
<string>moveCurrentLineUp:</string>
<key>Alternate</key>
<string>NO</string>
<key>CommandGroupID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineUp</string>
<key>CommandID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineUp</string>
<key>Group</key>
<string>Editor Menu for Playground</string>
<key>GroupID</key>
<string>Xcode.IDEPegasusPlaygroundEditor.MenuDefinition.Editor</string>
<key>GroupedAlternate</key>
<string>NO</string>
<key>Keyboard Shortcut</key>
<string>^w</string>
<key>Navigation</key>
<string>NO</string>
<key>Parent Title</key>
<string>Structure</string>
<key>Title</key>
<string>Move Line Up</string>
</dict>
<dict>
<key>Action</key>
<string>moveCurrentLineUp:</string>
<key>Alternate</key>
<string>NO</string>
<key>CommandGroupID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineUp</string>
<key>CommandID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineUp</string>
<key>Group</key>
<string>Editor Menu for Source Code</string>
<key>GroupID</key>
<string>Xcode.IDEPegasusSourceEditor.MenuDefinition.Editor</string>
<key>GroupedAlternate</key>
<string>NO</string>
<key>Keyboard Shortcut</key>
<string>^w</string>
<key>Navigation</key>
<string>NO</string>
<key>Parent Title</key>
<string>Structure</string>
<key>Title</key>
<string>Move Line Up</string>
</dict>
<dict>
<key>Action</key>
<string>moveCurrentLineUp:</string>
<key>Alternate</key>
<string>NO</string>
<key>CommandGroupID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineUp</string>
<key>CommandID</key>
<string>Xcode.IDESourceEditor.CmdDefinition.MoveLineUp</string>
<key>Group</key>
<string>Editor Menu for Source Code Comparison</string>
<key>GroupID</key>
<string>Xcode.IDESourceCodeComparisonEditor.MenuDefinition.Editor</string>
<key>GroupedAlternate</key>
<string>NO</string>
<key>Keyboard Shortcut</key>
<string>^w</string>
<key>Navigation</key>
<string>NO</string>
<key>Parent Title</key>
<string>Structure</string>
<key>Title</key>
<string>Move Line Up</string>
</dict>
</array>
<key>Version</key>
<integer>3</integer>
</dict>
<key>Text Key Bindings</key>
<dict>
<key>Key Bindings</key>
<dict>
<key></key>
<array>
<string>deleteToMark:</string>
<string>deleteForward:</string>
</array>
<key>$@X</key>
<string>capitalizeWord:</string>
<key>$W</key>
<string>insertNewline:</string>
<key>^d</key>
<string>deleteLine:</string>
<key>^u</key>
<string>moveToLeftEndOfLine:</string>
</dict>
<key>Version</key>
<integer>3</integer>
</dict>
</dict>
</plist>
编码内容格式是utf-8
![](https://i-blog.csdnimg.cn/blog_migrate/2279b6f7911fcb8509dcf244f17b14f2.png)
image.png