@@ -59,6 +59,8 @@ Config Example:
59
59
},
60
60
-- enable qt-related snippets
61
61
qt = true ,
62
+ -- whether to add cpplint related comments in some snippets
63
+ cpplint = true ,
62
64
},
63
65
},
64
66
rust = {
@@ -154,28 +156,29 @@ Snippets with `*` are available only when `vim_snippet` is enabled.
154
156
155
157
#### Auto-snippets
156
158
157
- | Trig | Desc | Context Required | Could Disable AutoExpansion | Qt |
158
- | :------: | --------------------------------------------------------- | :---------------------------: | :-------------------------: | :-: |
159
- | ` ctor! ` | Expands to default constructor. | In Class | No | |
160
- | ` dtor! ` | Expands to default destructor. | In Class | No | |
161
- | ` cc! ` | Expands to default copy constructor. | In Class | No | |
162
- | ` mv! ` | Expands to default move constructor. | In Class | No | |
163
- | ` ncc! ` | Expands to delete copy constructor. | In Class | No | |
164
- | ` nmv! ` | Expands to delete move constructor. | In Class | No | |
165
- | ` ncm! ` | Expands to delete copy and move constructor. | In Class | No | |
166
- | ` once ` | Expands to ` pragma once ` marker at the front of the file. | All lines before are comments | Yes | |
167
- | ` u8 ` | Expands to ` uint8_t ` . | No | Yes | |
168
- | ` u16 ` | Expands to ` uint16_t ` . | No | Yes | |
169
- | ` u32 ` | Expands to ` uint32_t ` . | No | Yes | |
170
- | ` u64 ` | Expands to ` uint64_t ` . | No | Yes | |
171
- | ` i8 ` | Expands to ` int8_t ` . | No | Yes | |
172
- | ` i16 ` | Expands to ` int16_t ` . | No | Yes | |
173
- | ` i32 ` | Expands to ` int32_t ` . | No | Yes | |
174
- | ` i64 ` | Expands to ` int64_t ` . | No | Yes | |
175
- | ` t(%s)! ` | Evaluates (QET) marker, and expand to typename. | No | No | |
176
- | ` #" ` | Expands to include statement with quotes. ` #include "" ` . | No | Yes | |
177
- | ` #< ` | Expands to include statement with ` <> ` . ` #include <> ` . | No | Yes | |
178
- | ` #q ` | Expands to include qt generated moc file. | No | Yes | Yes |
159
+ | Trig | Desc | Context Required | Could Disable AutoExpansion | Qt | Support Selection |
160
+ | :------: | --------------------------------------------------------- | :---------------------------: | :-------------------------: | :-: | :---------------: |
161
+ | ` ctor! ` | Expands to default constructor. | In Class | No | | |
162
+ | ` dtor! ` | Expands to default destructor. | In Class | No | | |
163
+ | ` cc! ` | Expands to default copy constructor. | In Class | No | | |
164
+ | ` mv! ` | Expands to default move constructor. | In Class | No | | |
165
+ | ` ncc! ` | Expands to delete copy constructor. | In Class | No | | |
166
+ | ` nmv! ` | Expands to delete move constructor. | In Class | No | | |
167
+ | ` ncm! ` | Expands to delete copy and move constructor. | In Class | No | | |
168
+ | ` once ` | Expands to ` pragma once ` marker at the front of the file. | All lines before are comments | Yes | | |
169
+ | ` u8 ` | Expands to ` uint8_t ` . | No | Yes | | |
170
+ | ` u16 ` | Expands to ` uint16_t ` . | No | Yes | | |
171
+ | ` u32 ` | Expands to ` uint32_t ` . | No | Yes | | |
172
+ | ` u64 ` | Expands to ` uint64_t ` . | No | Yes | | |
173
+ | ` i8 ` | Expands to ` int8_t ` . | No | Yes | | |
174
+ | ` i16 ` | Expands to ` int16_t ` . | No | Yes | | |
175
+ | ` i32 ` | Expands to ` int32_t ` . | No | Yes | | |
176
+ | ` i64 ` | Expands to ` int64_t ` . | No | Yes | | |
177
+ | ` t(%s)! ` | Evaluates (QET) marker, and expand to typename. | No | No | | |
178
+ | ` #" ` | Expands to include statement with quotes. ` #include "" ` . | No | Yes | | |
179
+ | ` #< ` | Expands to include statement with ` <> ` . ` #include <> ` . | No | Yes | | |
180
+ | ` #q ` | Expands to include qt generated moc file. | No | Yes | Yes | |
181
+ | ` #? ` | Expands to ` ifdef ... endif ` fragment. | No | Yes | | Yes |
179
182
180
183
##### Quick Expand Type markers
181
184
@@ -229,6 +232,15 @@ tmss! -> absl::flat_hash_map<std::string, std::string>
229
232
| ` .await ` | Expands to ` co_await ? ` . | ` any_expr ` |
230
233
| ` .in ` | Expands to ` if (...find) ` statements. | ` any_expr ` |
231
234
235
+ #### Cpplint
236
+
237
+ Currently, some snippets will be expanded with cpplint related comments, e.g. ` once ` (which will expand to ` #pragma once // NOLINT(build/header_guard) ` ).
238
+
239
+ You can control whether to add cpplint related comments in these snippets by:
240
+
241
+ - Updating ` snippet.cpp.cpplint ` in your config. This will affect all buffers.
242
+ - Setting buffer variable ` b:LuasnipSnippetsCppCppLint ` . This will only affect the current buffer, and it will override the global setting.
243
+
232
244
</details >
233
245
234
246
<details >
0 commit comments