On 2015-07-30 20:30, Erik Christiansen wrote:
function! Append_Date()
normal G
:r !date '+\%d.\%m:'
normal A
endfunction
You're on the right track. As an aside, you can just specify the
line before the :r command and the : is superfluous. To simplify
matters further, vim
On 30.07.15 20:30, Erik Christiansen wrote:
Desired Enhancement:
...
Changing to named parameters fails through lack of an eval/expand on the
a:Format, but then also switching to strange appending syntax¹ ($put)
found on the list:
au BufWinEnter ~/Personal/rainfall/*/* call
On 30.07.15 07:52, Tim Chase wrote:
So combining those above with your enhancement request, I came up
with the following function which seems to do what you want:
function! Append_Date(fmt)
$put=strftime(a:fmt)
startinsert!
endfunction
Many thanks Tim. That does it exactly, is
On 2015-07-31 00:14, Erik Christiansen wrote:
On 30.07.15 07:52, Tim Chase wrote:
So combining those above with your enhancement request, I came up
with the following function which seems to do what you want:
function! Append_Date(fmt)
$put=strftime(a:fmt)
startinsert!
On 30.07.15 09:41, Tim Chase wrote:
So the first ex command is the :put command (:help :put) with a
Doh! Yes, now it has a place in the jigsaw.
It is very early morning here, too late in the night for coffee.
I'll read up on it tomorrow. Have to fit in a bit of sleep somewhere.
Thanks.
Erik
What I have so far is:
Autoinsert date at end of file, _after_ reading modelines:
au BufWinEnter ~/Data/rainfall/*/* call Append_Date()
function! Append_Date()
normal G
:r !date '+\%d.\%m:'
normal A
endfunction
Problem:
The normal A moves the cursor to the end of the