vim-nuuid
vim-nuuid copied to clipboard
Python 3 support
We can use pythonx
to support support python 2 and 3, so it'll run on my Python 3 only system :)
diff --git a/plugin/nuuid.vim b/plugin/nuuid.vim
index a5ed298..7f137b9 100644
--- a/plugin/nuuid.vim
+++ b/plugin/nuuid.vim
@@ -8,7 +8,7 @@ if !exists('g:nuuid_case')
endif
" Make sure we have python
-if !has('python')
+if !has('pythonx')
" finish
endif
@@ -18,7 +18,7 @@ function! NuuidNewUuid()
let l:new_uuid=system('uuidgen')[:-2]
return g:nuuid_case == "lower" ? tolower(l:new_uuid) : toupper(l:new_uuid)
else
-python << endpy
+pythonx << endpy
import vim
from uuid import uuid4
vim.command("let l:new_uuid = '%s'"% str(uuid4()))