This repository contains the files and instructions needed to set up Sublime Text for competitive programming on Mac, including a custom build system, layout script, and a visual PDF guide.
Open Terminal and run:
brew install gccThis installs the GNU C++ compiler required by the build system.
Clone the repository:
cd ~/Desktop
git clone https://github.com/JagguDada01/Sublime-setup.gitA folder named Sublime-setup will be created containing:
CP Mac.sublime-buildPreferences.sublime-settingscp_layout.py
In Finder:
- Click Go in the menu bar.
- Select Go to Folder...
Shortcut:
⌘ + Shift + G
The "Go to Folder" window will appear.
Paste the Sublime User directory path in the next step.
Paste:
~/Library/Application Support/Sublime Text/Packages/User
Press Enter.
This is the folder where Sublime stores user settings and plugins.
From the cloned repository folder, copy:
CP Mac.sublime-build
Preferences.sublime-settings
cp_layout.py
into:
~/Library/Application Support/Sublime Text/Packages/User
Replace existing files if prompted.
The User folder should now contain:
CP Mac.sublime-build
Preferences.sublime-settings
cp_layout.py
Installation files are now in the correct location.
Open Sublime Text.
Navigate to:
Tools -> Build System -> CP Mac
Ensure CP Mac is selected.
This enables the custom Competitive Programming build configuration.
Open any folder you use for Competitive Programming.
Example:
DP/
CP/
Codeforces/
LeetCode/
The layout script automatically activates when a folder is opened.
Sublime automatically creates and opens:
main.cpp
inputf.in
outputf.out
Workspace layout:
+----------------------+-------------+
| | inputf.in |
| main.cpp +-------------+
| | outputf.out |
+----------------------+-------------+
Run your program using:
⌘ + B
Input is read from:
inputf.in
Output is written to:
outputf.out
Happy Coding!
If you want a visual walkthrough, open sublime_setup_Guide.pdf.
This project is licensed under the MIT License. See LICENSE for details.