2 ms·
> But have you ever heard of :g//? I hadn’t. > :[range]g[lobal]/{pattern}/[cmd] (default 'p') This is the origin of grep, i.e. g/re/p!
by onedognight 14y ago
> But have you ever heard of :g//? I hadn’t.
> :[range]g[lobal]/{pattern}/[cmd] (default 'p')
This is the origin of grep, i.e. g/re/p!
- arethuza 14y agoMy first reaction to that was "surely grep is older than vi" - but the grep wikipedia page points out that the g/re/p pattern dates all the way back to ed - which vi extended http://en.wikipedia.org/wiki/Grep http://en.wikipedia.org/wiki/Grep
- sliverstorm 14y agoOr my favorite, :g/re/d
- ajtaylor 14y agoInteresting timing: I was reading through Practical Vim last week and came across a sidebar describing the origins of grep. Why do programmers love their acronyms so much?