Vim doesn't have a built-in GUID generator.
For the project I'm working on, I can rely on Powershell being available, so the following gives me a GUID string:
[guid]::NewGuid().ToString()
I call this within a substitution, as follows:
%s/foo/\=system('[guid]::NewGuid().ToString()')[:2]/
While this works, it flashes up a window for each substitution and it's quite slow.
What I really want is a way to generate GUIDs within Vim, portably and quickly.
[:2]
); that loses the uniqueness property, and turns the GUID into a basic (somewhat random) number. Are you sure you need a full GUID, or just an N-length random number? – Herbariumset shellquote=\"
andset shellxquote=
to makesystem()
work correctly with powershell. – Floorage