在使用[AndroidStudio]過程中去团,特喜歡刪除一行和復(fù)制一行的的快捷鍵。而恰巧Xcode不支持這些快捷鍵,我們來增加這幾個(gè)快捷鍵土陪,以下是步驟:
修改權(quán)限
修改 Xcode 里快捷鍵的配置文件 (plist) 權(quán)限昼汗,打開終端輸入如下兩條命令:
sudo chmod 666 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
sudo chmod 777 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/
打開 plist 文件
open /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
在plist中插入對應(yīng)key value
<key>GDI Duplicate Current Line</key>
<string>selectLine:, copy:, moveToEndOfLine:,insertNewline:, paste:, deleteBackward:</string>
<key>GDI Delete Current Line</key>
<string>moveToEndOfLine:, deleteToBeginningOfLine:,deleteBackward:,moveDown:,moveToEndOfLine:</string>
<key>GDI Cut Current Line</key>
<string>selectLine:, cut:, moveDown:, moveToBeginningOfLine:,</string>
<key>GDI Move Current Line Up</key>
<string>selectLine:, cut:, moveUp:, moveToBeginningOfLine:, insertNewLine:, paste:, moveBackward:</string>
<key>GDI Move Current Line Down</key>
<string>selectLine:, cut:, moveDown:, moveToBeginningOfLine:, insertNewLine:, paste:, moveBackward:</string>
<key>GDI Insert Line Above</key>
<string>moveUp:, moveToEndOfLine:, insertNewline:</string>
<key>GDI Insert Line Below</key>
<string>moveToEndOfLine:, insertNewline:</string>
這個(gè)dict是一組可以設(shè)置快捷鍵的操作,里面的key是名稱鬼雀,對應(yīng)的string是對應(yīng)的一組操作
GDI Duplicate Current Line 復(fù)制當(dāng)前行到下面一行
GDI Delete Current Line 刪除當(dāng)前行
GDI Delete Cut Line 剪切當(dāng)前行
GDI Move Current Line Up 把當(dāng)前行往上移動一行
GDI Move Current Line Down 把當(dāng)前行往下移動一行
GDI Insert Line Above 在當(dāng)前行上面增加一空行
GDI Insert Line Below 在當(dāng)前行下面增加一空行(不管光標(biāo)是否在行尾)
3. 重啟Xcode顷窒,在Xcode菜單中,打開Preferences源哩,選中Key Binding鞋吉,在右上方搜索GDI: