On 09/10/08 05:32, Ben Schmidt wrote:
>> Method 2. There's nothing obvious in wanting Vim to always set the
>> current directory to the directory of the current file: 'autochdir'
>> (q.v.) defaults to off, and as a matter of fact I don't set it on.
>> However if you do, I think it doesn't matter which directory you :cd to
>> in your vimrc, whenever you enter a file (including the first file on
>> the command-line) Vim should change to the file's directory. So in that
>> case I think you could just write the following into your vimrc:
>>
>> set autochdir
>> cd C:\my\preferred\startup\dir
>
> You don't need autochdir, and may not want it (e.g. because you don't
> want it changing after opening the first file, but only when opening the
> first file). Also, the Windows version automatically does that (changes
> for the first file, but doesn't set autochdir).
>
> :help vim-default-editor
> :help send-to-menu
>
> Ben.
See the other replies. The simplest seems to be
if !argc()
cd C:\my\preferred\startup\dir
endif
Best regards,
Tony.
--
"God gives burdens; also shoulders"
Jimmy Carter cited this Jewish saying in his concession speech at the
end of the 1980 election. At least he said it was a Jewish saying; I
can't find it anywhere. I'm sure he's telling the truth though; why
would he lie about a thing like that?
-- Arthur Naiman, "Every Goy's Guide to Yiddish"
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---