Surely. Floating point, trigonometry even. I would:
1. Write a regex that matches the numbers you want to manipulate, and not anything else. Maybe
/\d\d:\d\d:\d\d,
2. Put capturing parentheses around the numbers that might change. In vim these are \( and \):
/\d\d:\(\d\d\):\(\d\d\),
3. For convenience, isolate the parts that will change with \zs and \ze:
/\d\d:\zs\(\d\d\):\(\d\d\)\ze,
4. Use :substitute with \= and submatch() to change the minutes and seconds to seconds, with markers. Also, now is a good time to do the arithmetic. Note the tricky precedence of string concatenation
:%s//\='##'.(submatch(1)*60+submatch(2)-7).'###'/g
5. Use :substitute with \=, submatch(), and printf()
:%s@##\(\d\+\)###@\=printf('%02d:%02d',submatch(1)/60,submatch(1)%60)@g
Here the replace expression has a /, so :s uses @ instead.
That, which flowed off my fingers as I went along, didn't end up all that simple, I'm sorry. Straightforward if one is a C programmer, and so familiar with printf and integer arithmetic with / and %. It would be better to write a function that does the manipulation:
function! Sub(in)
let minutes = a:in[0:1]
let seconds = a:in[3:4]
let time = minutes * 60 + seconds
let time -= 7
let minutes = time / 60
let seconds = time % 60
return printf('%02d:%02d', minutes, seconds)
endfunction
Put that in a file, say sub.vim, source it:
:so sub.vim
Then
:%s/\d\d:\zs\d\d:\d\d\ze,/\=Sub(submatch(0))/g
Regards, John Little