Re: Calling Cream_file_open() from command-line
Cream is a free, easy-to-use configuration of the Vim text editor
Brought to you by:
digitect
From: Steve H. <dig...@mi...> - 2006-05-04 03:42:49
|
On Wed, 2006-05-03 at 11:27 -0300, BG - Ben Armstrong wrote: > On Wed, 2006-05-03 at 10:08 -0300, BG - Ben Armstrong wrote: > > > > It seems the new vim uses inputsave() before opening (using > > "drop") the filename(s) passed to --remote. Thus, no matter what I > > do to try to hack around that filename, Vim always restores the > > input afterwards, defeating my attempts to do without an input > > file. > > > > I'm quite discouraged. :help starting is quite large isn't it? But check this out: There can be no option arguments after the "--" argument. I think this explains why you're loosing everything following the --remote {arg} command, Vim is interpreting them all as filenames. > I have given up on trying to make this work with the vim server. > > This seems to work (currently in cream-user.conf ... don't know > where it belongs): > > if $CREAM_FILE_OPEN != "" > autocmd VimEnter * call Cream_file_open($CREAM_FILE_OPEN) > endif > > and then: > > CREAM_FILE_OPEN="/path/file" cream > > Is there any flaw in this approach? No, this is effective. Change the test to if exists("$CREAM_FILE_OPEN") though, to avoid error with an uninitialized global. I also think of cream-conf as a better place for initializations since it is sourced first (cream-user is last), this would ensure the other Cream autocommands see and consider your open file. -- Steve Hall [ digitect mindspring com ] :: Cream... something good to put in your Vim! :: http://cream.sourceforge.net |