Surround two words with quotes in Vim

前端 未结 3 969
慢半拍i
慢半拍i 2021-02-02 13:59

I am working with vim-surround and the following text. (* is the place of the cursor)

This is a lo*ng line and I want to highlight two words

I

相关标签:
3条回答
  • 2021-02-02 14:31

    Try: ys2w" (ys takes a motion or text object, and then the character with which you want to surround).

    0 讨论(0)
  • 2021-02-02 14:39

    When using surround commands, I find the most logical solution is to sequence the "marking" and the "surrounding" operations.

    Thus, with text objects, I use v2aw to visually mark the two words, then s" for the total of

    v2aws"
    
    0 讨论(0)
  • 2021-02-02 14:46

    Press b first and then ys2w"

    0 讨论(0)
提交回复
热议问题