- Options types
- Option list
(bpg):cpp_always_a_destructor_when_there_is_a_pointer_attribute'(bpg):cpp_std_flavourand$CXXFLAGS(bpg):({ft}_)FunctionPosArg,(bpg):({ft}_)FunctionPosition(bpg):({ft}_)ShowDefaultParams,(bpg):({ft}_)ShowExplicit,(bpg):({ft}_)ShowStatic,(bpg):({ft}_)ShowVirtual(bpg):accessor_comment_get,(bpg):accessor_comment_set,(bpg):accessor_comment_ref(bpg):({ft}_)alternateSearchPath(bpg):cpp_begin_end_includes(bpg):cpp_begin_end_style(bpg):c_menu_name,(bpg):c_menu_priority,(bpg):cpp_menu_name,(bpg):cpp_menu_priority(bpg):cpp_defaulted(bpg):cpp_defines_to_ignore(bpg):cpp_deleted(bpg):cpp_noexcept(bpg):cpp_noncopyable_class(bpg):cpp_nullptr(bpg):cpp_explicit_default(bpg):cpp_make_ptr(bpg):cpp_noexcept(bpg):cpp_return_ptr_type(bpg):cpp_root_exception(bpg):cpp_use_copy_and_swap(bpg):cpp_use_nested_namespacesg:c_no_assign_in_conditiong:c_no_hl_fallthrough_caseg:cpp_no_catch_by_referenceg:cpp_no_hl_c_castg:cpp_no_hl_funcdefg:cpp_no_hl_throw_spec(bpg):({ft}_)array_size(bpg):({ft}_)exception_args(bpg):({ft}_)exception_type(bpg):({ft}_)ext_4_impl_file(bpg):({ft}_)file_regex_for_inclusion(bpg):({ft}_)filename_simplify_for_inclusion(bpg):({ft}_)gcov_files_path(bpg):({ft}_)guard_headers_with(bpg):({ft}_)implPlaceg:inlinesPlace(bpg):({ft}_)includes(bpg):({ft}_)multiple_namespaces_on_same_line(bpg):({ft}_)nl_before_bracket(deprecated)(bpg):({ft}_)nl_before_curlyB(deprecated)(bpg):({ft}_)pre_desc_ordered_tags,(bpg):({ft}_post_desc_ordered_tags)(bpg):({ft}_)project_namespace(bpg):({ft}_)tag_kinds_for_inclusion(bpg):tags_select(bpg):({ft}_)template_expand_doc(bpg):xsltproc- Doxygen related options
They are best set from the .vimrc;
They are best set from a local_vimrc file;
See
lh-vim-lib
regarding p:options.
Their default value can be set in the .vimrc, but its best to set them from a
local_vimrc file;
lh-dev options: (bpg):[{filetype}__]{option-name}
Boolean option that enforces the expansion of a destructor in classes that have pointer attributes, even when it isn't required.
Default value: 0 (false)
See:
lh#cpp#snippets#_this_param_requires_a_destructorwhich is used in turn by ...lh#cpp#snippets#requires_destructorwhich is used in turn by ...cpp/internals/class-skeleton.template
These options are exploited by C++ flavour decoding functions
The expected values for (bpg):cpp_std_flavour are "03", "05" (TR1), "11", "14", or "17".
Other values will lead into Unspecified Behaviour.
warning: "98" is not a valid value.
If (bpg):cpp_std_flavour is not set, the flavour will be extracted from the
-std= option in $CXXFLAGS or else from the CMake $CMAKE_CXXFLAGS option.
Valid values are -std=c++98, -std=c++03, -std=c++0x, -std=c++11,
-std=c++1y, -std=c++14, -std=c++1z, -std=c++17 (the -std=gnu++xx
ones are also handled)
Note: The $CMAKE_CXXFLAGS option is obtained thanks to
lh-cmake. BTW, this plugin is not
automatically installed with lh-cpp (if you are using a dependencies aware
plugin manager like VAM or vim-flavor ; with dependencies unaware plugin
managers, you'll will also have to install it as well)
Determines where the default implementation, for a function not yet defined,
should be placed by :GOTOIMPL. We are placed ...
- 0 -> ... at
cpp_FunctionPosArglines from the end of the file. - 1 -> ... at the line after the first occurrence of the pattern
cpp_FunctionPosArg. By default, we are placed after: >
/*============*/
/*===[ «» ]===*/
/*============*/That I use to insert with :BLINES
- 2 -> ... according the hook (user-defined VimL-function)
cpp_FunctionPosArg. By default, we are asked for a title (actually a regex pattern), and placed after:
/*=====================*/
/*===[ {the_title} ]===*/
/*=====================*/... That I still use to insert with |:BLINES|
- 3 -> ... nowhere, and nothing is inserted. The insertion must be done
manually thanks to
:PASTEIMPL.
(bpg):({ft}_)ShowDefaultParams, (bpg):({ft}_)ShowExplicit, (bpg):({ft}_)ShowStatic, (bpg):({ft}_)ShowVirtual
Boolean options used by :GOTOIMPL. They tells whether
the C++ keywords explicit, static or virtual shall be kept in the empty
implementation skeleton generated for a function declaration. Same thing for
default parameter values.
Default values to all: 1 (true)
Strings to customize the comments inserted on :ADDATTRIBUTE.
"%a" will be substituted with the name of the attribute.
Tells how to alternate between a source file and a header file.
Default value: 'sfr:../source,sfr:../src,sfr:../include,sfr:../inc'
According to alternate.vim documentation:
A path with a prefix of "wdr:" will be treated as relative to the working
directory (i.e. the directory where vim was started.) A path prefix of "abs:"
will be treated as absolute. No prefix or "sfr:" will result in the path
being treated as relative to the source file (see sfPath argument).
A prefix of "reg:" will treat the pathSpec as a regular expression
substitution that is applied to the source file path. The format is:
reg:<sep><pattern><sep><subst><sep><flag><sep>
<sep>seperator character, we often use one of[/|%#]<pattern>is what you are looking for<subst>is the output pattern<flag>can begfor global replace or empty
EXAMPLE: 'reg:/inc/src/g/' will replace every instance of 'inc' with
'src' in the source file path. It is possible to use match variables so you
could do something like:
'reg:|src/\([^/]*\)|inc/\1||'
(see help :substitute, help pattern and help sub-replace-special for more
details)
NOTE: a.vim uses , (comma) internally so DON'T use it in your regular
expressions or other pathSpecs unless you update the rest of the a.vim code to
use some other seperator.mentation:
Tells which header files shall be includes when expanding begin()/end().
This option is meant to override the include files returned by
lh#cpp#snippets#_include_begin_end().
See: CTRL-X_be, CTRL-X_cbe, CTRL-X_rbe, CTRL-X_crbe, cpp/b-e snippet
Tells which style to use to generate a couple of calls to begin()/end():
- "
c++98": ->container.begin() - "
std": ->std::begin(container) - "
boost": ->boost::begin(container) - "
adl": ->begin(container)
See: CTRL-X_be, CTRL-X_cbe, CTRL-X_rbe, CTRL-X_crbe, cpp/b-e snippet
These options tells where the |menu| for all C and C++ item goes.
See :h :menu
String option.
Default Value: = default
See: API function
lh#cpp#snippets#defaulted()
Regex (default: none) that specifies which patterns (#define) shall be
ignored when parsing the source code to detect the current scope
(ns1::..::nsn::cl1::.....cln).
See: API functions
String option.
Default Value: = delete
See: API function lh#cpp#snippets#deleted()
String format option (for
lh#fmt#printf())
Default Value: noexcept%1 in C++11, throw() in C++98
See:
lh#fmt#printf())- API function
lh#cpp#snippets#nullptr()
Policy option that is used to tell how classes are made non-copyable.
- by inheriting from a dedicated noncopyable class.
{"name": "ITK::NonCopyable", "include": "<itkNoncopyable.h>"}
If the class is known by the type database , there is no need to explicit which file shall be included:
{"name": "boost:noncopyable"}
- by explictly deleting copy operations (with
= deletein C++11, or with declared but undefined private copy operations). This done by setting the option to an empty string.
Default value: {"name": "boost:noncopyable"}
See:
Returned by lh#cpp#snippets#nullptr().
Default Value: nullptr in C++11, 0 in C++98/03.
Other Typical values: NULL, `ITK_NULLPTR_, etc.
See: API function lh#cpp#snippets#nullptr()
Boolean option that forces to explicitly add = default in snippets when C++11
is detected.
Warning: For now, this option has priority over
(bpg):cpp_noncopyable_class. i.e. deleted copy operations will still appear even if the class inherits from a non-copyable class.
Default value: undefined (=> ask the user)
See:
lh#cpp#snippets#shall_explicit_defaults()which encapsulates its use.cpp/internals/class-skeleton.templatewhich uses its result
String format option for lh#fmt#printf()).
It tells how pointers are best created. Used only from cpp/clonable-clas.template snippet.
Default Value:
- C++14:
std::make_unique(%3) - C++11:
std::unique_ptr<%2>(new %2(%3)) - C++98:
std::auto_ptr<%1>(new %2(%3))
See:
- cpp/clonable-clas.template which uses it
(bpg):cpp_return_ptr_type
String format option (for
lh#fmt#printf())
Default Value: override in C++11, /* override */ in C++98
See:
String format option for printf() (TODO: migrate to lh#fmt#printf())).
It tells how pointers are best returned from functions. Used only from cpp/clonable-clas.template snippet.
Default Value:
- C++11:
std::unique_ptr<> - C++98:
std::auto_ptr<>
See:
- cpp/clonable-clas.template which uses it
(bpg):cpp_make_ptr
TDB
Boolean option that suggest to use copy-and-swap idiom when expanding assignment-operator snippet directly, or indirectly through value classes snippets.
Default value: 0 (false)
See:
cpp/assignment-operator.templatewhich uses it directlycpp/internals/class-skeleton.templatewhich uses it indirectly
Boolean option that enables the generation of nested namespaces in C++17
codes with namespace snippet.
Default value: is 1 (true).
Boolean option that disables syntax highlighting that detects assignments in conditions.
Default value: is 0 (false).
Boolean option that disables syntax highlighting that detects uses of case
that fall through other cases.
This feature isn't detecting correctly situation like: break; } case, that
why it's disabled for the moment.
Default value: is 1 (true).
Boolean option that disables syntax highlighting that detects exceptions caught by value.
Default value: is 0 (false).
Boolean option that disables syntax highlighting that detects C casts in C++.
Default value: is 0 (false).
Boolean option that disables syntax highlighting that hightlight function definitions.
Default value: is 0 (false).
Boolean option that disables syntax highlighting that detects throw specifications in C++.
Default value: is 0 (false).
Tells how [cpp/array_size](snippets.md#cpparray_size) snippet shall behave.
This variable is meant to be a dictionary than contains the following entries:
"file": Filename to be included."funcname": Text to be included when the snippet is expanded. The special"%1"placeholder will be replaced with the array name.
Default value: not defined
See:
Arguments to inject in the exception called in
throw snippet.
Exception type to use in snippets like the
throw snippet.
Default is std::runtime_error
Tells the extension to use when :GOTOIMPL generates a
new implementation skeleton for a function.
Default is ".cpp".
Regex used by API function lh#cpp#tags#fetch() to
filter filenames to keep.
Default value: "\.h"
Tells API function
lh#cpp#tags#strip_included_paths()
how to simplify filenames with |fnamemodify()|.
Default value: ":t"
This option tells where gcov files are expected. The default value is the same path as the one where the current file is.
See: <localleader>g which permits to swap between a .gcov file and its
source.
This option tells how multiple inclusions of header files is prevented. This
can be done with (portable) #ifndef SOME_GUARD + #define SOME_GUARD, or
with #pragma once (non-standard) directive.
Valid values for this option are: ifndef, ifndef,pragma, or pragma
Note: This option is actually used by the default template-file from mu-template.
Tells where a generated accessor shall go (with :ADDATTRIBUTE):
- 0 -> Near the prototype/definition (Java's way)
- 1 -> Within the inline section of the header/inline/current file
- 2 -> Within the implementation file (.cpp)
- 3 -> Use the pimpl idiom (In the Todo-List)
Where inlines are written on :ADDATTRIBUTE
- 0 -> In the inline section of the header/current file
- 1 -> In the inline section of a dedicated inline file
Option used by the C-ftplugin that completes the names of files to include. The options tells which directories shall be searched.
Default value: is vim option &path
See: <PlugCompleteIncludes> (i_CTRL-X_I) and <Plug>OpenIncludes
(n_CTRL_L)
Boolean option wrapped into API function
lh#cpp#option#multiple_namespaces_on_same_line().
Default value: 1 (true)
Permits snippets like namespace to write all names
on a same line (when nested namespaces aren't supported). i.e:
// If true
namespace ns1 { namespace ns2 {
} } // namespaces ns1::ns2
// If false
namespace ns1 {
namespace ns2 {
} // namespace ns1::ns2
} // namespace ns1In function-comment snippet, these |List|
options tell in which order the various documentation information are inserted
around the description the user will have to type:
The default before the user typed information is:
- "ingroup", "brief", "tparam", "param", "return", "throw", "invariant", "pre", "post"
The default after the user typed information is:
- "note", "warning"
Name of the project namespace used by the snippet
namespace.
Default value: the placeholder «ns»
This is also what is returned by API function
lh#cpp#snippets#current_namespace()
-- in that case, the default value used is an empty string.
Regex used by API function lh#cpp#tags#fetch() to
filter tags kind to keep.
Default value: "[dfptcs]"
Tags selection policy used by API function lh#cpp#tags#fetch().
Default value: "expand('<cword>')".
Boolean option used in snippets to tell whether documentation generation is required.
See:
Path to where the executable xsltproc is.
Default Value: xsltproc.
This options is used by the C-ftplugin that converts PVS-studio output into a format compatible with quickfix.
See: :PVSLoad, :PVSIgnore, :PVSShow and :PVSRedraw
Tells which character to use on each line of a Doxygen comment.
Default value: "*"
Wrapped in API function
lh#dox#comment_leading_char()
Tells which character to use on each line of a Doxygen comment.
Default value: "*". Other typical value: "!"
Wrapped in API function
lh#dox#tag_leading_char()
Tells which tag to use to introduce authors.
Default value: "author".
Wrapped in API function lh#dox#author()
Returns the default value to use as the author tagged in Doxygen comments.
Default value: None
Wrapped in API function lh#dox#author()
Tells if brief tag shall be used.
Default value: "short".
Other possible values: "yes"/"always"/"1", "no"/"never"/"0"/"short"
Wrapped in API function lh#dox#brief()
Default Doxygen group name used in snippets and templates.
Default value: the placeholder «Project»
See:
Tells if ingroup tag shall be used.
Default value: "0".
Other possible values: "yes"/"always"/"1", "no"/"never"/"0", or a group
name to use.
Wrapped in API function lh#dox#ingroup()
Tells which character use between a tag and its value.
Default value: " ". Other typical value: "\t"
Wrapped in API function lh#dox#tag()
Tells which tag name to use to document exceptions.
Default value: "throw". Other typical value: "exception"
Wrapped in API function lh#dox#throw()
Version of the project. Can be used in Doxygen comment through API function
lh#dox#since().
Used in lh#dev#cpp#types#const_correct_type()
Default: true