diff --git a/nvim/.config/nvim/plugin/epoch-converter.vim b/nvim/.config/nvim/plugin/epoch-converter.vim new file mode 100644 index 0000000..fc77f0d --- /dev/null +++ b/nvim/.config/nvim/plugin/epoch-converter.vim @@ -0,0 +1,14 @@ +function GetHumanReadableDate() + let epoch = expand("") + let date = trim(system("date -d @" . epoch)) + echo date +endfunction + +function GetEpochDate() + normal! `y + let date = trim(system("date -d " . trim(shellescape(@@)) . ' "+%s"')) + echo date +endfunction + +nnoremap e :call GetHumanReadableDate() +xnoremap e :call GetEpochDate()