Hi,

David Woodfall wrote:
>
> On (10:30 14/11/06), David Woodfall <[EMAIL PROTECTED]> put forth the 
> proposition:
>
> > I would like to make a command that would insert at cursor todays date,
> > and also a command to insert some custom text.
> >
> > In the help file it shows how to make a keybind to do this but I would
> > rather use a command - eg :date
> >
> > Can this be done?
> 
> Ok I've just found the :command command but I'm having problems:
> 
> :command Date :read !date +%d-%b-%Y
> 
> This prints xxd-xxb-xxY
> 
> !date with no options works fine on it's own. I have tried putting the
> options in "" and '' but still no go.

I guess the buffer from which you tested this command was named 'xx'.
The percent sign in you command is a placeholder for the current file
name. You have to escape it with a backslash if VIM should not touch
it:

  :command Date :read !date +\%d-\%b-\%Y

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

Reply via email to