add command for guids
This commit is contained in:
parent
9cdbaed470
commit
aec3ecc838
@ -9,3 +9,19 @@ function! s:unalign() range
|
||||
endfunction
|
||||
|
||||
command! -range UnAlign <line1>,<line2>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 . "\<Esc>"
|
||||
else
|
||||
echoerr 'No GUID provider available'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
command! Guid call s:guid()
|
||||
|
@ -35,6 +35,9 @@ nnoremap <C-l> <C-W>l
|
||||
nnoremap j gj
|
||||
nnoremap k gk
|
||||
|
||||
" functions
|
||||
nnoremap <Leader>g :Guid<Cr>
|
||||
|
||||
" fzf
|
||||
nnoremap <silent><Leader>fg :GFiles<Cr>
|
||||
nnoremap <silent><Leader>ff :Files ~<Cr>
|
||||
|
Loading…
Reference in New Issue
Block a user