Skip to content

Instantly share code, notes, and snippets.

@joequery
joequery / gist:6232026
Last active December 21, 2015 01:59 — forked from goatslacker/gist:6004481
Create a parseable time tracking log for vim. Requires https://gist.github.com/joequery/6231493 for the `git info` command.
" Lets me know how much time I've spent editing a file
" Keyboard shortcut -> \dt
augroup TimeSpentEditing
au!
au BufWinEnter * if !exists('b:tstart')|let b:tstart=reltime()|en
augroup END
function! TimeSpentEditing()
let secs = str2nr(reltimestr(reltime(b:tstart)))
let hours = secs / 3600