Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8506527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:36:56+00:00 2026-06-11T02:36:56+00:00

Vim doesn’t have a built-in GUID generator. For the project I’m working on, I

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:36:57+00:00Added an answer on June 11, 2026 at 2:36 am

    If you can rely on Vim’s Python scripting support being available

    :pyx import uuid
    :%s/foo/\=pyxeval('str(uuid.uuid4())')/
    

    (If your Vim and Python are very old, use :py and pyeval() instead of :pyx and pyxeval().)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following block of code- if (1==1):#Go forever print Wooo. Vim doesn't see
There is a Python project created by using Vim and Coda which doesn't include
In Vim, when I have a line that can not be entirely shown on
I have the following Vim-function: fu! Create_file_and_write_to_it(name, text) new execute normal i . a:text
I have a ~/.vimrc file that vim doesn't seem to be reading. There is
my vim is 7.0 and I can't update it to 7.3, i don't have
Short version : echo testing | vim - | grep good This doesn't work
Whenever I start a shell in vim using :sh, it doesn't source my ~/.bashrc
I code in vim. I use git; and love git grep. Does anyone have
It seems to me that all of a sudden Vim doesn't recognize the decimal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.