> Ingo Karkat wrote: > Use ":silent ! start %"; the 'silent' will close the DOS > window immediately. I use this > map <Leader>x :silent ! start "1" "%:p"<CR> to execute > the current file. ':p' makes this independent from the CWD, > the surrounding "" make it handle spaces. The "1" is the > optional "title" argument to 'start'; I've read somewhere > that sometimes 'start' may confuse the command for the title > if the title is missing, so I keep that dummy title in there.
Nice. Your suggestion probably should go in this tip (and OP should see this for further info): Execute external programs asynchronously under Windows http://vim.wikia.com/wiki/VimTip1549 I rarely want to open a file from within Vim, so I'm not familiar with the details (athough that didn't stop me making drastic changes to the tip two months ago:~). Complicating issues: 1. Are we using a GUI or a terminal Vim? 2. Are we trying to run a GUI or a console app? 3. Does the app prompt for input, or does it run and quit? I suspect that (1) doesn't matter, but (2) and (3) do. For example, your mapping is not helpful for a Python file which simply does "print 'Hello world'" because the script will run and quit, and the mapping flashes a window which immediately disappears. I'm not suggesting that the mapping should be changed; just saying that it would need a brief explanation if placed in the tip. Re the "title": I believe that if you have quotes around the file name that you want to run, then 'start' will take that as the title (so, you need your "1" if the argument is in quotes). BTW as I understand things, the original question should have been posted to vim_use not vim_dev. John --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
