I present a lot of code in my Pluralsight courses. Sometimes the code is in an IDE, but often it will be displayed in a slide deck. In either case, it is important that the presentation be consistent and attractive. Most (all?) modern IDEs provide special code syntax coloring, which developers have come to expect. Getting that consistency in a slide deck was harder. When I first started, the easiest way to ensure that your code looks decent in your deck was to take a screenshot and paste it into the slides as an image. That is still an option, but today there is a better way.
Even if you have a different favorite IDE, Microsoft’s Visual Studio Code (VS Code) is great for formatting your source code while creating your presentation. One of its lesser-known features is that it will preserve the styles (colors, font, size, etc.) of any code copied to the clipboard. Given that VS Code is free, runs on Windows, MacOS, and Linux, and supports every programming language I have ever thrown at it, it is a great IDE to use for your code presentations.
To get started, simply install and run VS Code, and open or author your source code in it. VS Code support multiple light and dark modes, so you can choose a mode that matches your presentation deck’s theme. Once your code is formatted the way you like, simply highlight it and copy it to the clipboard. There is nothing special you need to do.
In Microsoft PowerPoint, you have two options to paste your code.
In the first
Do you have any comments or questions? Did I make any mistakes in this post? Let me know on Twitter. I’m @walkingriver. I also author courses for Pluralsight, exclusively targeting the Ionic Framework.