prepend to visual block not working in vim

后端 未结 3 1430
被撕碎了的回忆
被撕碎了的回忆 2021-01-14 23:25

I\'m really fond of this idea of using Ctrl-V (Ctrl-Q in windows) to modify a visual block. The technique is explained here: In

3条回答
  •  梦毁少年i
    2021-01-14 23:49

    The behavior you describe with gvim on windows is quite unexpected. I would expect the inserted text to appear only before the first line. If you do want to insert a string before all the lines of the currently selected visual block, the natural thing to do is:

    :s/^/inserted text
    

    (Note that when you type :, vim will automatically set the addresses with :'<,'>, so the actual command will be :'<,'>s/^/inserted text)

提交回复
热议问题