Skip to content

Instantly share code, notes, and snippets.

@epcim
Forked from jonmorehouse/vimrc
Created February 4, 2019 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epcim/011babdcb6620be9e107acfb4c486a99 to your computer and use it in GitHub Desktop.
Save epcim/011babdcb6620be9e107acfb4c486a99 to your computer and use it in GitHub Desktop.
UUID generator for vim. Inputs a uuid to copy buffer
fu! GenerateUUID()
python << EOF
import uuid
import vim
# output a uuid to the vim variable for insertion below
vim.command("let generatedUUID = \"%s\"" % str(uuid.uuid4()))
EOF
" insert the python generated uuid into the current cursor's position
:execute "normal i" . generatedUUID . ""
endfunction
"initialize the generateUUID function here and map it to a local command
noremap <Leader>r :call GenerateUUID()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment