Keyword binding in Xcode

Is there a way to get Xcode 4 in indented text so that clicking on the selected text departs from it, shift + tab would be invalid, as in many editors?

By default, โŒ˜] and โŒ˜ [ do not seem to work, perhaps because I have a Finnish keyboard layout. Pressing the key combination for [ (alt + 8) and additionally holding โŒ˜ does not back off.

In the Xcode settings, I found Key bindings and Shift Right, Shift Left, but it doesn't seem to understand shift + tab. If I try to press shift + tab, I get โ‡งโŒ˜โ‡ค .

enter image description here

+6
source share
3 answers

Setting tab binding for Shift Right did not work for me even when reassigning the "Insert tab" to something else (it seems to be hard-coded / error). However, I got the binding Alt + Tab and Shift + Alt + Tab (with the layout of the Finnish keyboard, I did not test the extended ones or myself). I still had to reassign the "Insert tab without additional action" from Alt + Tab to Alt + Ctrl + Tab, you can avoid this by using Ctrl instead of Alt to switch.

Here is the xml file for it.

cd ~/Library/Developer/Xcode/UserData/KeyBindings

vi Default.idekeybindings (possibly an empty plist if it is not properly distributed)

Paste:

 <?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>shiftRight:</string> <key>Alternate</key> <string>NO</string> <key>CommandID</key> <string>Xcode.IDESourceEditor.CmdDefinition.ShiftRight</string> <key>Group</key> <string>Editor Menu for Source Code</string> <key>GroupID</key> <string>Xcode.IDESourceEditor.MenuDefinition.Editor</string> <key>GroupedAlternate</key> <string>NO</string> <key>Keyboard Shortcut</key> <string>~ </string> <key>Navigation</key> <string>NO</string> <key>Parent Title</key> <string>Structure</string> <key>Title</key> <string>Shift Right</string> </dict> <dict> <key>Action</key> <string>shiftLeft:</string> <key>Alternate</key> <string>NO</string> <key>CommandID</key> <string>Xcode.IDESourceEditor.CmdDefinition.ShiftLeft</string> <key>Group</key> <string>Editor Menu for Source Code</string> <key>GroupID</key> <string>Xcode.IDESourceEditor.MenuDefinition.Editor</string> <key>GroupedAlternate</key> <string>NO</string> <key>Keyboard Shortcut</key> <string>~$</string> <key>Navigation</key> <string>NO</string> <key>Parent Title</key> <string>Structure</string> <key>Title</key> <string>Shift Left</string> </dict> </array> <key>Version</key> <integer>3</integer> </dict> <key>Text Key Bindings</key> <dict> <key>Key Bindings</key> <dict> <key>^~ </key> <string>insertTabIgnoringFieldEditor:</string> </dict> <key>Version</key> <integer>3</integer> </dict> </dict> </plist> 
+2
source

As a workaround, if you cannot enter shift-tab, you can find the key binding (stored in ~/Library/Developer/Xcode/UserData/KeyBindings and change it directly. This is XML so that you can do this without much trouble.

+3
source

Tabbing is included in Xcode, it's just a keyboard shortcut. Keyboard shortcuts are Command-] for indentation and Command- [for indentation.

Another convenient feature of Visual Studio, which is also located in Xcode, is the block selection function. In Visual Studio, if you hold down the Alt key while clicking and dragging, you can select a block of text whose start and end columns should not be the beginning and end of a line.

You can also do this in Xcode by holding down the Option key while clicking and dragging.

Found this information here: http://idevhub.com/xcode-tips-selection-indent-and-block-select/

0
source

Source: https://habr.com/ru/post/890775/


All Articles