Skip to content

Instantly share code, notes, and snippets.

@MiggieNRG
Created January 1, 2022 16:23
Show Gist options
  • Save MiggieNRG/72f655f6659ee2560c21797e626509cb to your computer and use it in GitHub Desktop.
Save MiggieNRG/72f655f6659ee2560c21797e626509cb to your computer and use it in GitHub Desktop.
A c++ build system of Sublime Text 3 for contest programming. This would open up the compiled exe in a CMD automatically! Also this includes a custom c++ output error message highlighter.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>ssraw</string>
</array>
<key>name</key>
<string>Mazanin</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\b(error)\b</string>
<key>name</key>
<string>invalid.illegal</string>
</dict>
<dict>
<key>match</key>
<string>(warning|instantiation|note|required|candidate)</string>
<key>name</key>
<string>markup.quote</string>
</dict>
<dict>
<key>match</key>
<string>^.*:[0-9]+</string>
<key>name</key>
<string>support.variable.mazanin</string>
</dict>
<dict>
<key>begin</key>
<string>\[</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.mazanin</string>
</dict>
</dict>
<key>end</key>
<string>\]</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.mazanin</string>
</dict>
</dict>
<key>name</key>
<string>comment.mazanin</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>source.mazanin</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>\(</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.mazanin</string>
</dict>
</dict>
<key>end</key>
<string>\)</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.mazanin</string>
</dict>
</dict>
<key>name</key>
<string>storage.mazanin</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>source.mazanin</string>
</dict>
</array>
</dict>
</array>
<key>scopeName</key>
<string>source.cerr</string>
<key>uuid</key>
<string>ca03e751-04ef-4330-9a6b-9b99aae1c418</string>
</dict>
</plist>
http://stackoverflow.com/a/19944511
http://stackoverflow.com/questions/13674223/how-do-you-get-vim-to-highlight-c-syntax-errors-like-visual-studio/21895852#21895852
{
"cmd": ["g++", "$file_name","-o", "${file_base_name}.exe", "-lm", "-Wall"],
"selector": "source.c++",
"shell": true,
"working_dir": "${file_path}",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"syntax" : "Packages/User/c++output.tmLanguage",
"variants":
[
{
"name": "Run",
"working_dir": "${file_path}",
"cmd": ["start", "cmd", "/k", "$file_base_name"],
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment