> -----Original Message----- > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of bgold12 > Sent: Wednesday, October 08, 2008 9:05 AM > To: vim_use > Subject: Test if vim just opened with no file > > > 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 need to do exactly one thing to get this behaviour: In your shortcut, change the value of 'Start in:' to 'your\prefered\startup\directory'. When starting vim from the command line, it should use the current directory, and likewise when you right-click and 'Edit' or 'Edit with Vim' in Explorer. This is how my gvim works; there's no need to mess around with 'autochdir' or '--cmd'. Henrik. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
