dotfiles/nvim/.config/nvim/plugin/epoch-converter.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
381 B
VimL
Raw Normal View History

function GetHumanReadableDate()
let epoch = expand("<cword>")
let date = trim(system("date -d @" . epoch))
echo date
endfunction
function GetEpochDate()
normal! `<v`>y
let date = trim(system("date -d " . trim(shellescape(@@)) . ' "+%s"'))
echo date
endfunction
nnoremap <LocalLeader>e :call GetHumanReadableDate()<CR>
xnoremap <LocalLeader>e :call GetEpochDate()<CR>