- Tools → Build System → New build system...
- Paste the content below
{
"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
- Open a C++ file
- Select Tools → Build System → C++ Build and Run
- cmd + b