turbo-editors/configspublic Fork 0
main
Commits
Clone
git clone https://git.rickub.com/turbo-editors/configs.git
git clone ssh://git@rickub.com/turbo-editors/configs.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

🛟 Updated. a3c787d · on main · k33g · 8h ago
snippets.toml · 59 lines · 1.3 KBTOML Blame HistoryRaw
 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
# turbo-rust snippets.
#
# Each [[snippet]] becomes one line of the Snippets menu. Snippets sharing a
# group appear together in a submenu of that name; one with no group goes into
# General. A snippet is inserted at the cursor, and every line after the
# first is indented to match the line you inserted it on.
#
# languages restricts a snippet to files of those kinds, by the names the
# editor uses: rust, toml, yaml, markdown, javascript, html, xml, dockerfile,
# bash. Leave it out and the snippet is offered everywhere.
#
# Your own snippets, shared across every project, go in:
#   /Users/k33g/Library/Application Support/turbo-rust/snippets.toml

[[snippet]]
name = "match"
group = "Rust"
languages = ["rust"]
body = """
match value {
    Some(v) => v,
    None => return,
}"""

[[snippet]]
name = "if let"
group = "Rust"
languages = ["rust"]
body = """
if let Some(v) = value {
}"""

[[snippet]]
name = "propagate the error"
group = "Rust"
languages = ["rust"]
body = "let value = fallible()?;"

[[snippet]]
name = "derive"
group = "Rust"
languages = ["rust"]
body = "#[derive(Debug, Clone, PartialEq)]"

[[snippet]]
name = "test module"
group = "Rust"
languages = ["rust"]
body = """
#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn it_works() {
        assert_eq!(1 + 1, 2);
    }
}"""