turbo-editors/configspublic Fork 0
a3c787d5a663a53653680e06a06138b0a1e64a2c
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.

snippets.toml · 59 lines · 1.3 KBTOML Blame HistoryRaw
🛟 Updated. a3c787d k33g 11h 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# General. 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# /Users/k33g/Library/Application Support/turbo-rust/snippets.toml
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