Am 08.10.2008 09:05, bgold12 schrieb: > 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 probably can write a function that hooks into the VimEnter event (:help autocommand-events) and then checks if there is only one buffer (:help bufnr()) and if this buffer is a unnamed buffer (:help bufname()). HTH, Dennis Benzinger --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
