简体   繁体   中英

Vim regex range with current cursor position

To substitute, what's the proper range format for current cursor position to end of file? I believe cursor is . and end of file will be $ .

Sorry if I'm misinterpreting, but if you want to do a replace from the current line until the end of the file, you can do:

:.,$ s/original/replace/g

As @PeterRincker mentions, the current line can be considered implicit, meaning that you can also use:

:,$ s/original/replace/g

To achieve the same result.

You already know the right terms, and have the right ideas... why don't you just consult the built-in help; it's really fantastic.

:help :range

or :help :s will lead you to :help [range] .

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