Is there any easy way to open a new line below current line in Xcode text editor? Currently I have to press cmd+right and enter for this purpose. Eclipse (Shift+Enter) and vim (o) can do that with simple key combination.
By default Swift strings can't span more than one line. One simple way around this is to use the new line character \n , but that only works for strings that are displayed – if you're just trying to format your string nicely, you should use multi-line strings instead.
To force a minimum number of lines to a text view, you append a new line character ( \n ) to your text.
\n : This is a newline character. It the computer to move to the next line. \t : This is a tab.
You can take a look at this tutorial about how to add custom keyboard shortcut in Xcode ---Xcode duplicate line, then just add a new key-value Insert New Line Below Current Line
moveToEndOfLine:, insertNewline:
in IDETextKeyBindingSet.plist file, at last config your Key Bindings (like Shift+Enter) in Xcode.
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