- Open below directory in Finder with Cmnd + Shift + G
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
-
Open
IDETextKeyBindingSet.plist
with a text editor (not Xcode's plist editor). -
Add this in:
<key>Insert Newline Before</key>
<string>moveUp:, moveToEndOfLine:, insertNewline:</string>
<key>Insert Newline After</key>
<string>moveToEndOfLine:, insertNewline:</string>
-
Open Xcode and go to
Xcode preferences
->Key Bindings
Search for "insert newline" -
Add shortcuts for new commands.

When I add the key, while closing the window it is prompting with message as permission denied. I am the root user. Even I can't close that window normally after removing that key as well. I forcefully closing Xcode