odnsnip - my UltiSnips snippets for D
odsnip is a collection of UltiSnips snippets for the D programming language based on work of
Ferdinand Majerech
- Install UltiSnips
- Get odsnip:
git clone https://github.com/o3o/odsnip.git
- Copy the
d.snippets
file to UltiSnips user snippets directory. On Linux this
should be ~/.vim/UltiSnips
.
|
|
al |
alias |
auto |
auto /variable/ = /value/ |
cast |
cast(/type/) |
con |
const variable = value |
const |
const() |
format |
format(/values/) |
len |
length |
mixin |
mixin |
module |
module |
new |
new |
over |
override |
priv |
private |
pub |
public |
publ |
public: /memeber/ |
pubb |
public {/memeber/} |
ret |
return |
rett |
return /value to return/ |
scope |
scope (exit) |
super |
super(/args/) |
vd |
void |
with |
with () |
|
|
logd |
logDebug |
logdi |
logDiagnostic |
logi |
logInfo |
logw |
logWarn |
loge |
logError |
|
|
lt |
trace |
ltf |
tracef |
li |
info |
lif |
infof |
lw |
warning |
lwf |
warningf |
le |
error |
lef |
errorf |
lc |
critical |
lcf |
criticalf |
|
|
imp |
import list |
impa |
import std.array |
impc |
import std.conv |
impe |
import std.signals |
impex |
import std.exception |
impf |
import std.file |
impi |
import std.stdio |
impl |
import std.experimental.logger |
impo |
import /module/ |
imps |
import std.string |
impu |
import unit_threaded |
impuv |
version(unittest) { import unit_threaded } |
pimp |
public import /module/ |
|
|
seq |
shouldEqual |
saeq |
shouldApproxEqual(/to/) |
sinc |
shouldInclude(/item/) |
sneq |
shouldNotEqual(/to/) |
st |
shouldBeTrue |
sf |
shouldBeFalse |
sn |
shouldBeNull |
sgt |
shouldBeGreaterThan |
sst |
shouldBeSmallerThan |
ssj |
shouldBeSameJsonAs |
snn |
shouldNotBeNull |
sth |
shouldThrow!Exception |
snth |
shouldNotThrow!Exception |
ht |
@HiddenTest(message) |
ut |
@UnitTest |
|
|
imm |
immutable() |
siz |
size_t /variable/ = /value/ |
wr |
writeln() |
wr |
writeln() |
wrf |
writefln() |
|
|
to |
to!/type/(/arg/) |
top |
to!(/type/)(/arg/) |
tos |
to!string() |
tosa |
to!string(/arg/) |
|
|
if |
if (/condition/) |
ifnn |
if (/condition/ !is null) |
ife |
if (/condition/) else |
el |
else { |
elif |
else if (/condition/) |
sif |
static if () |
sw |
switch (/var/) .. case |
fsw |
final switch (/var/) |
case |
case /value/: break |
?: |
/condition/ ? /then/ : /else/ |
|
|
do |
do while |
wh |
while (/condition/) |
for |
for (size_t i = 0; i < count; ++i) |
fori |
for (int i = 0; i < count; ++i) |
fore |
foreach (/elem/; /range/) |
forei |
foreach (i; 0 .. /max/) |
forever |
for (;;) |
forif |
foreach (/elem/; /range/) if(/condition/) |
|
|
req |
assert(var !is null) and assign |
reqn |
assert(var !is null) |
in |
in |
out |
out |
body |
body |
inv |
invariant() |
enf |
enforce(/condition/) |
enfe |
enforce(/condition/,new Exception(/args/)) |
enfa |
enforce(/condition/) ans assegnation |
|
|
fun |
/ret/ /function name/(/args/) @safe pure nothrow |
func |
void /function name/(/args/) @safe pure nothrow |
bar |
/ret/ /function name/(/args/) |
this |
this(/args/) |
get |
getter property |
set |
setter property |
getset |
getter setter property |
getp |
getter property pure |
setp |
setter property pure |
getsetp |
getter setter property pure |
prop |
@property |
main |
void main(string[] args) |
maini |
int main(string[] args) |
|
|
signal |
mixin Signal!(/args/) /name/; |
emit |
emit(/arg/); |
|
|
try |
try , catch |
tryf |
try , catch and finally |
catch |
catch (Exception e) |
thr |
throw new Exception("") |
exc |
Exception class declaration |
|
|
struct |
struct |
union |
union |
class |
class |
inter |
interface |
enum |
enum |
|
|
version |
version () |
versioni |
version (/name/) /code/ |
versionl |
version (linux) |
versionw |
version (Windows) |
versionil |
version (linux) /code/ |
versioniw |
version (Windows) /code/ |
debug |
debug |
|
|
temp |
template /name/(/args/) |
|
|
as |
assert(false) |
asm |
assert(/condition/, "error message") |
asn |
assert(/var !is null/) |
sas |
static assert(false) |
|
|
fix |
// FIX: |
todo |
// TODO: |
sdc |
Short sdoc block |
doc |
Generic sdoc block |
fdoc |
Function ddoc block |
fsdoc |
Short function ddoc block |
Pars |
Params ddoc block |
Par |
Params inline |
Ret |
Returns |
Thr |
Throws |
Example |
Examples |
doff |
// dfmt off |
don |
// dfmt on |
|
|
gpl |
GPL License |
boost |
Boost License |
vibe.log vs phobos experimental.logger
Vibe |
Phobos |
trace |
|
debugV |
|
debug_ |
|
diagnostic |
trace |
info |
info |
warn |
warning |
error |
error |
critical |
critical |
fatal |
fatal |
none |
off |