I would like to have an abbreviation (xdate
in this case) expanded when I use it in nnoremap
. Is this possible? Here is what I've tried:
iab xdate <c-r>=strftime('%c')<cr>
nnoremap <leader>w i#xdate<space>
When I use the above mapping (\w) I get:
#xdate
But what I want is:
#Wed 28 Sep 2016 12:03:18 PM MST
which is what I get if I type #xdate
in insert mode.
#timestamp
without using abbreviation:nnoremap <leader>w "='#' . strftime("%c")<CR>P