Vim does not have a built-in GUID generator.
For the project I'm working on, I can rely on Powershell availability, so the following gives me a GUID string:
[guid]::NewGuid().ToString()
I call this in the substitution as follows:
%s/foo/\=system('[guid]::NewGuid().ToString()')[:2]/
While this works, it blinks a window for each lookup, and it is pretty slow.
I really want to create a GUID in Vim, portable and fast.
source
share