Wow, all these methods worked. I'm actually going to go with the
argc() test, because it's the simplest:

if (argc() == 0)
  cd C:\...
endif

On Oct 8, 10:58 am, Andy Wokula <[EMAIL PROTECTED]> wrote:
> bgold12schrieb:
>
> > Hey, is there way to test if vim was just started with no file?
> > Actually, I should start from the beginning:
>
> > I usually like to start vim by clicking on a shortcut on my Windows
> > taskbar, which means it'll start with an empty [No Name] buffer. In
> > this case, I would like my vimrc file to automatically set the
> > directory to a preferred start-up directory. But obviously when I
> > start vim with a file specified, either from the command line or from
> > double-clicking on a vim-associated file, I want the current directory
> > to be the directory the opened file is in, so I don't want my vimrc to
> > set the directory in that case. Any suggestions?
>
> > Thanks.
>
> You can get the number of file arguments:
>     :h argc()
>
> --
> Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to