@@ -59,6 +59,8 @@ Config Example:
5959 },
6060 -- enable qt-related snippets
6161 qt = true ,
62+ -- whether to add cpplint related comments in some snippets
63+ cpplint = true ,
6264 },
6365 },
6466 rust = {
@@ -154,28 +156,29 @@ Snippets with `*` are available only when `vim_snippet` is enabled.
154156
155157#### Auto-snippets
156158
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 |
179182
180183##### Quick Expand Type markers
181184
@@ -229,6 +232,15 @@ tmss! -> absl::flat_hash_map<std::string, std::string>
229232| ` .await ` | Expands to ` co_await ? ` . | ` any_expr ` |
230233| ` .in ` | Expands to ` if (...find) ` statements. | ` any_expr ` |
231234
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+
232244</details >
233245
234246<details >
0 commit comments