CodeShot is a Sublime Text plugin for creating clean CodeSnap-style screenshots of selected code.
Developer: Yasin Jagral
- Copy selected code as an image to clipboard
- Save code screenshot to Desktop
- Clean rounded card-style screenshot layout
- Programming language shown in the screenshot header
- Default footer branding:
CodeShot by Yasin Jagral(configurable viafooter_text) - Theme switching from the Tools menu
- Long-line wrapping for large lines of code
- Auto-dedent selected code so it starts from the first column
- Works offline
- Designed for Windows
CodeShot currently supports Windows only.
Required:
- Sublime Text
- Google Chrome or Microsoft Edge installed locally
- Windows PowerShell
CodeShot uses local Chrome or Microsoft Edge in headless mode to render the screenshot. It does not use any online API.
After CodeShot is accepted into Package Control:
- Open Sublime Text.
- Open the Command Palette:
Ctrl + Shift + P- Run:
Package Control: Install Package- Search for:
CodeShot- Install it.
- Download or clone this repository.
- Open Sublime Text.
- Go to:
Preferences > Browse Packages- Copy the
CodeShotpackage files into the Packages folder.
For manual folder installation, the structure should be:
Packages
CodeShot
.python_version
CodeShot.py
CodeShot.sublime-settings
Default.sublime-commands
Main.sublime-menu
README.md
LICENSENote: CodeShot does not include a default keymap file because Package Control packages should avoid forcing keyboard shortcuts.
- Restart Sublime Text.
Select code in Sublime Text, then use:
Tools > CodeShot > Copy Image to Clipboardor:
Tools > CodeShot > Save Image to Desktopor:
Tools > CodeShot > Open Preview OnlyCodeShot does not force a default keyboard shortcut in the Package Control-ready version. This avoids overriding user shortcuts.
To add your own shortcut, open:
Preferences > Key BindingsAdd this to your user key bindings:
{
"keys": ["ctrl+alt+s"],
"command": "code_shot",
"args": {
"mode": "copy"
}
}Edit:
CodeShot.sublime-settingsImportant settings:
{
"theme": "vscode-dark",
"page_background": "#ffffff",
"wrap_long_lines": true,
"dedent_selection": true,
"chrome_path": ""
}If Chrome or Edge is not detected automatically, set the path manually.
Chrome example:
"chrome_path": "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"Microsoft Edge example:
"chrome_path": "C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe"CodeShot includes these themes:
- VS Code Dark
- Dracula
- GitHub Light
- Midnight
Change the theme from:
Tools > CodeShot > ThemesThe selected theme is shown with a checkmark.
CodeShot works offline. It creates a local HTML file, renders it locally using Chrome or Edge in headless mode, then copies or saves the generated PNG.
No internet connection is required.
CodeShot currently supports Windows only.
Mac and Linux are not currently supported because clipboard handling and browser paths are OS-specific.
This repository is prepared for Package Control submission:
- Package files are at repository root
- MIT License included
messages.jsonincluded- No
__pycache__or.pycfiles - No forced default keybinding
.python_versionincluded to opt into the Python 3.8 plugin host- Windows-only support is declared honestly
MIT License. See LICENSE.
Preferences > Package Settings > CodeShot > Settings