简体   繁体   中英

Replace a line 5 lines above current line in vi editor in ex mode

I want to replace a line that is 5 lines above the current line in the vi editor. It has to be a single command in the ex mode.

use

:-5s/^.\*$/Your Replacement/

That should work, and will move the cursor to that line

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM