On Friday, July 13, 2012 10:13:22 AM UTC-5, Ben Fritz wrote: > On Friday, July 13, 2012 8:16:44 AM UTC-5, skeept wrote: > > > > what I would like to have is > > if has("win32") and shell.find('bash') > >= 0 > > "let $TMP = 'c:\\htemp\\tmp' > > set shell=C:\Windows\System32\cmd.exe > > "set shellxquote=( > > endif > > > > my question now is how do this test, to check if the string bash is in > shell? > > > > Thank you. > > You can access any option's value in a script by prepending > '&' to the option name. > > So in this case, you'd test for bash with something like: > > " test for bash on Windows > if has('win32') && &shell =~ 'bash' > > Or even better: > > " test for pretty much any Unixy shell on Windows > if has('win32') && &shell =~ 'sh$' > > or: > > " test for Windows not using the default Windows shell > if has('win32') && &shell !~ 'cmd'
Thanks, I didn't know about these =~ and !~ operators. They seem to be similar to the ones in perl that I have trying to learn lately. Best Regards, Jorge -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
