Vim select the ends of multiple lines (block mode, but where the ending column varies)

后端 未结 4 1385
梦如初夏
梦如初夏 2020-12-23 16:45

Is there any way in vim that I can select the end of all these lines? (I\'m only showing the end of the lines in these screenshots).

In block mode I can get them all

4条回答
  •  感情败类
    2020-12-23 17:10

    If you're looking to select the very last character of every line, like if you want to add something after the quotes at the end of each line, you can do the following:

    1. Put your cursor over the very last character (in this example, the last quote on the first line)
    2. Enter block mode: control + V
    3. Move down to select as many lines as you want to change.
    4. Insert at the end of the line: shift + A
    5. Type what you want to add and then exit Visual mode
    6. You text should now be inserted at the end of each selected line!

    Hope this is helpful to others like me searching for an answer similar, but not exactly the same, as the above.

提交回复
热议问题