Skip to content

Commit

Permalink
include the C TextMate bundle and C++ Sublime Text package for the ex…
Browse files Browse the repository at this point in the history
…ample
  • Loading branch information
srbs committed Oct 6, 2012
1 parent a4f1c40 commit 1f06536
Show file tree
Hide file tree
Showing 86 changed files with 5,475 additions and 6 deletions.
@@ -0,0 +1,8 @@
<snippet>
<description>#ifndef … #define … #endif</description>
<content><![CDATA[#ifndef ${1/([A-Za-z0-9_]+).*/$1/}
#define ${1:SYMBOL} ${2:value}
#endif]]></content>
<tabTrigger>def</tabTrigger>
<scope>source.c, source.c++, source.objc, source.objc++</scope>
</snippet>
@@ -0,0 +1,6 @@
<snippet>
<description>#include &lt;&gt;</description>
<content><![CDATA[#include <${1:.h}>]]></content>
<tabTrigger>Inc</tabTrigger>
<scope>source.c, source.objc, source.c++, source.objc++</scope>
</snippet>
6 changes: 6 additions & 0 deletions examples/subl2tm/Sublime Text/#include-(inc).sublime-snippet
@@ -0,0 +1,6 @@
<snippet>
<description>#include "…"</description>
<content><![CDATA[#include "${1:${TM_FILENAME/\..+$/.h/}}"]]></content>
<tabTrigger>inc</tabTrigger>
<scope>source.c, source.objc, source.c++, source.objc++</scope>
</snippet>
@@ -0,0 +1,6 @@
<snippet>
<description>$1.begin(), $1.end()</description>
<content><![CDATA[${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}begin(), ${1:v}${1/^.*?(-)?(>)?$/(?2::(?1:>:.))/}end()]]></content>
<tabTrigger>beginend</tabTrigger>
<scope>source.c++, source.objc++</scope>
</snippet>
10 changes: 10 additions & 0 deletions examples/subl2tm/Sublime Text/010-main()-(main).sublime-snippet
@@ -0,0 +1,10 @@
<snippet>
<description>main()</description>
<content><![CDATA[int main(int argc, char const${TM_C_POINTER: *}argv[])
{
${0:/* code */}
return 0;
}]]></content>
<tabTrigger>main</tabTrigger>
<scope>source.c, source.objc, source.c++, source.objc++</scope>
</snippet>
@@ -0,0 +1,9 @@
<snippet>
<description>For Loop</description>
<content><![CDATA[for (int ${2:i} = 0; $2 < ${1:count}; ${3:++$2})
{
${0:/* code */}
}]]></content>
<tabTrigger>for</tabTrigger>
<scope>source.c, source.objc, source.c++, source.objc++</scope>
</snippet>
14 changes: 14 additions & 0 deletions examples/subl2tm/Sublime Text/C++.sublime-build
@@ -0,0 +1,14 @@
{
"cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",

"variants":
[
{
"name": "Run",
"cmd": ["bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
}
]
}
3 changes: 3 additions & 0 deletions examples/subl2tm/Sublime Text/C++.sublime-settings
@@ -0,0 +1,3 @@
{
"extensions": ["cpp", "cc", "cxx", "c++", "h", "hpp", "hxx", "h++", "inl", "ipp"]
}

0 comments on commit 1f06536

Please sign in to comment.