Copy and paste from external source

后端 未结 5 561
半阙折子戏
半阙折子戏 2021-01-02 05:21

I use vim (Actually gvim on windows) as my main text editor. In my work flow I have to copy sentences to/from various external sources, therefore I use clipboard=unnamed to

5条回答
  •  灰色年华
    2021-01-02 06:00

    Try this:

    :vmap p "_xP
    
    • vmap means to make a mapping that only applies in visual mode.
    • p is the key to create the mapping for.
    • "_ is the black hole register. This is used in any situation where you want to delete text without affecting any registers.
    • xP means delete the selected text, then paste before the resulting cursor position.

提交回复
热议问题