[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vile] Can one ^X! direct into text being edited somehow?

From: Chris Green
Subject: Re: [vile] Can one ^X! direct into text being edited somehow?
Date: Thu, 6 Sep 2012 10:59:39 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Sep 06, 2012 at 10:11:06AM +0100, Chris Green wrote:
> I want an easy way to insert today's date (or possibly another, I might
> get the called command to pop up a calendar) into the text I'm editing.
> Using ":r !date" is a bit clumsy as one has to exit and return to insert
> mode.  
> The alternative "^X!date" puts the date into a separate buffer so,
> again, is a bit clumsy if one simply wants the date inserted at the
> point at which one is typing.
> Is there a quick and easy way to do this or do I need to write a macro?
> I guess a macro which does "<ESC>:r !date^Mi" isn't too bad.
Well I've nearly solved it myself, the following:-

    map! #2 ^[:r !date^Mi

gets the date into the text at the insertion point, the only downside is
that the insertion point remains at the beginning of the date.  Since
I'm going to use a customized date format of fixed length I think I can
just move the required number of characters forward easily enough. 
Unless anyone can suggest an easy way of automating the "getting the end
of text inserted using 'r'".

Chris Green

reply via email to

[Prev in Thread] Current Thread [Next in Thread]