Difference between revisions of "Abbreviations plugin"
From Code::Blocks
m |
m (Formatting.) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
'''Abbreviations''' provides auto-completion (note that this has nothing to do with [[Code Completion plugin|code completion]]). It is invoked by the keyboard shortcut '''Ctrl-J''' after typing a keyword. (For more complex macros see the [[KeyMacs plugin]].) | '''Abbreviations''' provides auto-completion (note that this has nothing to do with [[Code Completion plugin|code completion]]). It is invoked by the keyboard shortcut '''Ctrl-J''' after typing a keyword. (For more complex macros see the [[KeyMacs plugin]].) | ||
* The <code>|</code> (pipe) symbol will determine the location of the cursor. | * The <code>|</code> (pipe) symbol will determine the location of the cursor. | ||
− | * Macros like <code>$( | + | * Macros like <code>$(my·macro)</code> can be added, and will ask for user substitution on use. |
− | * Macros such as <code>$NOW</code> are replaced with | + | * Macros such as <code>$NOW</code> are replaced with their [[Variable expansion#Time and date|actual value]]. |
+ | ''Note: spaces have been shown as ''<code>·</code>'' (dots) to aid visibility.'' | ||
==Included keywords== | ==Included keywords== | ||
* class | * class | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
class·$(Class·name)| | class·$(Class·name)| | ||
{ | { | ||
Line 30: | Line 31: | ||
* guard | * guard | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
− | # | + | #ifndef·$(Guard·token) |
− | # | + | #define·$(Guard·token) |
| | | | ||
Line 42: | Line 43: | ||
* if | * if | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
if·(|) | if·(|) | ||
····; | ····; | ||
Line 50: | Line 51: | ||
* ifb | * ifb | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
if·(|) | if·(|) | ||
{ | { | ||
Line 60: | Line 61: | ||
* ife | * ife | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
if·(|) | if·(|) | ||
{ | { | ||
Line 74: | Line 75: | ||
* ifei | * ifei | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
if·(|) | if·(|) | ||
{ | { | ||
Line 92: | Line 93: | ||
* for | * for | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
for·(|;·;·) | for·(|;·;·) | ||
····; | ····; | ||
Line 100: | Line 101: | ||
* forb | * forb | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
for·(|;·;·) | for·(|;·;·) | ||
{ | { | ||
Line 110: | Line 111: | ||
* now | * now | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
$NOW | $NOW | ||
</source> | </source> | ||
Line 117: | Line 118: | ||
* nowl | * nowl | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
$NOW_L | $NOW_L | ||
</source> | </source> | ||
Line 124: | Line 125: | ||
* nowlu | * nowlu | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
$NOW_L_UTC | $NOW_L_UTC | ||
</source> | </source> | ||
Line 131: | Line 132: | ||
* nowu | * nowu | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
$NOW_UTC | $NOW_UTC | ||
</source> | </source> | ||
Line 138: | Line 139: | ||
* struct | * struct | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
struct·| | struct·| | ||
{ | { | ||
Line 148: | Line 149: | ||
* switch | * switch | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
switch·(|) | switch·(|) | ||
{ | { | ||
Line 162: | Line 163: | ||
* tday | * tday | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
$TDAY | $TDAY | ||
</source> | </source> | ||
Line 169: | Line 170: | ||
* tdayu | * tdayu | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
$TDAY_UTC | $TDAY_UTC | ||
</source> | </source> | ||
Line 176: | Line 177: | ||
* today | * today | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
$TODAY | $TODAY | ||
</source> | </source> | ||
Line 183: | Line 184: | ||
* todayu | * todayu | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
$TODAY_UTC | $TODAY_UTC | ||
</source> | </source> | ||
Line 190: | Line 191: | ||
* wdu | * wdu | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
$WEEKDAY_UTC | $WEEKDAY_UTC | ||
</source> | </source> | ||
Line 197: | Line 198: | ||
* while | * while | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
while·(|) | while·(|) | ||
····; | ····; | ||
Line 205: | Line 206: | ||
* whileb | * whileb | ||
<div style="margin-left: 2em;"> | <div style="margin-left: 2em;"> | ||
− | <source lang="cpp"> | + | <source lang="cpp" enclose="div"> |
while·(|) | while·(|) | ||
{ | { |
Latest revision as of 21:43, 17 March 2012
Abbreviations provides auto-completion (note that this has nothing to do with code completion). It is invoked by the keyboard shortcut Ctrl-J after typing a keyword. (For more complex macros see the KeyMacs plugin.)
- The
|
(pipe) symbol will determine the location of the cursor. - Macros like
$(my·macro)
can be added, and will ask for user substitution on use. - Macros such as
$NOW
are replaced with their actual value.
Note: spaces have been shown as ·
(dots) to aid visibility.
Included keywords
- class
class·$(Class·name)|
{
public:
····$(Class·name)();
····~$(Class·name)();
protected:
private:
};
- guard
#ifndef·$(Guard·token)
#define·$(Guard·token)
|
#endif·//·$(Guard·token)
- if
if·(|)
····;
- ifb
if·(|)
{
····
}
- ife
if·(|)
{
····
}
else
{
····
}
- ifei
if·(|)
{
····
}
else·if·()
{
····
}
else
{
····
}
- for
for·(|;·;·)
····;
- forb
for·(|;·;·)
{
····
}
- now
$NOW
- nowl
$NOW_L
- nowlu
$NOW_L_UTC
- nowu
$NOW_UTC
- struct
struct·|
{
····
};
- switch
switch·(|)
{
case·:
····break;
default:
····break;
}
- tday
$TDAY
- tdayu
$TDAY_UTC
- today
$TODAY
- todayu
$TODAY_UTC
- wdu
$WEEKDAY_UTC
- while
while·(|)
····;
- whileb
while·(|)
{
····
};