La soluzione più semplice che ho trovato è questo:
Scarica Karabiner e cambiare la vostra private.xml
(è anche possibile visualizzare la documentazione here)
tuo private.xml
può apparire come questo:
<?xml version="1.0"?>
<root>
<item>
<name>Command+Enter to complete single block</name>
<identifier>private.swap_cmnd+Enter_to_complete__single_block</identifier>
<autogen>
__KeyToKey__
KeyCode::RETURN, ModifierFlag::COMMAND_L | ModifierFlag::NONE,
KeyCode::RETURN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L,
KeyCode::DELETE, ModifierFlag::COMMAND_L,
KeyCode::BRACKET_RIGHT, ModifierFlag::SHIFT_L,
KeyCode::BRACKET_RIGHT,
KeyCode::SEMICOLON,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L,
KeyCode::CURSOR_LEFT,
KeyCode::RETURN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L,
KeyCode::I, ModifierFlag::CONTROL_L,
KeyCode::CURSOR_RIGHT,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_LEFT, ModifierFlag::SHIFT_L,
KeyCode::TAB,
</autogen>
</item>
<item>
<name>Option+Enter to complete double block</name>
<identifier>private.swap_Option+Enter_to_complete_double_block</identifier>
<autogen>
__KeyToKey__
KeyCode::RETURN, ModifierFlag::OPTION_L | ModifierFlag::NONE,
KeyCode::CURSOR_RIGHT,
KeyCode::RETURN,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L,
KeyCode::TAB,
KeyCode::RETURN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L,
KeyCode::TAB,
KeyCode::RETURN,
KeyCode::DELETE,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L,
KeyCode::DELETE, ModifierFlag::COMMAND_L,
KeyCode::BRACKET_RIGHT, ModifierFlag::SHIFT_L,
KeyCode::BRACKET_RIGHT,
KeyCode::SEMICOLON,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L,
KeyCode::CURSOR_LEFT,
KeyCode::RETURN,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L,
KeyCode::CURSOR_LEFT,
KeyCode::RETURN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_DOWN,
KeyCode::CURSOR_RIGHT, ModifierFlag::COMMAND_L,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L,
KeyCode::CURSOR_UP, ModifierFlag::SHIFT_L,
KeyCode::I, ModifierFlag::CONTROL_L,
KeyCode::CURSOR_RIGHT,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_UP,
KeyCode::CURSOR_LEFT, ModifierFlag::COMMAND_L,
KeyCode::TAB,
</autogen>
</item>
</root>
Al termine, è ora possibile aprire il blocco premendo ⌘
+ ENTER
(anziché della pressione di ENTER
, quando si apre il blocco, premere ⌘
+ ENTER
). Ecco lo preview (rallentato, in modo da vedere i dettagli).
Quanto sopra funziona solo con blocchi singoli. Se si desidera aprire due blocchi contemporaneamente, è possibile premere ALT
+ ENTER
. Ecco lo preview (rallentato, in modo da vedere i dettagli).
Ecco la preview con la velocità reale:
Xcode applica uno stile specifico. Non puoi cambiarlo senza plugin. – Sulthan
@Sulthan, conosci qualche plugin, che potrebbe essere d'aiuto per il problema? – OlDor
Il problema è che non è possibile impostare i formattatori di stile comuni nemmeno per formattarli con questo stile. Lo stile è così specifico che nessuno ha implementato le opzioni che lo avrebbero consentito. E questo include scrivere Obj-C in altri IDE. – Sulthan