vim:keys: Add <leader>utc to convert unix time

Add `<leader>utc` to convert unix timestamps into a human readable
format.
This commit is contained in:
2022-07-14 02:28:47 +02:00
parent 0d1ce75c9b
commit bc7a539186

View File

@@ -200,3 +200,8 @@ xnoremap gm :Man <C-r><C-a><CR>
" Format the current paragraph " Format the current paragraph
nmap Q gqap nmap Q gqap
" Convert Unix timestamp to human readable
" Mnemonic: "Unix timestamp convert" with pun to UTC
nnoremap <leader>utc ciw<C-r>=strftime("%c", @")<CR><Esc>
vnoremap <leader>utc :s/\v(^\|[^0-9])\zs[0-9]{10}\ze([^0-9]\|$)/\=strftime("%c",submatch(0))/g<CR>