Hacker News new | ask | show | jobs
by dpaleka 1764 days ago
I too use large files with random notes, but I can't be bothered to write dates -- so I use git and cron to automate a searchable, persistent diary.

Let me write a blog post about it. The author of this article in particular might find it useful. Does anyone do something similar?

1 comments

I like this. Would love to see the details of how you do it. I too dislike adding dates to entries. My solution has been a vimscript snippet that inserts the current date. I have bound it to <C-l><C-d>

  fun! InsertDate()
    let l:line = getline('.')
    let l:date = strftime('%Y-%m-%d')
    call setline('.',strpart(l:line,0,col('.')).l:date.strpart(l:line,col('.')))
  endfun

  inoremap <C-l><C-d> <ESC>:call InsertDate()<CR>