Friday, April 23, 2010

Re: run a script in current directory when startup

I do something like that, while starting Vim for generate and observe some data in my project

$ cd /path/to/project
$ vim -c 'r !./my_generator.sh' path/to/tmpfile

this way you'll get my_generator.sh output in tmpfile

In your case, when you want just to set some variables, you could do

$ vim -c '!./my_generator.sh' path/to/tmpfile
I mean without `r`. Pay attention for those single quotes as well

On Wed, Apr 21, 2010 at 8:23 PM, Wayne <brocean@gmail.com> wrote:
Dear chip, thank you so much.

On 4/21/10, Charles Campbell <Charles.E.Campbell@nasa.gov> wrote:
> Wayne wrote:
>> Hi all,
>> First, I'm sorry for not searching if any such subject had exist
>> before this mail.
>>
>> I have some configuration info specific to project such as path, tags
>> file, and other special settings. And I should apply these settings
>> manually after vim is started.
>> These settings is nonsense to other project, so it is not good method
>> to write to user script.
>>
>> Is there any method to run some script which resides in current
>> directory at which to start vim.
>> For example, a script named project.vim, run it in user script. I
>> don't if it is feasible.
>
> if filereadable("project.vim")
>   so project.vim
> endif
>
> HTH,
> Chip Campbell
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> Subscription settings:
> http://groups.google.com/group/vim_use/subscribe?hl=en
>

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment