turbo-editors/turbo-rustpublic Fork 0
v1.0.0
Commits
Clone
git clone https://git.rickub.com/turbo-editors/turbo-rust.git
git clone ssh://git@rickub.com/turbo-editors/turbo-rust.git

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

snippets.toml.tmpl · 69 lines · 1.4 KBCheetah Blame HistoryRaw
📦 Turbo Rust 713ea5c k33g 12h ago1# turbo-rust snippets.
2#
3# Each [[snippet]] becomes one line of the Snippets menu. Snippets sharing a
4# group appear together in a submenu of that name; one with no group goes into
5# %s. A snippet is inserted at the cursor, and every line after the
6# first is indented to match the line you inserted it on.
7#
8# languages restricts a snippet to files of those kinds, by the names the
9# editor uses: rust, toml, yaml, markdown, javascript, html, xml, dockerfile,
10# bash. Leave it out and the snippet is offered everywhere.
11#
12# Your own snippets, shared across every project, go in:
13# %s
14
15[[snippet]]
16name = "match"
17group = "Rust"
18languages = ["rust"]
19body = """
20match value {
21 Some(v) => v,
22 None => return,
23}"""
24
25[[snippet]]
26name = "if let"
27group = "Rust"
28languages = ["rust"]
29body = """
30if let Some(v) = value {
31}"""
32
33[[snippet]]
34name = "propagate the error"
35group = "Rust"
36languages = ["rust"]
37body = "let value = fallible()?;"
38
39[[snippet]]
40name = "derive"
41group = "Rust"
42languages = ["rust"]
43body = "#[derive(Debug, Clone, PartialEq)]"
44
45[[snippet]]
46name = "test module"
47group = "Rust"
48languages = ["rust"]
49body = """
50#[cfg(test)]
51mod tests {
52 use super::*;
53
54 #[test]
55 fn it_works() {
56 assert_eq!(1 + 1, 2);
57 }
58}"""
59
60[[snippet]]
61group = "General"
62name = "Hello"
63body = "Hello!!!"
64
65[[snippet]]
66group = "Markdown"
67name = "Image"
68languages = ["markdown"]
69body = "![img](./pictures)"