Normally input the right bracket, you needshift + right bracket
, two keystrokes, but your hand will not leave the main keyboard area;
Use brackets to complete. After completing the content input, you need to press the→
direction key. Although you only hit the key once, your right hand leaves the main keyboard area and the displacement is large.
Therefore, I feel that this function is not very practical, so what is its main value?
Update:
When I asked this question, I had not found an excellent implementation of bracket matching in vim, and it was super difficult to use. Now I have found a piece of code, the effect is the same as in ST2. If you are interested, please go to: Automatic completion of brackets in vim
Well, first of all, I think there are two advantages to doing this
1) It will automatically add right brackets to prevent you from forgetting to write
2) After you enter the left bracket, the cursor will be between the two brackets. At this time, you can write a certain amount of code and then you can directly enter the right bracket to get out of the brackets. This kind of feeling is obviously much better than the logical feeling of entering brackets first and then writing code
The main reason is that I am afraid that the left and right brackets will not match. Problems such as saving fingers are not the most important thing.
So many editors have the function of automatically completing brackets and automatically moving the cursor into the brackets!
Enter a
()
?What proportion of a function without parameters and an empty tuple can be used in a real project?
Most of the time
(params)
There is also a shortcut key called jump to outside the brackets
There is no bracket completion, the author writes a Lisp code to see ~~
Development efficiency depends more on specifications than on keystroke speed.
To put it simply, whether it is a computer language or a human language, brackets are always used in pairs. Therefore, many editors naturally provide bracket completion.
I have never encountered the problem of hands leaving the main keyboard area when using Xcode: you can use Tab to automatically accept completion brackets, or you can directly type a semicolon to accept completion of an entire line.