Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

i have this function in .vimrc that puts in an entry header with the date + time. (use it as :Entry )

  "======================================================                                                                                                                                       
  "put an entry with the date/time (for keeping plan.txt)                                                                                                                                       
  "======================================================                                                                                                                                       
                                                                                                                                                                                              
  command! -nargs=* Entry call s:RunEntry()                                                                                                                                                     
                                                                                                                                      
  function! s:RunEntry()                                                                                                                                                                        
    let s:tm = "\n---" . strftime("%d/%m/%y %H:%M:%S") . "----------------------\n"                                                                                                             
                                                                                                                                                                                              
    execute "normal! i" . s:tm                                                                                                                                                                  
    " enter insert mode because it's time  to write stuff   now.                                                                                                                                  
    call feedkeys("i")                                                                                                                                                                          
  endfunction


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: