There are many styles for Visual Studio. Especially for this thing called syntax highlighting. In my early years as a software developer I never cared about the way my editor looks like. I was very happy with the standard style. But my mind changed rapidly.
I wanted some other syntax highlighting settings and I love the Visual Studio dark theme. As editor style I use the Son of Obsidian settings and I’m very satisfied with them. But there’s this site called http://studiostyl.es/. You can download dozens of new styles. And every day there are a few more. There was just one tiny problem from my perspective. I just don’t want to visit this site every time I want to try another style :).
And because I’m a developer, I changed this. First for me, now for all others too!
The Visual Studio Package
To download every style directly within Visual Studio, I created the Twainsoft StudioStyler. This extension provides a new Tool Window, which gives you access to all Visual Studio styles that are online on http://studiostyl.es/.
So you just need to select one style, click the small green tick in the toolbar and immediately watch the changes in the editor settings like the color and the syntax highlighting appear. That saved me some time in various scenarios where I have to switch the editor settings. Figure 1 shows the Studio Styles Tool Window with some Visual Studio styles.
- Fig. 1: The Tool Window with some studio styles.
- Fig. 2: The preview for the styles image.
- Fig. 3: The minimalistic options.
In figure 2 you can see the preview for the selected StudioStyle image. This is the bottom part of the screenshot. You can open it with a double click of your left mouse button and close it with the close button on the right side :). If this preview area is visible or not is saved in the options of the extension but cannot changed through the options dialog.
Figure 3 contains a screenshot of the minimalistic options page of the Twainsoft StudioStyler. This options will be updated in future versions of the extension. Another small impassibility concerns the styles per page. Figure 1 shows all styles at once. The reason is a missing default setting for the maximum styles per page. Just change it to 40 for example and restart Visual Studio. Latter is necessary, because the settings aren’t loaded directly. This is another feature I’ll add in later versions.
- Fig. 4: The history of all activated studio styles.
- Fig. 5: The styles cache gets updated.
- Fig. 6: All available images are downloaded and merge into the cache.
Another feature is shown in figure 4. Every time you activate a style, it gets saved in the history. If the style is already present in the history, the activation count just gets increased by one. So you can switch fast between previous used styles.
Figure 5 shows the cache refreshing procedure. The problem is, that the http://studiostyl.es/ API allows me to just download the first x items of every style. It is not a good idea to download just the first x items, because there’s no pagination implemented. For example if I need the next ten items, starting at x, the API sends me the styles x + 10. So I must download much more data than needed. That’s the reason for the cache. All styles are saved within a XML file located at C:\Users\User\AppData\Roaming\Twainsoft\StudioStyler
. The extension checks the last refresh date and if it is older than 10 days, you get a message to update the cache. In future version I’ll add options for this, like the amount of days when a cache is marked as invalid.
Figure 6 contains a screenshot of another feature or workaround. Until now it is very slow to download the images. So that procedure is started asynchronously after the styles are downloaded. Just let this process ends. If it is interrupted, it will start the next time Visual Studio starts.
Last but not least, you can find the code at GitHub. This extension is open source using the MIT license! I can’t post code here, as I did for my Chrome extension, because it is just to extensive :). If you have questions, just drop me a line.
Installation
The installation is very simple. You can download the extension via the Visual Studio Gallery or directly here from this blog post. The extension works with Visual Studio Professional 2012 and 2013. But remember: Only the Visual Studio Gallery will contain the updated version! This blog post don’t gets updated every time I change the extension.
Conclusion
This is my second Visual Studio extension. The first was the Settings-Switcher, which will get an update someday :). Again I realized how hard it is to write a Visual Studio extension. The documentation changed dramatically to a better status. But the styling of the WPF controls is hard work. I hadn’t found good resources which colors I should or could use. I hope the extension will look nice in other Visual Studio themes.
If you have questions, problems or just want to provide some feedback, leave a comment, write me an e-mail or post some stuff at the GitHub repository. I hope you’ll have fun with this extension and find it useful :).
Thank You for sharing this extension.
It is really appreciated.
I had something similar in mind though.
Thank you!
Nice to read that at least someone is using it :).
If you have problems or feature requests, just drop a line.
HOw do you get the studiostyler window to show up in VS2013? I’ve installed from the microsoft gallery, and the plugin shows up in settings, but I dont see any where to actually choose styles..
Thanks!
Hi Taylor!
To show up the window just go to View -> Other Windows -> Studio Styles. There’s the StudioStyler ToolWindow as far as I remember :). I’ve no Visual Studio installation here, but as far as my own code tells me, you’ll find the window there.
Hope that helps!
Cheers,
Fabian