vim: 如何select 替换一个词的所有外观?

vim: how to select and replace one word for all its appearance?

在文件中,我希望将所有 "middle" 替换为 "medium",我不想使用

:%s:middle:medium:g

我愿意

1. put the focus on the word of "middle"
2. press 'gd' to high light it, 
3. and then do something to replace all its appearance(multiple places) into "medium". 

另外,vim是否规定当我替换一个词时,在输入时,它的所有位置都会显示相同的变化?

如何操作,我应该使用普通模式还是可视模式?

第一题

您可以使用 :help gn:

*                 jump to the next occurence of the word under the cursor
``                jump back
cgnmedium<Esc>    change it to whatever you want
.                 repeat change on next occurrence
.                 repeat change on next occurrence
.                 repeat change on next occurrence

需要的话可以贴图:

nnoremap <key> *``cgn

第二个问题

不,但是如果您真的想要这样的功能,您可以google换"multiple cursor vim"。