News for hackers. Stuff that matters.
Re:Tools for Thinking by asimjalis on Wednesday August 25, 2021 @02:20PM (#28305007)
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>

There are no comments on this comment yet.