In Vim, is there a way to paste text in the search line?

后端 未结 7 1687
情话喂你
情话喂你 2020-12-22 16:29

I want to search for $maximumTotalAllowedAfterFinish and replace it with $minimumTotalAllowedAfterFinish. Instead of typing the long text:

7条回答
  •  情深已故
    2020-12-22 17:18

    Or create the command in a vim buffer , e.g. type it in the buffer:

    s/foo/bar/gci
    

    And copy it to a named register, with "ayy (if the cursor is on that line!).

    Now you can execute the contents of the "a" register from Vim's Ex command line with:

    :[OPTIONAL_RANGE]@a
    

    I use it all the time.

提交回复
热议问题