Vim multiline editing like in sublimetext?

后端 未结 7 1100
借酒劲吻你
借酒劲吻你 2021-01-29 17:15

I started to use gvim, and I can\'t quite understand how the multiline edit works in gvim.

For example:

Original text:

asd asd asd asd asd;
asd a         


        
7条回答
  •  北荒
    北荒 (楼主)
    2021-01-29 17:57

    Those are some good out-of-the box solutions given above, but we can also try some plugins which provide multiple cursors like Sublime.

    I think this one looks promising:

    • https://github.com/terryma/vim-multiple-cursors

    It seemed abandoned for a while, but has had some contributions in 2014.

    It is quite powerful, although it took me a little while to get used to the flow (which is quite Sublime-like but still modal like Vim).

    In my experience if you have a lot of other plugins installed, you may meet some conflicts!

    There are some others attempts at this feature:

    • https://github.com/osyo-manga/vim-over (search-replace only, but with live preview)
    • https://github.com/paradigm/vim-multicursor
    • https://github.com/felixr/vim-multiedit
    • https://github.com/hlissner/vim-multiedit (based on the previous)
    • https://github.com/adinapoli/vim-markmultiple
    • https://github.com/AndrewRadev/multichange.vim

    Please feel free to edit if you notice any of these undergoing improvement.

提交回复
热议问题