diff --git a/.config/vim/vimrc.d/40-keys.vim b/.config/vim/vimrc.d/40-keys.vim index 4737572..f64c6be 100644 --- a/.config/vim/vimrc.d/40-keys.vim +++ b/.config/vim/vimrc.d/40-keys.vim @@ -274,6 +274,11 @@ augroup END nnoremap utc ciw=strftime("%F %T", @") vnoremap utc keepp '<,'>s/\v(^\|[^0-9])\zs[0-9]{10}\ze([^0-9]\|$)/\=strftime("%F %T",submatch(0))/g +" Convert decimal numbers to hex +" https://stackoverflow.com/a/1118642 +nnoremap hex ciw=printf("0x%X", @") +vnoremap hex keepp '<,'>s/\v<\d+>/\=printf("0x%X", submatch(0))/g + " TODO: sec that uses the `duration` alias from zsh " Relax mappings that jump to opening braces on first column: Just make sure