├── C++11.sublime-build
├── C++11.sublime-settings
├── C++11.tmLanguage
├── Comments (C++11).tmPreferences
├── Completion Rules.tmPreferences
├── Indentation Rules.tmPreferences
├── Main.sublime-menu
├── README.md
├── Symbol Index Hide Ctors.tmPreferences
├── Symbol Index.tmPreferences
├── Symbol List - Hide Function Calls.tmPreferences
├── Symbol List - Indent Class Methods.tmPreferences
├── Symbol List - Prefix Banner Items.tmPreferences
├── Symbol List Hide Forward Decls.tmPreferences
├── messages.json
└── messages
└── install.txt
/C++11.sublime-build:
--------------------------------------------------------------------------------
1 | {
2 | "cmd": ["g++", "-std=c++1y", "${file}", "-o", "${file_path}/${file_base_name}"],
3 | "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
4 | "working_dir": "${file_path}",
5 | "selector": "source.c, source.c++",
6 | "variants":
7 | [
8 | {
9 | "name": "Run",
10 | "cmd":["bash", "-c", "g++ -std=c++1y '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/C++11.sublime-settings:
--------------------------------------------------------------------------------
1 | {
2 | "extensions": ["cpp", "cc", "cxx", "c++", "hpp", "hxx", "h++", "inl", "ipp"]
3 | }
4 |
--------------------------------------------------------------------------------
/C++11.tmLanguage:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | comment
6 | Incomplete C++11 tmLanguage
7 | fileTypes
8 |
9 | cpp
10 | cc
11 | tcc
12 | cp
13 | cxx
14 | c++
15 | hh
16 | thh
17 | hpp
18 | hxx
19 | h++
20 | inl
21 | ipp
22 |
23 | firstLineMatch
24 | -\*- C\+\+ -\*-
25 | foldingStartMarker
26 | (?x)
27 | /\*\*(?!\*)
28 | |^(?![^{]*?//|[^{]*?/\*(?!.*?\*/.*?\{)).*?\{\s*($|//|/\*(?!.*?\*/.*\S))
29 |
30 | foldingStopMarker
31 | (?<!\*)\*\*/|^\s*\}
32 | keyEquivalent
33 | ^~C
34 | name
35 | C++11
36 | patterns
37 |
38 |
39 | include
40 | #special_block
41 |
42 |
43 | include
44 | #block
45 |
46 |
47 | begin
48 | R"([a-zA-Z_]*)\(
49 | beginCaptures
50 |
51 | 0
52 |
53 | name
54 | punctuation.definition.string.begin.raw.c++
55 |
56 |
57 | end
58 | \)\1"
59 | endCaptures
60 |
61 | 0
62 |
63 | name
64 | punctuation.definition.string.end.raw.c++
65 |
66 |
67 | name
68 | string.quoted.raw.c++
69 | patterns
70 |
71 |
72 | include
73 | #string_placeholder
74 |
75 |
76 |
77 |
78 | match
79 | \b(constexpr|auto)\b
80 | name
81 | storage.modifier.c++
82 |
83 |
84 | include
85 | #preprocessor-rule-enabled
86 |
87 |
88 | include
89 | #preprocessor-rule-disabled
90 |
91 |
92 | include
93 | #preprocessor-rule-other
94 |
95 |
96 | include
97 | #comments
98 |
99 |
100 | match
101 | \b(break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\b
102 | name
103 | keyword.control.c++
104 |
105 |
106 | match
107 | \b(asm|__asm__|auto|bool||char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|size_t|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|char16_t|char32_t)\b
108 | name
109 | storage.type.c++
110 |
111 |
112 | match
113 | \b(const|constexpr|extern|register|static|volatile|inline)\b
114 | name
115 | storage.modifier.c++
116 |
117 |
118 | comment
119 | common C constant naming idiom -- kConstantVariable
120 | match
121 | \bk[A-Z]\w*\b
122 | name
123 | constant.other.variable.mac-classic.c++
124 |
125 |
126 | match
127 | \bg[A-Z]\w*\b
128 | name
129 | variable.other.readwrite.global.mac-classic.c++
130 |
131 |
132 | match
133 | \bs[A-Z]\w*\b
134 | name
135 | variable.other.readwrite.static.mac-classic.c++
136 |
137 |
138 | match
139 | \b(nullptr|NULL|true|false)\b
140 | name
141 | constant.language.c++
142 |
143 |
144 | include
145 | #operator
146 |
147 |
148 | match
149 | \b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b
150 | name
151 | constant.numeric.c++
152 |
153 |
154 | begin
155 | "
156 | beginCaptures
157 |
158 | 0
159 |
160 | name
161 | punctuation.definition.string.begin.c++
162 |
163 |
164 | end
165 | "
166 | endCaptures
167 |
168 | 0
169 |
170 | name
171 | punctuation.definition.string.end.c++
172 |
173 |
174 | name
175 | string.quoted.double.c++
176 | patterns
177 |
178 |
179 | include
180 | #string_escaped_char
181 |
182 |
183 | include
184 | #string_placeholder
185 |
186 |
187 |
188 |
189 | begin
190 | '
191 | beginCaptures
192 |
193 | 0
194 |
195 | name
196 | punctuation.definition.string.begin.c++
197 |
198 |
199 | end
200 | '
201 | endCaptures
202 |
203 | 0
204 |
205 | name
206 | punctuation.definition.string.end.c++
207 |
208 |
209 | name
210 | string.quoted.single.c++
211 | patterns
212 |
213 |
214 | include
215 | #string_escaped_char
216 |
217 |
218 |
219 |
220 | begin
221 | (?x)
222 | ^\s*\#\s*(define)\s+ # define
223 | ((?:[a-zA-Z_][a-zA-Z0-9_]*)) # macro name
224 | (?: # and optionally:
225 | (\() # an open parenthesis
226 | (
227 | \s* [a-zA-Z_][a-zA-Z0-9_]* \s* # first argument
228 | (?:(,) \s* [a-zA-Z_][a-zA-Z0-9_]* \s*)* # additional arguments
229 | (?:\.\.\.)? # varargs ellipsis?
230 | )
231 | (\)) # a close parenthesis
232 | )?
233 |
234 | beginCaptures
235 |
236 | 1
237 |
238 | name
239 | keyword.control.import.define.c
240 |
241 | 2
242 |
243 | name
244 | entity.name.function.preprocessor.c
245 |
246 | 5
247 |
248 | name
249 | punctuation.definition.parameters.c
250 |
251 | 4
252 |
253 | name
254 | variable.parameter.preprocessor.c
255 |
256 | 6
257 |
258 | name
259 | punctuation.separator.parameters.c
260 |
261 | 8
262 |
263 | name
264 | punctuation.definition.parameters.c
265 |
266 |
267 | end
268 | (?=(?://|/\*))|$
269 | name
270 | meta.preprocessor.macro.c
271 | patterns
272 |
273 |
274 | match
275 | (?>\\\s*\n)
276 | name
277 | punctuation.separator.continuation.c
278 |
279 |
280 | include
281 | $base
282 |
283 |
284 | match
285 | (\w+)
286 | name
287 |
288 |
289 |
290 |
291 |
292 | begin
293 | ^\s*#\s*(error|warning)\b
294 | captures
295 |
296 | 1
297 |
298 | name
299 | keyword.control.import.error.c++
300 |
301 |
302 | end
303 | $
304 | name
305 | meta.preprocessor.diagnostic.c++
306 | patterns
307 |
308 |
309 | match
310 | (?>\\\s*\n)
311 | name
312 | punctuation.separator.continuation.c++
313 |
314 |
315 |
316 |
317 | begin
318 | ^\s*#\s*(include|import)\b\s+
319 | captures
320 |
321 | 1
322 |
323 | name
324 | keyword.control.import.include.c++
325 |
326 |
327 | end
328 | (?=(?://|/\*))|$
329 | name
330 | meta.preprocessor.c.include
331 | patterns
332 |
333 |
334 | match
335 | (?>\\\s*\n)
336 | name
337 | punctuation.separator.continuation.c++
338 |
339 |
340 | begin
341 | "
342 | beginCaptures
343 |
344 | 0
345 |
346 | name
347 | punctuation.definition.string.begin.c++
348 |
349 |
350 | end
351 | "
352 | endCaptures
353 |
354 | 0
355 |
356 | name
357 | punctuation.definition.string.end.c++
358 |
359 |
360 | name
361 | string.quoted.double.include.c++
362 |
363 |
364 | begin
365 | <
366 | beginCaptures
367 |
368 | 0
369 |
370 | name
371 | punctuation.definition.string.begin.c++
372 |
373 |
374 | end
375 | >
376 | endCaptures
377 |
378 | 0
379 |
380 | name
381 | punctuation.definition.string.end.c++
382 |
383 |
384 | name
385 | string.quoted.other.lt-gt.include.c++
386 |
387 |
388 |
389 |
390 | include
391 | #pragma-mark
392 |
393 |
394 | begin
395 | ^\s*#\s*(define|elif|else|if|ifdef|ifndef|line|pragma|undef)\b
396 | captures
397 |
398 | 1
399 |
400 | name
401 | keyword.control.import.c++
402 |
403 |
404 | end
405 | (?=(?://|/\*))|$
406 | name
407 | meta.preprocessor.c++
408 | patterns
409 |
410 |
411 | match
412 | (?>\\\s*\n)
413 | name
414 | punctuation.separator.continuation.c++
415 |
416 |
417 |
418 |
419 | match
420 | \b(u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t)\b
421 | name
422 | support.type.sys-types.c++
423 |
424 |
425 | match
426 | \b(pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t)\b
427 | name
428 | support.type.pthread.c++
429 |
430 |
431 | match
432 | \b(int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t|uintmax_t|uintmax_t)\b
433 | name
434 | support.type.stdint.c++
435 |
436 |
437 | match
438 | \b(noErr|kNilOptions|kInvalidID|kVariableLengthArray)\b
439 | name
440 | support.constant.mac-classic.c++
441 |
442 |
443 | match
444 | \b(AbsoluteTime|Boolean|Byte|ByteCount|ByteOffset|BytePtr|CompTimeValue|ConstLogicalAddress|ConstStrFileNameParam|ConstStringPtr|Duration|Fixed|FixedPtr|Float32|Float32Point|Float64|Float80|Float96|FourCharCode|Fract|FractPtr|Handle|ItemCount|LogicalAddress|OptionBits|OSErr|OSStatus|OSType|OSTypePtr|PhysicalAddress|ProcessSerialNumber|ProcessSerialNumberPtr|ProcHandle|Ptr|ResType|ResTypePtr|ShortFixed|ShortFixedPtr|SignedByte|SInt16|SInt32|SInt64|SInt8|Size|StrFileName|StringHandle|StringPtr|TimeBase|TimeRecord|TimeScale|TimeValue|TimeValue64|UInt16|UInt32|UInt64|UInt8|UniChar|UniCharCount|UniCharCountPtr|UniCharPtr|UnicodeScalarValue|UniversalProcHandle|UniversalProcPtr|UnsignedFixed|UnsignedFixedPtr|UnsignedWide|UTF16Char|UTF32Char|UTF8Char)\b
445 | name
446 | support.type.mac-classic.c++
447 |
448 |
449 | include
450 | #block
451 |
452 |
453 | begin
454 | (?x)
455 | (?: ^ # begin-of-line
456 | |
457 | (?: (?= \s ) (?<!else|new|return) (?<=\w) # or word + space before name
458 | | (?= \s*[A-Za-z_] ) (?<!&&) (?<=[*&>]) # or type modifier before name
459 | )
460 | )
461 | (\s*) (?!(while|for|do|if|else|switch|catch|enumerate|return|r?iterate|sizeof|alignof)\s*\()
462 | (
463 | (?: [~A-Za-z_]\w*+ | :: | <(\w+,?\s*)++> )++ | # actual name
464 | (?: (?<=operator) (?: [-*&<>=+!]+ | \(\) | \[\] ) ) # if it is a C++ operator
465 | )
466 | \s*(?=\()
467 | beginCaptures
468 |
469 | 1
470 |
471 | name
472 | punctuation.whitespace.function.leading.c++
473 |
474 | 3
475 |
476 | name
477 | entity.name.function.c++
478 |
479 | 4
480 |
481 | name
482 | punctuation.definition.parameters.c++
483 |
484 |
485 | end
486 | (?<=\})|(?=#)|(;)
487 | name
488 | meta.function.c++
489 | patterns
490 |
491 |
492 | include
493 | #comments
494 |
495 |
496 | include
497 | #parens
498 |
499 |
500 | match
501 | \b(const|override|final|noexcept)\b
502 | name
503 | storage.modifier.c++
504 |
505 |
506 | include
507 | #block
508 |
509 |
510 |
511 |
512 | match
513 | \b(friend|explicit|virtual)\b
514 | name
515 | storage.modifier.c++
516 |
517 |
518 | match
519 | \b(private:|protected:|public:)
520 | name
521 | storage.modifier.c++
522 |
523 |
524 | match
525 | \b(catch|operator|try|throw|using)\b
526 | name
527 | keyword.control.c++
528 |
529 |
530 | match
531 | \bdelete\b(\s*\[\])?|\bnew\b(?!])
532 | name
533 | keyword.control.c++
534 |
535 |
536 | comment
537 | common C++ instance var naming idiom -- fMemberName
538 | match
539 | \b(f|m)[A-Z]\w*\b
540 | name
541 | variable.other.readwrite.member.c++
542 |
543 |
544 | match
545 | \b(this)\b
546 | name
547 | variable.language.c++
548 |
549 |
550 | match
551 | \btemplate(<[\s\w,]*>)?
552 | name
553 | storage.type.template.c++
554 |
555 |
556 | match
557 | \b(const_cast|dynamic_cast|reinterpret_cast|static_cast)\b\s*
558 | name
559 | keyword.operator.cast.c++
560 |
561 |
562 | match
563 | (?x)(
564 | \b(?:and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq)\b
565 | )
566 |
570 | name
571 | keyword.operator.c++
572 |
573 |
574 | match
575 | \b(class|wchar_t)\b
576 | name
577 | storage.type.c++
578 |
579 |
580 | match
581 | \b(export|mutable|typename)\b
582 | name
583 | storage.modifier.c++
584 |
585 |
586 | begin
587 | (?x)
588 | (?: ^ # begin-of-line
589 | | (?: (?<!else|new|=) ) # or word + space before name
590 | )
591 | ((?:[A-Za-z_]\w*::)*+~[A-Za-z_]\w*) # actual name
592 | \s*(\() # start bracket or end-of-line
593 |
594 | beginCaptures
595 |
596 | 1
597 |
598 | name
599 | entity.name.function.c++
600 |
601 | 2
602 |
603 | name
604 | punctuation.definition.parameters.c++
605 |
606 |
607 | end
608 | \)
609 | endCaptures
610 |
611 | 0
612 |
613 | name
614 | punctuation.definition.parameters.c++
615 |
616 |
617 | name
618 | meta.function.destructor.c++
619 | patterns
620 |
621 |
622 | include
623 | $base
624 |
625 |
626 |
627 |
628 | begin
629 | (?x)
630 | (?: ^ # begin-of-line
631 | | (?: (?<!else|new|=) ) # or word + space before name
632 | )
633 | ((?:[A-Za-z_]\w*::)*+~[A-Za-z_]\w*) # actual name
634 | \s*(\() # terminating semi-colon
635 |
636 | beginCaptures
637 |
638 | 1
639 |
640 | name
641 | entity.name.function.c++
642 |
643 | 2
644 |
645 | name
646 | punctuation.definition.parameters.c++
647 |
648 |
649 | end
650 | \)
651 | endCaptures
652 |
653 | 0
654 |
655 | name
656 | punctuation.definition.parameters.c++
657 |
658 |
659 | name
660 | meta.function.destructor.prototype.c++
661 | patterns
662 |
663 |
664 | include
665 | $base
666 |
667 |
668 |
669 |
670 | repository
671 |
672 | access
673 |
674 | match
675 | \.[a-zA-Z_]\w*\b(?!\s*\()|\->[a-zA-Z_]\w*\b(?!\s*\()
676 | name
677 | variable.other.dot-access.c++
678 |
679 | angle_brackets
680 |
681 | begin
682 | <
683 | end
684 | >
685 | name
686 | meta.angle-brackets.c++
687 | patterns
688 |
689 |
690 | include
691 | #angle_brackets
692 |
693 |
694 | include
695 | $base
696 |
697 |
698 |
699 | block
700 |
701 | begin
702 | \{
703 | end
704 | \}
705 | name
706 | meta.block.c++
707 | patterns
708 |
709 |
710 | include
711 | #block_innards
712 |
713 |
714 |
715 | block_innards
716 |
717 | patterns
718 |
719 |
720 | include
721 | #preprocessor-rule-enabled-block
722 |
723 |
724 | include
725 | #preprocessor-rule-disabled-block
726 |
727 |
728 | include
729 | #preprocessor-rule-other-block
730 |
731 |
732 | include
733 | #operator
734 |
735 |
736 | include
737 | #access
738 |
739 |
740 | captures
741 |
742 | 1
743 |
744 | name
745 | punctuation.whitespace.support.function.leading.c++
746 |
747 | 2
748 |
749 | name
750 | support.function.C99.c++
751 |
752 |
753 | match
754 | (\s*)\b(hypot(f|l)?|s(scanf|ystem|nprintf|ca(nf|lb(n(f|l)?|ln(f|l)?))|i(n(h(f|l)?|f|l)?|gn(al|bit))|tr(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(jmp|vbuf|locale|buf)|qrt(f|l)?|w(scanf|printf)|rand)|n(e(arbyint(f|l)?|xt(toward(f|l)?|after(f|l)?))|an(f|l)?)|c(s(in(h(f|l)?|f|l)?|qrt(f|l)?)|cos(h(f)?|f|l)?|imag(f|l)?|t(ime|an(h(f|l)?|f|l)?)|o(s(h(f|l)?|f|l)?|nj(f|l)?|pysign(f|l)?)|p(ow(f|l)?|roj(f|l)?)|e(il(f|l)?|xp(f|l)?)|l(o(ck|g(f|l)?)|earerr)|a(sin(h(f|l)?|f|l)?|cos(h(f|l)?|f|l)?|tan(h(f|l)?|f|l)?|lloc|rg(f|l)?|bs(f|l)?)|real(f|l)?|brt(f|l)?)|t(ime|o(upper|lower)|an(h(f|l)?|f|l)?|runc(f|l)?|gamma(f|l)?|mp(nam|file))|i(s(space|n(ormal|an)|cntrl|inf|digit|u(nordered|pper)|p(unct|rint)|finite|w(space|c(ntrl|type)|digit|upper|p(unct|rint)|lower|al(num|pha)|graph|xdigit|blank)|l(ower|ess(equal|greater)?)|al(num|pha)|gr(eater(equal)?|aph)|xdigit|blank)|logb(f|l)?|max(div|abs))|di(v|fftime)|_Exit|unget(c|wc)|p(ow(f|l)?|ut(s|c(har)?|wc(har)?)|error|rintf)|e(rf(c(f|l)?|f|l)?|x(it|p(2(f|l)?|f|l|m1(f|l)?)?))|v(s(scanf|nprintf|canf|printf|w(scanf|printf))|printf|f(scanf|printf|w(scanf|printf))|w(scanf|printf)|a_(start|copy|end|arg))|qsort|f(s(canf|e(tpos|ek))|close|tell|open|dim(f|l)?|p(classify|ut(s|c|w(s|c))|rintf)|e(holdexcept|set(e(nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(aiseexcept|ror)|get(e(nv|xceptflag)|round))|flush|w(scanf|ide|printf|rite)|loor(f|l)?|abs(f|l)?|get(s|c|pos|w(s|c))|re(open|e|ad|xp(f|l)?)|m(in(f|l)?|od(f|l)?|a(f|l|x(f|l)?)?))|l(d(iv|exp(f|l)?)|o(ngjmp|cal(time|econv)|g(1(p(f|l)?|0(f|l)?)|2(f|l)?|f|l|b(f|l)?)?)|abs|l(div|abs|r(int(f|l)?|ound(f|l)?))|r(int(f|l)?|ound(f|l)?)|gamma(f|l)?)|w(scanf|c(s(s(tr|pn)|nc(py|at|mp)|c(spn|hr|oll|py|at|mp)|to(imax|d|u(l(l)?|max)|k|f|l(d|l)?|mbs)|pbrk|ftime|len|r(chr|tombs)|xfrm)|to(b|mb)|rtomb)|printf|mem(set|c(hr|py|mp)|move))|a(s(sert|ctime|in(h(f|l)?|f|l)?)|cos(h(f|l)?|f|l)?|t(o(i|f|l(l)?)|exit|an(h(f|l)?|2(f|l)?|f|l)?)|b(s|ort))|g(et(s|c(har)?|env|wc(har)?)|mtime)|r(int(f|l)?|ound(f|l)?|e(name|alloc|wind|m(ove|quo(f|l)?|ainder(f|l)?))|a(nd|ise))|b(search|towc)|m(odf(f|l)?|em(set|c(hr|py|mp)|move)|ktime|alloc|b(s(init|towcs|rtowcs)|towc|len|r(towc|len))))\b
755 |
756 |
757 | captures
758 |
759 | 1
760 |
761 | name
762 | punctuation.whitespace.function-call.leading.c++
763 |
764 | 2
765 |
766 | name
767 | entity.name.function.c++
768 |
769 | 3
770 |
771 | name
772 | punctuation.definition.parameters.c++
773 |
774 |
775 | match
776 | (?x) (?: (?= \s ) (?:(?<=else|new|return) | (?<!\w)) (\s+))?
777 | (\b
778 | (?!(while|for|do|if|else|switch|catch|enumerate|return|r?iterate|sizeof|alignof)\s*\()(?:(?!NS)[A-Za-z_]\w*+\b | :: )++ # actual name
779 | )
780 | \s*(\()
781 | name
782 | meta.function-call.c++
783 |
784 |
785 | captures
786 |
787 | 1
788 |
789 | name
790 | variable.other.c++
791 |
792 | 2
793 |
794 | name
795 | punctuation.definition.parameters.c++
796 |
797 |
798 | match
799 | (?x)
800 | (?x)
801 | (?:
802 | (?: (?= \s ) (?<!else|new|return) (?<=\w)\s+ # or word + space before name
803 | )
804 | )
805 | (
806 | (?: [A-Za-z_]\w*+ | :: )++ | # actual name
807 | (?: (?<=operator) (?: [-*&<>=+!]+ | \(\) | \[\] ) )? # if it is a C++ operator
808 | )
809 | \s*(\()
810 | name
811 | meta.initialization.c++
812 |
813 |
814 | include
815 | #block
816 |
817 |
818 | include
819 | $base
820 |
821 |
822 |
823 | comments
824 |
825 | patterns
826 |
827 |
828 | captures
829 |
830 | 1
831 |
832 | name
833 | meta.toc-list.banner.block.c++
834 |
835 |
836 | match
837 | ^/\* =(\s*.*?)\s*= \*/$\n?
838 | name
839 | comment.block.c++
840 |
841 |
842 | begin
843 | /\*
844 | captures
845 |
846 | 0
847 |
848 | name
849 | punctuation.definition.comment.c++
850 |
851 |
852 | end
853 | \*/
854 | name
855 | comment.block.c++
856 |
857 |
858 | match
859 | \*/.*\n
860 | name
861 | invalid.illegal.stray-comment-end.c++
862 |
863 |
864 | captures
865 |
866 | 1
867 |
868 | name
869 | meta.toc-list.banner.line.c++
870 |
871 |
872 | match
873 | ^// =(\s*.*?)\s*=\s*$\n?
874 | name
875 | comment.line.banner.c++
876 |
877 |
878 | begin
879 | //
880 | beginCaptures
881 |
882 | 0
883 |
884 | name
885 | punctuation.definition.comment.c++
886 |
887 |
888 | end
889 | $\n?
890 | name
891 | comment.line.double-slash.c++
892 | patterns
893 |
894 |
895 | match
896 | (?>\\\s*\n)
897 | name
898 | punctuation.separator.continuation.c++
899 |
900 |
901 |
902 |
903 |
904 | disabled
905 |
906 | begin
907 | ^\s*#\s*if(n?def)?\b.*$
908 | comment
909 | eat nested preprocessor if(def)s
910 | end
911 | ^\s*#\s*endif\b.*$
912 | patterns
913 |
914 |
915 | include
916 | #disabled
917 |
918 |
919 | include
920 | #pragma-mark
921 |
922 |
923 |
924 | parens
925 |
926 | begin
927 | \(
928 | end
929 | \)
930 | name
931 | meta.parens.c++
932 | patterns
933 |
934 |
935 | include
936 | $base
937 |
938 |
939 |
940 | pragma-mark
941 |
942 | captures
943 |
944 | 1
945 |
946 | name
947 | meta.preprocessor.c++
948 |
949 | 2
950 |
951 | name
952 | keyword.control.import.pragma.c++
953 |
954 | 3
955 |
956 | name
957 | meta.toc-list.pragma-mark.c++
958 |
959 |
960 | match
961 | ^\s*(#\s*(pragma\s+mark)\s+(.*))
962 | name
963 | meta.section
964 |
965 | preprocessor-rule-disabled
966 |
967 | begin
968 | ^\s*(#(if)\s+(0)\b).*
969 | captures
970 |
971 | 1
972 |
973 | name
974 | meta.preprocessor.c++
975 |
976 | 2
977 |
978 | name
979 | keyword.control.import.if.c++
980 |
981 | 3
982 |
983 | name
984 | constant.numeric.preprocessor.c++
985 |
986 |
987 | end
988 | ^\s*(#\s*(endif)\b)
989 | patterns
990 |
991 |
992 | begin
993 | ^\s*(#\s*(else)\b)
994 | captures
995 |
996 | 1
997 |
998 | name
999 | meta.preprocessor.c++
1000 |
1001 | 2
1002 |
1003 | name
1004 | keyword.control.import.else.c++
1005 |
1006 |
1007 | end
1008 | (?=^\s*#\s*endif\b.*$)
1009 | patterns
1010 |
1011 |
1012 | include
1013 | $base
1014 |
1015 |
1016 |
1017 |
1018 | begin
1019 |
1020 | end
1021 | (?=^\s*#\s*(else|endif)\b.*$)
1022 | name
1023 | comment.block.preprocessor.if-branch
1024 | patterns
1025 |
1026 |
1027 | include
1028 | #disabled
1029 |
1030 |
1031 | include
1032 | #pragma-mark
1033 |
1034 |
1035 |
1036 |
1037 |
1038 | preprocessor-rule-disabled-block
1039 |
1040 | begin
1041 | ^\s*(#(if)\s+(0)\b).*
1042 | captures
1043 |
1044 | 1
1045 |
1046 | name
1047 | meta.preprocessor.c++
1048 |
1049 | 2
1050 |
1051 | name
1052 | keyword.control.import.if.c++
1053 |
1054 | 3
1055 |
1056 | name
1057 | constant.numeric.preprocessor.c++
1058 |
1059 |
1060 | end
1061 | ^\s*(#\s*(endif)\b)
1062 | patterns
1063 |
1064 |
1065 | begin
1066 | ^\s*(#\s*(else)\b)
1067 | captures
1068 |
1069 | 1
1070 |
1071 | name
1072 | meta.preprocessor.c++
1073 |
1074 | 2
1075 |
1076 | name
1077 | keyword.control.import.else.c++
1078 |
1079 |
1080 | end
1081 | (?=^\s*#\s*endif\b.*$)
1082 | patterns
1083 |
1084 |
1085 | include
1086 | #block_innards
1087 |
1088 |
1089 |
1090 |
1091 | begin
1092 |
1093 | end
1094 | (?=^\s*#\s*(else|endif)\b.*$)
1095 | name
1096 | comment.block.preprocessor.if-branch.in-block
1097 | patterns
1098 |
1099 |
1100 | include
1101 | #disabled
1102 |
1103 |
1104 | include
1105 | #pragma-mark
1106 |
1107 |
1108 |
1109 |
1110 |
1111 | preprocessor-rule-enabled
1112 |
1113 | begin
1114 | ^\s*(#(if)\s+(0*1)\b)
1115 | captures
1116 |
1117 | 1
1118 |
1119 | name
1120 | meta.preprocessor.c++
1121 |
1122 | 2
1123 |
1124 | name
1125 | keyword.control.import.if.c++
1126 |
1127 | 3
1128 |
1129 | name
1130 | constant.numeric.preprocessor.c++
1131 |
1132 |
1133 | end
1134 | ^\s*(#\s*(endif)\b)
1135 | patterns
1136 |
1137 |
1138 | begin
1139 | ^\s*(#\s*(else)\b).*
1140 | captures
1141 |
1142 | 1
1143 |
1144 | name
1145 | meta.preprocessor.c++
1146 |
1147 | 2
1148 |
1149 | name
1150 | keyword.control.import.else.c++
1151 |
1152 |
1153 | contentName
1154 | comment.block.preprocessor.else-branch
1155 | end
1156 | (?=^\s*#\s*endif\b.*$)
1157 | patterns
1158 |
1159 |
1160 | include
1161 | #disabled
1162 |
1163 |
1164 | include
1165 | #pragma-mark
1166 |
1167 |
1168 |
1169 |
1170 | begin
1171 |
1172 | end
1173 | (?=^\s*#\s*(else|endif)\b.*$)
1174 | patterns
1175 |
1176 |
1177 | include
1178 | $base
1179 |
1180 |
1181 |
1182 |
1183 |
1184 | preprocessor-rule-enabled-block
1185 |
1186 | begin
1187 | ^\s*(#(if)\s+(0*1)\b)
1188 | captures
1189 |
1190 | 1
1191 |
1192 | name
1193 | meta.preprocessor.c++
1194 |
1195 | 2
1196 |
1197 | name
1198 | keyword.control.import.if.c++
1199 |
1200 | 3
1201 |
1202 | name
1203 | constant.numeric.preprocessor.c++
1204 |
1205 |
1206 | end
1207 | ^\s*(#\s*(endif)\b)
1208 | patterns
1209 |
1210 |
1211 | begin
1212 | ^\s*(#\s*(else)\b).*
1213 | captures
1214 |
1215 | 1
1216 |
1217 | name
1218 | meta.preprocessor.c++
1219 |
1220 | 2
1221 |
1222 | name
1223 | keyword.control.import.else.c++
1224 |
1225 |
1226 | contentName
1227 | comment.block.preprocessor.else-branch.in-block
1228 | end
1229 | (?=^\s*#\s*endif\b.*$)
1230 | patterns
1231 |
1232 |
1233 | include
1234 | #disabled
1235 |
1236 |
1237 | include
1238 | #pragma-mark
1239 |
1240 |
1241 |
1242 |
1243 | begin
1244 |
1245 | end
1246 | (?=^\s*#\s*(else|endif)\b.*$)
1247 | patterns
1248 |
1249 |
1250 | include
1251 | #block_innards
1252 |
1253 |
1254 |
1255 |
1256 |
1257 | preprocessor-rule-other
1258 |
1259 | begin
1260 | ^\s*(#\s*(if(n?def)?)\b.*?(?:(?=(?://|/\*))|$))
1261 | captures
1262 |
1263 | 1
1264 |
1265 | name
1266 | meta.preprocessor.c++
1267 |
1268 | 2
1269 |
1270 | name
1271 | keyword.control.import.c++
1272 |
1273 |
1274 | end
1275 | ^\s*(#\s*(endif)\b).*$
1276 | patterns
1277 |
1278 |
1279 | include
1280 | $base
1281 |
1282 |
1283 |
1284 | preprocessor-rule-other-block
1285 |
1286 | begin
1287 | ^\s*(#\s*(if(n?def)?)\b.*?(?:(?=(?://|/\*))|$))
1288 | captures
1289 |
1290 | 1
1291 |
1292 | name
1293 | meta.preprocessor.c++
1294 |
1295 | 2
1296 |
1297 | name
1298 | keyword.control.import.c++
1299 |
1300 |
1301 | end
1302 | ^\s*(#\s*(endif)\b).*$
1303 | patterns
1304 |
1305 |
1306 | include
1307 | #block_innards
1308 |
1309 |
1310 |
1311 | operator
1312 |
1313 | match
1314 | \b(sizeof|alignof)\b
1315 | name
1316 | keyword.operator.function.c++
1317 |
1318 | string_escaped_char
1319 |
1320 | patterns
1321 |
1322 |
1323 | match
1324 | \\(\\|[abefnprtv'"?]|[0-3]\d{,2}|[4-7]\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8})
1325 | name
1326 | constant.character.escape.c++
1327 |
1328 |
1329 | match
1330 | \\.
1331 | name
1332 | invalid.illegal.unknown-escape.c++
1333 |
1334 |
1335 |
1336 | string_placeholder
1337 |
1338 | patterns
1339 |
1340 |
1341 | match
1342 | (?x)%
1343 | (\d+\$)? # field (argument #)
1344 | [#0\- +']* # flags
1345 | [,;:_]? # separator character (AltiVec)
1346 | ((-?\d+)|\*(-?\d+\$)?)? # minimum field width
1347 | (\.((-?\d+)|\*(-?\d+\$)?)?)? # precision
1348 | (hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier
1349 | [diouxXDOUeEfFgGaACcSspn%] # conversion type
1350 |
1351 | name
1352 | constant.other.placeholder.c++
1353 |
1354 |
1355 | match
1356 | %
1357 | name
1358 | invalid.illegal.placeholder.c++
1359 |
1360 |
1361 |
1362 | constructor
1363 |
1364 | patterns
1365 |
1366 |
1367 | begin
1368 | (?x)
1369 | (?: ^\s*) # begin-of-line
1370 | ((?!while|for|do|if|else|switch|catch|enumerate|r?iterate|sizeof|alignof)[A-Za-z_][A-Za-z0-9_:]*) # actual name
1371 | \s*(\() # start bracket or end-of-line
1372 |
1373 | beginCaptures
1374 |
1375 | 1
1376 |
1377 | name
1378 | entity.name.function.c++
1379 |
1380 | 2
1381 |
1382 | name
1383 | punctuation.definition.parameters.c++
1384 |
1385 |
1386 | end
1387 | \)
1388 | endCaptures
1389 |
1390 | 0
1391 |
1392 | name
1393 | punctuation.definition.parameters.c++
1394 |
1395 |
1396 | name
1397 | meta.function.constructor.c++
1398 | patterns
1399 |
1400 |
1401 | include
1402 | $base
1403 |
1404 |
1405 |
1406 |
1407 | begin
1408 | (?x)
1409 | (:) # begin-of-line
1410 | ((?=\s*[A-Za-z_][A-Za-z0-9_:]* # actual name
1411 | \s*(\())) # start bracket or end-of-line
1412 |
1413 | beginCaptures
1414 |
1415 | 1
1416 |
1417 | name
1418 | punctuation.definition.parameters.c++
1419 |
1420 |
1421 | end
1422 | (?=\{)
1423 | name
1424 | meta.function.constructor.initializer-list.c++
1425 | patterns
1426 |
1427 |
1428 | include
1429 | $base
1430 |
1431 |
1432 |
1433 |
1434 |
1435 | special_block
1436 |
1437 | patterns
1438 |
1439 |
1440 | begin
1441 | (?mx)\b(namespace)\s+((?:[a-zA-Z_][a-zA-Z0-9_:]*)+)?
1442 | beginCaptures
1443 |
1444 | 1
1445 |
1446 | name
1447 | keyword.control.namespace.c++
1448 |
1449 | 2
1450 |
1451 | name
1452 | entity.name.section.namespace.c++, entity.name.type.namespace.c++
1453 |
1454 |
1455 | end
1456 | (?<=\})|(?=\w)
1457 | name
1458 | meta.namespace-block.c++
1459 | patterns
1460 |
1461 |
1462 | begin
1463 | \{
1464 | end
1465 | \}
1466 | patterns
1467 |
1468 |
1469 | include
1470 | #special_block
1471 |
1472 |
1473 | include
1474 | $base
1475 |
1476 |
1477 |
1478 |
1479 | include
1480 | $base
1481 |
1482 |
1483 |
1484 |
1485 | match
1486 | \b(typedef)\s+.*\s+([_A-Za-z][_A-Za-z0-9]*);
1487 | captures
1488 |
1489 | 1
1490 |
1491 | name
1492 | storage.type.c++
1493 |
1494 | 2
1495 |
1496 | name
1497 | entity.name.type.class.c++
1498 |
1499 |
1500 | name
1501 | meta.typedef-declaration.c++
1502 |
1503 |
1504 | begin
1505 | \b(class|struct)\s+([_A-Za-z][_A-Za-z0-9]*\b)
1506 | beginCaptures
1507 |
1508 | 1
1509 |
1510 | name
1511 | storage.type.c++
1512 |
1513 | 2
1514 |
1515 | name
1516 | entity.name.type.class.c++
1517 |
1518 |
1519 | end
1520 | (?<=\})|(?=(;|,|\(|\)|>|\[|\]))
1521 | name
1522 | meta.class-struct-block.c++
1523 | patterns
1524 |
1525 |
1526 | include
1527 | #angle_brackets
1528 |
1529 |
1530 | begin
1531 | (\{)
1532 | beginCaptures
1533 |
1534 | 1
1535 |
1536 | name
1537 | punctuation.definition.scope.c++
1538 |
1539 |
1540 | end
1541 | (\})(\s*\n)?
1542 | endCaptures
1543 |
1544 | 1
1545 |
1546 | name
1547 | punctuation.definition.invalid.c++
1548 |
1549 | 2
1550 |
1551 | name
1552 | invalid.illegal.you-forgot-semicolon.c++
1553 |
1554 |
1555 | patterns
1556 |
1557 |
1558 | include
1559 | #special_block
1560 |
1561 |
1562 | include
1563 | #constructor
1564 |
1565 |
1566 | include
1567 | $base
1568 |
1569 |
1570 |
1571 |
1572 | include
1573 | $base
1574 |
1575 |
1576 |
1577 |
1578 | begin
1579 | \b(extern)(?=\s*")
1580 | beginCaptures
1581 |
1582 | 1
1583 |
1584 | name
1585 | storage.modifier.c++
1586 |
1587 |
1588 | end
1589 | (?<=\})|(?=\w)
1590 | name
1591 | meta.extern-block.c++
1592 | patterns
1593 |
1594 |
1595 | begin
1596 | \{
1597 | end
1598 | \}
1599 | patterns
1600 |
1601 |
1602 | include
1603 | #special_block
1604 |
1605 |
1606 | include
1607 | $base
1608 |
1609 |
1610 |
1611 |
1612 | include
1613 | $base
1614 |
1615 |
1616 |
1617 |
1618 |
1619 |
1620 | scopeName
1621 | source.c++.11
1622 | uuid
1623 | 26251B18-6B1D-11D9-AFDB-000D93589AF6
1624 |
1625 |
1626 |
--------------------------------------------------------------------------------
/Comments (C++11).tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Comments
7 | scope
8 | source.c++.11
9 | settings
10 |
11 | shellVariables
12 |
13 |
14 | name
15 | TM_COMMENT_START
16 | value
17 | //
18 |
19 |
20 | name
21 | TM_COMMENT_START_2
22 | value
23 | /*
24 |
25 |
26 | name
27 | TM_COMMENT_END_2
28 | value
29 | */
30 |
31 |
32 | name
33 | TM_COMMENT_DISABLE_INDENT_2
34 | value
35 | yes
36 |
37 |
38 |
39 | uuid
40 | 9A28ACA1-3F13-4621-A3B5-3C6FF6C3B169
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Completion Rules.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | scope
6 | source.c++.11
7 | settings
8 |
9 | cancelCompletion
10 | (^.*\bconst\s*$)|^\s*(\}?\s*(else|try|do|#if|#ifdef|#else|#elif|#endif|#pragma\s+once)|(class|struct|enum|namespace)\s*[a-zA-Z_0-9]+*)$
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Indentation Rules.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Indentation Rules
7 | scope
8 | source.c++.11
9 | settings
10 |
11 | decreaseIndentPattern
12 | (?x)
13 | ^ (.*\*/)? \s* \} .* $
14 | | ^ \s* (public|private|protected): \s* $
15 | | ^ \s* @(public|private|protected) \s* $
16 |
17 | increaseIndentPattern
18 | (?x)
19 | ^ .* \{ [^}"']* $
20 | | ^ \s* (public|private|protected): \s* $
21 | | ^ \s* @(public|private|protected) \s* $
22 |
23 |
24 | bracketIndentNextLinePattern
25 | (?x)
26 | ^ \s* \b(if|while|else)\b [^;]* $
27 | | ^ \s* \b(for)\b .* $
28 |
29 |
30 | unIndentedLinePattern
31 | ^\s*((/\*|.*\*/|//|#|template\b.*?>(?!\(.*\))|@protocol|@interface(?!.*\{)|@implementation|@end).*)?$
32 |
33 | indentSquareBrackets
34 |
35 |
36 |
37 | uuid
38 | 86DBE361-9D84-4033-9402-042CC2F3F9C0
39 |
40 |
41 |
--------------------------------------------------------------------------------
/Main.sublime-menu:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "caption": "Preferences",
4 | "mnemonic": "n",
5 | "id": "preferences",
6 | "children":
7 | [
8 | {
9 | "caption": "Package Settings",
10 | "mnemonic": "P",
11 | "id": "package-settings",
12 | "children":
13 | [
14 | {
15 | "caption": "C++11",
16 | "children":
17 | [
18 | {
19 | "command": "open_file",
20 | "args": {"file": "${packages}/C++11/messages/install.txt"},
21 | "caption": "Install message"
22 | },
23 | { "caption": "-" },
24 | {
25 | "command": "open_file",
26 | "args": {"file": "${packages}/C++11/C++11.sublime-settings"},
27 | "caption": "Settings – Default"
28 | },
29 | {
30 | "command": "open_file",
31 | "args": {"file": "${packages}/User/C++11.sublime-settings"},
32 | "caption": "Settings – User"
33 | },
34 | { "caption": "-" }
35 | ]
36 | }
37 | ]
38 | }
39 | ]
40 | }
41 | ]
42 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | sublime-cpp11
2 | =============
3 |
4 | Replacement self-contained C++11 syntax definition for Sublime Text
--------------------------------------------------------------------------------
/Symbol Index Hide Ctors.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | scope
5 | source.c++.11 meta.class-struct-block.c++ meta.function.constructor.c++ entity.name.function.c++
6 | settings
7 |
8 | showInIndexedSymbolList
9 | 0
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Symbol Index.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | scope
5 | source.c++.11
6 | settings
7 |
8 | symbolIndexTransformation
9 | /.*::([A-Za-z0-9_~]+)/$1/;
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Symbol List - Hide Function Calls.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | scope
5 | source.c++.11 meta.function.c++ meta.block.c++ meta.function-call.c++ entity.name.function.c++
6 | settings
7 |
8 | showInSymbolList
9 | 0
10 | showInIndexedSymbolList
11 | 0
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Symbol List - Indent Class Methods.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | bundleUUID
6 | D4F9DAEB-ADC3-4C66-B4B5-8E420E68DECF
7 | name
8 | Symbol List: Indent Class Methods
9 | scope
10 | meta.class-struct-block.c++ entity.name.function
11 | settings
12 |
13 | symbolTransformation
14 |
15 | s/^\s*/ /; # pad
16 |
17 | uuid
18 | 9343B154-3C63-4F81-A016-54BA69EDF99D
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Symbol List - Prefix Banner Items.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | name
6 | Symbol List: Prefix Banner Items
7 | scope
8 | meta.toc-list.banner
9 | settings
10 |
11 | symbolTransformation
12 |
13 | s/^\s+/# /;
14 | s/^=+$/-/;
15 |
16 |
17 | uuid
18 | A76F348A-E4EF-4EA5-B2FE-613A3CA72F2D
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Symbol List Hide Forward Decls.tmPreferences:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | scope
5 | source.c++.11 meta.class-struct-block.c++ entity.name.type.forward-decl.c++
6 | settings
7 |
8 | showInSymbolList
9 | 0
10 | showInIndexedSymbolList
11 | 0
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/messages.json:
--------------------------------------------------------------------------------
1 | {
2 | "install": "messages/install.txt",
3 | }
4 |
--------------------------------------------------------------------------------
/messages/install.txt:
--------------------------------------------------------------------------------
1 | Thank you for installing sublime-cpp11!
2 |
3 |
4 | Installation
5 | ============
6 | To use this package as the default, you must disable the built-in C++ package.
7 |
8 | Under Preferences->Settings - User, add "C++" to the "ignored_packages" list:
9 | "ignored_packages":
10 | [
11 | "C++"
12 | ],
13 |
14 |
15 | C/H Extensions
16 | ==============
17 | By default this package allows a separate C language definition to associate
18 | with .c/.h files.
19 |
20 | To use sublime-cpp11 for these extensions, open the user preferences:
21 |
22 | Preferences->Package Settings->C++11->Settings - User
23 |
24 | and add the following:
25 |
26 | {
27 | "extensions": ["C", "H"]
28 | }
29 |
30 |
31 | Note: The current version is an early release with only minimal support
32 | * Pull requests welcome!
33 | * Report issues here: https://github.com/noct/sublime-cpp11/issues
34 | * Or just hit me up on twitter: @noct
35 |
--------------------------------------------------------------------------------