vim - Why does the editor have the "bracket completion" function?
天蓬老师
天蓬老师 2017-05-16 16:40:41
0
7
599

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 thedirection 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

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all (7)
漂亮男人

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.

                Latest Downloads
                More>
                Web Effects
                Website Source Code
                Website Materials
                Front End Template
                About us Disclaimer Sitemap
                php.cn:Public welfare online PHP training,Help PHP learners grow quickly!