On Sun, Dec 07, at 04:49 Harry wrote:
> 
> On Dec 7, 2:51 pm, "Matt Wozniski" <[EMAIL PROTECTED]> wrote:
> > On Sun, Dec 7, 2008 at 2:46 AM, Harry wrote:
> > > On Dec 6, 2:35 pm, "Matt Wozniski" wrote:
> > >> On Sat, Dec 6, 2008 at 2:09 AM, Harry wrote:
> > >> > What I've seen so far is this.
> >
> > >> > 1. If I issue
> > >> >       vim -c 'set key=foo" db
> > >> >  it results in vim interactively prompting me for the key.
> >
> > >> Use --cmd instead of -c.  It will take effect before the buffer is 
> > >> loaded.
> >
> > > Thanks. Any way to make it take the vimcrypt key from within the
> > > script, instead of interactively from the keyboard?
> >
> > When I use
> >
> > vim --cmd 'set key=foo' db
> >
> > it doesn't prompt me for the key.  Are you saying that you see
> > something different?
> 
> Sorry, for being rather unclear/wrong in my previous post. I used a
> combination of the overall info you provided in your first reply
> without expressly telling you so.  So, to answer your question, I also
> get the same behavior (as you do) when I say:
>     vim --cmd 'set key=foo' db
> meaning... no key prompting.
> 
> But here's what I'm doing presently:
>      vim -c "0r ! cat /tmp/new-note" -c 'set key=foo' db
> The '0r' part does work. But I still get prompted for the key, even
> though I specified it at the command line.
> 

The order of the given options matters.

Consider this:
   
this will echo "1" while opening a vim instance,

    vim -c "let g:var = 1" -c "echo g:var"
   
but this will complain for an undefined variable,
    
    vim -c "echo g:var" -c "let g:var = 1"

but if you do to that same instance,
    
    :echo g:var

it will echo "1"


So you already have the answer, just concatenate it (it should work):

    vim --cmd 'set key=foo' -c "0r !cat /tmp/new-note" db
     

Regards,
Ag.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to