All pastes #2074562 Raw Edit

Anonymous

public text v1 · immutable
#2074562 ·published 2011-06-04 11:59 UTC
rendered paste body
function! MakeStamp()
  let time = strftime("%m.%d.%Y at %I:%M")
  let line = getline(1)
  redi @+
  echo time
  redi END

  if match(line, '\d\{2}\.\d\{2}\.\d\{4} at \d\{2}:\d\{2}') >= 0
    exe '1,1s/\d\{2}\.\d\{2}\.\d\{4} at \d\{2}:\d\{2}/'.time.'/i'
  else
    normal ggO
    normal ggO
    normal "+p
    normal dd
  endif
  return ""
endfunction

map <F3> :call MakeStamp()<CR>