Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save markstachowski/14980eee9f3a58bce4a1b9688a98fa9e to your computer and use it in GitHub Desktop.
Save markstachowski/14980eee9f3a58bce4a1b9688a98fa9e to your computer and use it in GitHub Desktop.
Build and run C++ file in Sublime Text 3

How to Install

  • Tools -> Build System -> New build system...
  • Paste the content above
{
    "cmd": ["g++ ${file} -o ${file_path}/${file_base_name} && echo 'Build Finished' && ${file_path}/${file_base_name}"],
    "shell" : true
}
  • Save as C++ Build and Run.sublime-build

How to Use

  • Open a C++ file
  • Select Tools -> Build System -> C++ Build and Run
  • cmd + b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment