How to run the html file created in Sublime Text in Chrome directly?
How to run the html file created in Sublime Text in Chrome directly?
I tried creating a build system in sublime text and saving as chrome:
"cmd":["C:Program Files (x86)GoogleChromeApplicationchrome.exe","$file"]
But it had no success.
On running with ctrl B
it shows No Build System
ctrl B
No Build System
Note: I have selected Chrome in build system.
What I can do solve this?
1 Answer
1
The contents of a sublime-build
file has to be valid JSON in order for Sublime to recognize it, but the build that you posted above is not valid.
sublime-build
The character is special in JSON (as in many programming languages as well) in that it indicates that the next character should be interpreted specially, for example
n
meaning "start a new line".
n
In order to use a character in a string, you need to double it to tell the JSON parser that it's just supposed to be a regular character and not special. For example:
"cmd":["C:\Program Files (x86)\Google\Chrome\Application\chrome.exe","$file"]
Alternatively Windows generally accepts /
in place of in paths, which depending on your preference can be a little easier to look at visually:
/
"cmd":["C:/Program Files (x86)/Google/Chrome/Application/chrome.exe","$file"]
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Thanks, I just forgot basic thing.
– Nishan Paudel
Sep 3 at 15:54