]> git.rmz.io Git - dotfiles.git/blob - vim/ultisnips/c.snippets
vim: include bin in nrformats, i.e. only disable octal
[dotfiles.git] / vim / ultisnips / c.snippets
1 # disable horrible one word snippets
2 clearsnippets pri pro pub fr mu t pr
3
4 snippet once "Include header once only guard"
5 #ifndef ${1:`!p snip.rv = re.sub(r'[^A-Za-z0-9]+','_', snip.fn).upper()`}
6 #define $1
7
8 ${VISUAL}${0}
9
10 #endif // $1
11 endsnippet
12
13 snippet for "for loop (for)"
14 for (${2:i} = 0; $2 < ${1:count}; ${3:++$2}) {
15 ${VISUAL}${0}
16 }
17 endsnippet
18
19 snippet if "if .. (if)"
20 if (${1:/* condition */}) {
21 ${VISUAL}${0}
22 }
23 endsnippet
24
25 snippet ife "if .. else (ife)"
26 if (${1:/* condition */}) {
27 ${2}
28 } else {
29 ${3:/* else */}
30 }
31 endsnippet
32
33 snippet clangformat "Disable clang-format"
34 // clang-format off
35 ${VISUAL}${0}
36 // clang-format on
37 endsnippet
38
39 snippet nolintnl "Disable clang-tiny diagnostic on next line" b
40 //NOLINTNEXTLINE(${0})
41 endsnippet
42
43 snippet nolint "Disable clang-tiny diagnostic"
44 NOLINT(${0})
45 endsnippet