-
Notifications
You must be signed in to change notification settings - Fork 1
/
vim-rc-local-cpp-style.template
186 lines (159 loc) · 8.32 KB
/
vim-rc-local-cpp-style.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
VimL:" Reminder of C/C++ options, Luc Hermitte <hermitte {at} free {dot} fr>, 02nd Oct 2013
VimL: let s:marker_open = '<+'
VimL: let s:marker_close = '+>'
" ======================[ Project's style ]===================
" This file is meant to be included by a local .vimrc
" ## ======================[ Project's settings {{{1
LetTo p:&sw=4
" LetTo p:&expandtab
LetTo p:&tw=79
LetTo p:&matchpairs+=<:>
" ## ======================[ Naming conventions {{{1
" This is used by lh-refactor, and all lh-cpp snippets for mu-template
" :h lh#naming
" # core variables names {{{2
" (extract any getter, global, ... decoration)
" LetIfUndef p:cpp_naming_strip_subst = '\l\1' " default
" You may have to play with b:cpp_naming_strip_re to remove naming convention not
" handled by default
" # local variables {{{2
"LetIfUndef p:c_naming_local_subst = '\l&' " variable " default
"LetIfUndef p:c_naming_local_subst = 'l_\l&' " l_variable
"LetIfUndef p:c_naming_local_subst = 'l\U&' " lVariable
" # global variables {{{2
"LetIfUndef p:c_naming_global_subst = '\l&' " variable
"LetIfUndef p:c_naming_global_subst = 'g_\l&' " g_variable " default
"LetIfUndef p:c_naming_global_subst = 'g\U&' " gVariable
" # static variables {{{2
"LetIfUndef p:c_naming_static_subst = '\l&' " variable
"LetIfUndef p:c_naming_static_subst = 's_\l&' " s_variable " default
"LetIfUndef p:c_naming_static_subst = 's\U&' " sVariable
" # constants {{{2
"LetIfUndef p:c_naming_constant_subst = '\U&\E' " CONSTANT " default
"LetIfUndef p:c_naming_constant_subst = 'k_\l&' " s_constant
"LetIfUndef p:c_naming_constant_subst = 'k\U&' " sConstant
" # parameters {{{2
"LetIfUndef p:c_naming_param_subst = '&' " parameter " default
"LetIfUndef p:c_naming_param_subst = 'p_\l&' " p_parameter " please, no!
"LetIfUndef p:c_naming_param_subst = '\l&_' " parameter_
" # member variables {{{2
"LetIfUndef p:cpp_naming_member_subst = '\l&' " attribute
"LetIfUndef p:cpp_naming_member_subst = 'm_\l&' " m_attribute " default
"LetIfUndef p:cpp_naming_member_subst = 'm\U&' " mVariable
"LetIfUndef p:cpp_naming_member_subst = 'my\U&' " myVariable
"LetIfUndef p:cpp_naming_member_subst = '\l&_' " attribute_
" # types {{{2
" LetIfUndef p:cpp_naming_type = 'lowerCamelCase' " unusualStuff
" LetIfUndef p:cpp_naming_type = 'UpperCamelCase' " UsualStuff " default
" LetIfUndef p:cpp_naming_type = 'snake_case' " a_la_lib_std
"
" LetIfUndef p:cpp_naming_type_re = '.*'
" LetIfUndef p:cpp_naming_type_subst = '&' " Typename " default
" LetIfUndef p:cpp_naming_type_subst = 'T&' " TTypenname
" LetIfUndef p:cpp_naming_type_subst = '&_t' " Typenname_t
" # functions {{{2
" LetIfUndef p:cpp_naming_function = 'lowerCamelCase' " usualStuff " default
" LetIfUndef p:cpp_naming_function = 'UpperCamelCase' " ALaC#
" LetIfUndef p:cpp_naming_function = 'snake_case' " a_la_lib_std
" # getters {{{2
" LetIfUndef p:cpp_naming_strip_getter = '\l\1' " name()
" LetIfUndef p:cpp_naming_strip_getter = 'get\u&' " getName() " default
" LetIfUndef p:cpp_naming_strip_getter = 'Get\u&' " GetName()
" LetIfUndef p:cpp_naming_strip_getter = 'get_\l&' " get_name()
" # ref getters (total de-encapsulation) {{{2
" LetIfUndef p:cpp_naming_strip_ref_getter = '\l\1' " name()
" LetIfUndef p:cpp_naming_strip_ref_getter = 'get\u&' " getName()
" LetIfUndef p:cpp_naming_strip_ref_getter = 'get_\l&' " get_name()
" LetIfUndef p:cpp_naming_strip_ref_getter = 'ref\u&' " refName() " default
" LetIfUndef p:cpp_naming_strip_ref_getter = 'ref_\l&' " ref_name()
" # proxy getters {{{2
" LetIfUndef p:cpp_naming_strip_ref_getter = '\l\1' " name()
" LetIfUndef p:cpp_naming_strip_ref_getter = 'get\u&' " getName()
" LetIfUndef p:cpp_naming_strip_ref_getter = 'get_\l&' " get_name()
" LetIfUndef p:cpp_naming_strip_ref_getter = 'proxy\u&' " proxyName() " default
" LetIfUndef p:cpp_naming_strip_ref_getter = 'proxy_\l&' " proxy_name()
" # setters {{{2
" LetIfUndef p:cpp_naming_strip_setter = '\l\1' " name(value)
" LetIfUndef p:cpp_naming_strip_setter = 'set\u&' " setName(value) " default
" LetIfUndef p:cpp_naming_strip_setter = 'Set\u&' " SetName(value)
" LetIfUndef p:cpp_naming_strip_setter = 'set_\l&' " set_name(value)
" ## ======================[ lh-refactor options {{{1
" # getter {{{2
" - documentation
" LetIfUndef p:cpp_refactor_getter_doc = '/** ${_ppt_name}\ getter. */\n'
" - new lines or not to introduce getter code
" LetIfUndef p:cpp_refactor_getter_open = ' { ' " default
" LetIfUndef p:cpp_refactor_getter_close = '}'
" LetIfUndef p:cpp_refactor_getter_open = ' {\n' " à la Java
" LetIfUndef p:cpp_refactor_getter_close = '\n}'
" LetIfUndef p:cpp_refactor_getter_open = '\n{\n' " everything on a separate line
" LetIfUndef p:cpp_refactor_getter_close = '\n}'
" # setter {{{2
" - documentation
" LetIfUndef p:cpp_refactor_setter_doc = '/** ${_ppt_name}\ setter. */\n'
" - new lines or not to introduce setter code
" LetIfUndef p:cpp_refactor_setter_open = ' { ' " default
" LetIfUndef p:cpp_refactor_setter_close = '}'
" LetIfUndef p:cpp_refactor_setter_open = ' {\n' " à la Java
" LetIfUndef p:cpp_refactor_setter_close = '\n}'
" LetIfUndef p:cpp_refactor_setter_open = '\n{\n' " everything on a separate line
" LetIfUndef p:cpp_refactor_setter_close = '\n}'
" ## ======================[ Doxygen snippets {{{1
LetIfUndef p:dox_CommentLeadingChar = '*'
LetIfUndef p:dox_TagLeadingChar = '@'
LetIfUndef p:dox_ingroup = '0'
LetIfUndef p:dox_brief = '0'
LetIfUndef p:dox_author_tag = 'author'
LetIfUndef p:dox_author = Author('name')
" ## ======================[ GOTOIMPL code generation of function bodies {{{1
" Possible values:
" 0: In the inline section of the header/current file
" 1: In the inline section of a dedicated inline file
LetIfUndef p:implPlace = 2 " transl. unit (.cpp)
" ShowVirtual = 0 -> '' ; 1 -> '/*virtual*/'
LetIfUndef p:cpp_ShowVirtual = 1
" ShowStatic = 0 -> '' ; 1 -> '/*static*/'
LetIfUndef p:cpp_ShowStatic = 1
" ShowExplicit= 0 -> '' ; 1 -> '/*explicit*/'
LetIfUndef p:cpp_ShowExplicit = 1
" ShowDefaultParam = 0 -> '' ;
" 1 -> default value for params within comments ;
" 2 -> within comment as well, but spaces are trimmed ;
" 3 -> like 2, but the equal sign is not displayed.
LetIfUndef p:cpp_ShowDefaultParam = 1
" Preference regarding where functions definitions are written
"
" Possible Values:
" 0: At the end of the file plus offset (bpg):cpp_FunctionPosArg -- default
" 1: Search for a specific pattern (bpg):cpp_FunctionPosArg
" Useful if you use template skeletons
" 2: Call a user specified function : (bpg):cpp_FunctionPosArg
" Beware! This is a (security) back door.
" 3: Store the value in a temporary variable ; to be used in conjunction
" with :PASTEIMPL -- Robert Kelly IV's approach
" LetIfUndef p:cpp_FunctionPosition = 0
" LetIfUndef p:cpp_FunctionPosArg = 0
" ## ======================[ Misc {{{1
" ¿ Write each '(' on a new line ? -> if \n() ... {}
AddStyle -b ( (
" )) <- used to help vim syntax HL
" ¿ Write each '{' on a new line ? -> if ...() \n {}
AddStyle -b { {
" }} <- used to help vim syntax HL
" AddStyle { -b -ft=c -prio=10 \n{\n
" }} <- used to help vim syntax HL
" ¿ Write each "namespace Foo {" on a same line ?
LetIfUndef p:cpp_multiple_namespaces_on_same_line = 1
" ## ======================[ Expansion of function snippets {{{1
" The following options apply when expanding template-files that generate new
" fonctions.
" NB: not all template-files may respect these parameters. If you found any,
" please contact me (see <http://code.google.com/p/lh-vim/wiki/contact>) as
" this is a bug.
"
" Must we also generate an associated documentation ?
LetIfUndef p:cpp_template_expand_doc = 1
" Ordered list of doxygen tags to write before the main body of the comment
LetIfUndef p:c_pre_desc_ordered_tags = [ "ingroup", "brief", "param", "return", "throw", "invariant", "pre", "post"]
" Ordered list of doxygen tags to write after the main body of the comment
LetIfUndef p:c_post_desc_ordered_tags = ["note", "warning"]