Last active
August 9, 2022 08:16
-
-
Save phoenisx/f8c866b7c66f3af05b00d4db9c676fcc to your computer and use it in GitHub Desktop.
Sublime Text 3 CPP Basic Setup (on Mac).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"cmd": ["g++", "-Wall", "-ansi", "$file_name", "-o", "${file_base_name}"], | |
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
"working_dir": "${file_path}", | |
"selector": "source.c, source.c++, source.cxx, source.cpp", | |
"shell": false, | |
"variants": [ | |
{ | |
"name": "Run", | |
"shell": false, | |
"cmd": ["/[PATH_TO]/run_iterm.sh", "${file_path}/${file_base_name}"] | |
} | |
] | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################ | |
# https://stackoverflow.com/questions/32675804/how-do-i-execute-a-command-in-an-iterm-window-from-the-command-line | |
# https://www.iterm2.com/documentation-scripting.html | |
# Better Examples @ https://gitlab.com/gnachman/iterm2/wikis/Applescript | |
################################################ | |
osascript - "$@" <<EOF | |
on run argv | |
tell application "iTerm" | |
activate | |
set new_term to (create window with default profile) | |
tell new_term | |
tell the current session | |
repeat with arg in argv | |
write text arg | |
end repeat | |
end tell | |
end tell | |
end tell | |
end run | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment