Easy date and time insertion

7 Points

Furicle Furicle

4 years ago

Makes it quick to time stamp changes etc while working in files

" add easy date insertion
imap <Leader>ds     <C-R>=strftime("%Y-%m-%d %T")<CR>
imap <Leader>ymd    <C-R>=strftime("%Y-%m-%d")<CR>
imap <Leader>mdy    <C-R>=strftime("%m/%d/%y")<CR>
imap <Leader>Mdy    <C-R>=strftime("%b %d, %Y")<CR>
imap <Leader>hms    <C-R>=strftime("%T")<CR>

Łukasz Jan Niemier

Łukasz Jan Niemier 2 years ago

Why not use abbreviations for that? Like that:

abbrev todaydate <C-r>=strftime("%Y-%m-%d %T")<CR>