commit f547b2da27047e32ab2db7349c2ae1e596ffdaa0
parent ac6ec94efdc943b85b9107c6ed456fae05589fc4
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Sun, 16 Dec 2018 15:05:00 +0100
Vim mapping to convert time range to duration
Former-commit-id: a0458384dbe1081c54534154fcf52855bb334c88
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/vim/map.vimrc b/vim/map.vimrc
@@ -98,3 +98,7 @@ nnoremap <C-E><C-G> :vsplit $CONF_DIR/vim/general.vimrc<CR>
nnoremap <C-E><C-V> :vsplit $CONF_DIR/vim/init.vimrc<CR>
nnoremap <C-E><C-M> :vsplit $CONF_DIR/vim/map.vimrc<CR>
nnoremap <C-E><C-P> :vsplit $CONF_DIR/vim/plugins.vimrc<CR>
+
+" This should be a plugin but for now...
+" time (hh:mm-hh:mm) to duration in hours
+nnoremap <leader>>td 0f-l"aywf:l"byw0w"cywf:l"dywA (=((a*60+b)-(c*60+d))/60.0
)F.r:wyw"aywcw=0.a*60
F.xxih0:s/:0h/h