Skip to content

Instantly share code, notes, and snippets.

@tsitsvero
Forked from jdhao/C++.sublime-build
Created March 25, 2020 04:52
Show Gist options
  • Save tsitsvero/0181073ce23d441c7e49780f505f17f9 to your computer and use it in GitHub Desktop.
Save tsitsvero/0181073ce23d441c7e49780f505f17f9 to your computer and use it in GitHub Desktop.

Revisions

  1. @jdhao jdhao revised this gist Aug 31, 2018. No changes.
  2. @jdhao jdhao revised this gist Aug 31, 2018. No changes.
  3. @jdhao jdhao revised this gist May 27, 2018. 1 changed file with 31 additions and 17 deletions.
    48 changes: 31 additions & 17 deletions C++.sublime-build
    Original file line number Diff line number Diff line change
    @@ -1,19 +1,33 @@
    {
    "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\"",
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c++, source.cpp, source.cc, source.cxx",
    "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\"",
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c++, source.cpp, source.cc, source.cxx",

    "variants":
    [
    {
    "name": "Run in Terminal",
    "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && xterm -e '${file_path}/${file_base_name} && echo && echo Press ENTER to continue && read line && exit'",
    // "shell_cmd": "gnome-terminal -e 'bash -c \"${file_path}/${file_base_name}&& echo && echo Press ENTER to continue && read line && exit\"'",
    // "shell_cmd": "xterm -e '${file_path}/${file_base_name}; bash'",
    // "shell_cmd": "xterm -hold -e ${file_path}/${file_base_name}",
    // "shell_cmd": "konsole --hold -e ${file_path}/./${file_base_name}",
    "shell": true,
    },
    ]
    }
    "variants":
    [
    {
    "name": "Run in Terminal",

    "linux": {
    "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && xterm -e '${file_path}/${file_base_name} && echo && echo Press ENTER to continue && read line && exit'",
    // "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && gnome-terminal -e 'bash -c \"${file_path}/${file_base_name}&& echo && echo Press ENTER to continue && read line && exit\"'", // for gnome-terminal
    // "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && xterm -e '${file_path}/${file_base_name}; bash'", // for xterm
    // "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && xterm -hold -e ${file_path}/${file_base_name}", // for xterm
    // "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && konsole --hold -e ${file_path}/./${file_base_name}", // for konsole

    },

    "windows":{
    "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && start cmd /k $file_base_name "
    // "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && start \"$file_base_name\" call $file_base_name"
    },

    "osx":{
    "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && xterm -e '${file_path}/${file_base_name} && echo && echo Press ENTER to continue && read line && exit'",
    },

    "shell": true,
    },
    ]
    }
  4. @jdhao jdhao created this gist Jul 4, 2017.
    19 changes: 19 additions & 0 deletions C++.sublime-build
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    {
    "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\"",
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c++, source.cpp, source.cc, source.cxx",

    "variants":
    [
    {
    "name": "Run in Terminal",
    "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && xterm -e '${file_path}/${file_base_name} && echo && echo Press ENTER to continue && read line && exit'",
    // "shell_cmd": "gnome-terminal -e 'bash -c \"${file_path}/${file_base_name}&& echo && echo Press ENTER to continue && read line && exit\"'",
    // "shell_cmd": "xterm -e '${file_path}/${file_base_name}; bash'",
    // "shell_cmd": "xterm -hold -e ${file_path}/${file_base_name}",
    // "shell_cmd": "konsole --hold -e ${file_path}/./${file_base_name}",
    "shell": true,
    },
    ]
    }