搜尋

以下命令在從第一個匹配的 from 到第一個匹配的 to 的每一行上執行:command

:/from/,/to/command    " from next 'from' to next 'to'
:?from?,/to/command    " from previous 'from' to next 'to'
:?from?,?to?command    " from previous 'from' to previous 'to'

See :help search-commands.