diff --git a/.vim/functions.vim b/.vim/functions.vim index 6c56275..83313b3 100644 --- a/.vim/functions.vim +++ b/.vim/functions.vim @@ -9,3 +9,19 @@ function! s:unalign() range endfunction command! -range UnAlign ,call s:unalign() + +function! s:guid() + if has('pythonx') + pythonx import uuid + let l:guid = pyxeval('str(uuid.uuid4())') + elseif has('windows') + let l:guid = system('powershell.exe -command "[guid]::NewGuid().ToString()"') + endif + if exists('l:guid') + execute 'normal! a' . l:guid . "\" + else + echoerr 'No GUID provider available' + endif +endfunction + +command! Guid call s:guid() diff --git a/.vim/keymaps.vim b/.vim/keymaps.vim index b7330e1..da34a77 100644 --- a/.vim/keymaps.vim +++ b/.vim/keymaps.vim @@ -35,6 +35,9 @@ nnoremap l nnoremap j gj nnoremap k gk +" functions +nnoremap g :Guid + " fzf nnoremap fg :GFiles nnoremap ff :Files ~