diff options
| author | Simeon Simeonov | 2025-02-28 18:30:17 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2025-02-28 18:30:17 +0100 |
| commit | bcd993046ffaa3390bcf3252db8ba69d4610191c (patch) | |
| tree | 2f7fcfe1ed46f224119bc97346d6036c0504766b /.emacs.d/snippets/rust-mode | |
| parent | f6a91e549fe34f047acdb03e806e0f7dce9ffce1 (diff) | |
Add snippets/rust-mode and upgrade markdown-mode
Diffstat (limited to '.emacs.d/snippets/rust-mode')
66 files changed, 432 insertions, 0 deletions
diff --git a/.emacs.d/snippets/rust-mode/afn b/.emacs.d/snippets/rust-mode/afn new file mode 100644 index 0000000..9ed1d9c --- /dev/null +++ b/.emacs.d/snippets/rust-mode/afn | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: async fn name() { ... } | ||
| 3 | # key: afn | ||
| 4 | # -- | ||
| 5 | async fn ${1:name}($2) { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/afnr b/.emacs.d/snippets/rust-mode/afnr new file mode 100644 index 0000000..71cbbbd --- /dev/null +++ b/.emacs.d/snippets/rust-mode/afnr | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: async fn name() -> Type { ... } | ||
| 3 | # key: afnr | ||
| 4 | # -- | ||
| 5 | async fn ${1:name}($2) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/afns b/.emacs.d/snippets/rust-mode/afns new file mode 100644 index 0000000..c88e672 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/afns | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: async fn name(&self) -> Type { ... } | ||
| 3 | # key: afns | ||
| 4 | # -- | ||
| 5 | async fn ${1:name}(${2:&self}) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/afnw b/.emacs.d/snippets/rust-mode/afnw new file mode 100644 index 0000000..3c358f8 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/afnw | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: async fn name<T>(x: T) where T: Clone { ... } | ||
| 3 | # key: afnw | ||
| 4 | # -- | ||
| 5 | async fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/allow b/.emacs.d/snippets/rust-mode/allow new file mode 100644 index 0000000..c30c1e8 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/allow | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[allow(lint)] | ||
| 3 | # key: allow | ||
| 4 | # -- | ||
| 5 | #[allow(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/allow! b/.emacs.d/snippets/rust-mode/allow! new file mode 100644 index 0000000..cfb0c7d --- /dev/null +++ b/.emacs.d/snippets/rust-mode/allow! | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #![allow(lint)] | ||
| 3 | # key: allow! | ||
| 4 | # -- | ||
| 5 | #![allow(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/assert b/.emacs.d/snippets/rust-mode/assert new file mode 100644 index 0000000..d1252d0 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/assert | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: assert!(predicate); | ||
| 3 | # key: ass | ||
| 4 | # -- | ||
| 5 | assert!(${1:predicate}); \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/asserteq b/.emacs.d/snippets/rust-mode/asserteq new file mode 100644 index 0000000..7bfafd2 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/asserteq | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: assert_eq!(expected, actual); | ||
| 3 | # key: asseq | ||
| 4 | # -- | ||
| 5 | assert_eq!(${1:expected}, ${2:actual}); \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/case b/.emacs.d/snippets/rust-mode/case new file mode 100644 index 0000000..9ea6609 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/case | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pattern => expression, | ||
| 3 | # key: case | ||
| 4 | # -- | ||
| 5 | ${1:pattern} => ${2:expression}, \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/cfg b/.emacs.d/snippets/rust-mode/cfg new file mode 100644 index 0000000..583e021 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/cfg | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[cfg(option)] | ||
| 3 | # key: cfg | ||
| 4 | # -- | ||
| 5 | #[cfg(${1:option})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/cfg= b/.emacs.d/snippets/rust-mode/cfg= new file mode 100644 index 0000000..b01a458 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/cfg= | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[cfg(option = "value")] | ||
| 3 | # key: cfg= | ||
| 4 | # -- | ||
| 5 | #[cfg(${1:option} = "${2:value}")] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/closure b/.emacs.d/snippets/rust-mode/closure new file mode 100644 index 0000000..1624d57 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/closure | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: closure | ||
| 3 | # key: || | ||
| 4 | # -- | ||
| 5 | |${1:arguments}| { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/crate b/.emacs.d/snippets/rust-mode/crate new file mode 100644 index 0000000..ee9371e --- /dev/null +++ b/.emacs.d/snippets/rust-mode/crate | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: extern crate | ||
| 3 | # key: ec | ||
| 4 | # -- | ||
| 5 | extern crate ${1:name}; | ||
diff --git a/.emacs.d/snippets/rust-mode/deny b/.emacs.d/snippets/rust-mode/deny new file mode 100644 index 0000000..5b7f3d9 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/deny | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[deny(lint)] | ||
| 3 | # key: deny | ||
| 4 | # -- | ||
| 5 | #[deny(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/deny! b/.emacs.d/snippets/rust-mode/deny! new file mode 100644 index 0000000..232dfbc --- /dev/null +++ b/.emacs.d/snippets/rust-mode/deny! | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #![deny(lint)] | ||
| 3 | # key: deny! | ||
| 4 | # -- | ||
| 5 | #![deny(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/derive b/.emacs.d/snippets/rust-mode/derive new file mode 100644 index 0000000..581c86f --- /dev/null +++ b/.emacs.d/snippets/rust-mode/derive | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[derive(Trait)] | ||
| 3 | # key: derive | ||
| 4 | # -- | ||
| 5 | #[derive(${1:Trait})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/display b/.emacs.d/snippets/rust-mode/display new file mode 100644 index 0000000..1764f67 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/display | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl Display for Type { fn fmt (...) } | ||
| 3 | # key: display | ||
| 4 | # -- | ||
| 5 | impl Display for ${1:Type} { | ||
| 6 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { | ||
| 7 | write!(f, "$0") | ||
| 8 | } | ||
| 9 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/drop b/.emacs.d/snippets/rust-mode/drop new file mode 100644 index 0000000..ba23a5b --- /dev/null +++ b/.emacs.d/snippets/rust-mode/drop | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl Drop for Type { fn drop(...) } | ||
| 3 | # key: drop | ||
| 4 | # -- | ||
| 5 | impl Drop for ${1:Type} { | ||
| 6 | fn drop(&mut self) { | ||
| 7 | $0 | ||
| 8 | } | ||
| 9 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/enum b/.emacs.d/snippets/rust-mode/enum new file mode 100644 index 0000000..acf919b --- /dev/null +++ b/.emacs.d/snippets/rust-mode/enum | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: enum Type { ... } | ||
| 3 | # key: enum | ||
| 4 | # -- | ||
| 5 | enum ${1:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/eprint b/.emacs.d/snippets/rust-mode/eprint new file mode 100644 index 0000000..a40a749 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/eprint | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: eprint!("{}", value); | ||
| 3 | # key: eprint | ||
| 4 | # -- | ||
| 5 | eprint!("${1:{\}}", $2); | ||
diff --git a/.emacs.d/snippets/rust-mode/eprintln b/.emacs.d/snippets/rust-mode/eprintln new file mode 100644 index 0000000..0806251 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/eprintln | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: eprintln!("{}", value); | ||
| 3 | # key: eprintln | ||
| 4 | # -- | ||
| 5 | eprintln!("${1:{\}}", $2); | ||
diff --git a/.emacs.d/snippets/rust-mode/fn b/.emacs.d/snippets/rust-mode/fn new file mode 100644 index 0000000..459fd49 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fn | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fn name() { ... } | ||
| 3 | # key: fn | ||
| 4 | # -- | ||
| 5 | fn ${1:name}($2) { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/fnr b/.emacs.d/snippets/rust-mode/fnr new file mode 100644 index 0000000..fa98eb2 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fnr | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fn name() -> Type { ... } | ||
| 3 | # key: fnr | ||
| 4 | # -- | ||
| 5 | fn ${1:name}($2) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/fns b/.emacs.d/snippets/rust-mode/fns new file mode 100644 index 0000000..23fada7 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fns | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fn name(&self) -> Type { ... } | ||
| 3 | # key: fns | ||
| 4 | # -- | ||
| 5 | fn ${1:name}(${2:&self}) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/fnw b/.emacs.d/snippets/rust-mode/fnw new file mode 100644 index 0000000..321c292 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fnw | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fn name<T>(x: T) where T: Clone { ... } | ||
| 3 | # key: fnw | ||
| 4 | # -- | ||
| 5 | fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/for b/.emacs.d/snippets/rust-mode/for new file mode 100644 index 0000000..66dca09 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/for | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: for var in iterable { ... } | ||
| 3 | # key: for | ||
| 4 | # -- | ||
| 5 | for ${1:var} in ${2:iterable} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/from b/.emacs.d/snippets/rust-mode/from new file mode 100644 index 0000000..9e86209 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/from | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl From<From> for Type { fn from(...) } | ||
| 3 | # key: from | ||
| 4 | # -- | ||
| 5 | impl From<${1:From}> for ${2:Type} { | ||
| 6 | fn from(source: $1) -> Self { | ||
| 7 | $0 | ||
| 8 | Self { } | ||
| 9 | } | ||
| 10 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/fromstr b/.emacs.d/snippets/rust-mode/fromstr new file mode 100644 index 0000000..891751c --- /dev/null +++ b/.emacs.d/snippets/rust-mode/fromstr | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl FromStr for Type { fn from_str(...) } | ||
| 3 | # key: fromstr | ||
| 4 | # -- | ||
| 5 | impl FromStr for ${1:Type} { | ||
| 6 | type Err = ${2:Error}; | ||
| 7 | |||
| 8 | fn from_str(s: &str) -> Result<Self, Self::Err> { | ||
| 9 | Ok(Self{}) | ||
| 10 | } | ||
| 11 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/if b/.emacs.d/snippets/rust-mode/if new file mode 100644 index 0000000..c793ace --- /dev/null +++ b/.emacs.d/snippets/rust-mode/if | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: if expr { ... } | ||
| 3 | # key: if | ||
| 4 | # -- | ||
| 5 | if ${1:expression} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/ife b/.emacs.d/snippets/rust-mode/ife new file mode 100644 index 0000000..12f2b56 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/ife | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: if expression { ... } else { .. } | ||
| 3 | # key: ife | ||
| 4 | # -- | ||
| 5 | if ${1:expression} { | ||
| 6 | $0 | ||
| 7 | } else { | ||
| 8 | |||
| 9 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/ifl b/.emacs.d/snippets/rust-mode/ifl new file mode 100644 index 0000000..e4febb8 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/ifl | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: if let pattern = expression { ... }; | ||
| 3 | # key: ifl | ||
| 4 | # -- | ||
| 5 | if let ${1:pattern} = ${2:expression} { | ||
| 6 | $0 | ||
| 7 | }; | ||
diff --git a/.emacs.d/snippets/rust-mode/impl b/.emacs.d/snippets/rust-mode/impl new file mode 100644 index 0000000..14bb06f --- /dev/null +++ b/.emacs.d/snippets/rust-mode/impl | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl Type { ... } | ||
| 3 | # key: impl | ||
| 4 | # -- | ||
| 5 | impl ${1:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/implt b/.emacs.d/snippets/rust-mode/implt new file mode 100644 index 0000000..0ed9b7d --- /dev/null +++ b/.emacs.d/snippets/rust-mode/implt | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: impl Trait for Type { ... } | ||
| 3 | # key: implt | ||
| 4 | # -- | ||
| 5 | impl ${1:Trait} for ${2:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/let b/.emacs.d/snippets/rust-mode/let new file mode 100644 index 0000000..9f603ea --- /dev/null +++ b/.emacs.d/snippets/rust-mode/let | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: let pattern = expression; | ||
| 3 | # key: let | ||
| 4 | # -- | ||
| 5 | let ${1:pattern} = ${2:expression}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/letm b/.emacs.d/snippets/rust-mode/letm new file mode 100644 index 0000000..b07d673 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/letm | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: let mut pattern = expression; | ||
| 3 | # key: letm | ||
| 4 | # -- | ||
| 5 | let mut ${1:pattern} = ${2:expression}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/lett b/.emacs.d/snippets/rust-mode/lett new file mode 100644 index 0000000..10a7fa6 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/lett | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: let pattern: type = expression; | ||
| 3 | # key: lett | ||
| 4 | # -- | ||
| 5 | let ${1:pattern}: ${2:type} = ${3:expression}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/lettm b/.emacs.d/snippets/rust-mode/lettm new file mode 100644 index 0000000..9ceb8c3 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/lettm | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: let mut pattern: type = expression; | ||
| 3 | # key: lettm | ||
| 4 | # -- | ||
| 5 | let mut ${1:pattern}: ${2:type} = ${3:expression}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/loop b/.emacs.d/snippets/rust-mode/loop new file mode 100644 index 0000000..e24ae61 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/loop | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: loop { ... } | ||
| 3 | # key: loop | ||
| 4 | # -- | ||
| 5 | loop { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/macro b/.emacs.d/snippets/rust-mode/macro new file mode 100644 index 0000000..410c132 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/macro | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: macro_rules! name { (..) => (..); } | ||
| 3 | # key: macro | ||
| 4 | # -- | ||
| 5 | macro_rules! ${1:name} { | ||
| 6 | ($2) => ($3); | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/main b/.emacs.d/snippets/rust-mode/main new file mode 100644 index 0000000..3f9fe31 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/main | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: fn main() { ... } | ||
| 3 | # key: main | ||
| 4 | # -- | ||
| 5 | fn main() { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/match b/.emacs.d/snippets/rust-mode/match new file mode 100644 index 0000000..9dc802f --- /dev/null +++ b/.emacs.d/snippets/rust-mode/match | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: match expression { ... } | ||
| 3 | # key: match | ||
| 4 | # -- | ||
| 5 | match ${1:expression} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/new b/.emacs.d/snippets/rust-mode/new new file mode 100644 index 0000000..c5f21c1 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/new | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub fn new() { ... } | ||
| 3 | # key: new | ||
| 4 | # -- | ||
| 5 | pub fn new($1) -> ${2:Name} { | ||
| 6 | $2 { ${3} } | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/pafn b/.emacs.d/snippets/rust-mode/pafn new file mode 100644 index 0000000..13edd5c --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pafn | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub async fn name() { ... } | ||
| 3 | # key: pafn | ||
| 4 | # -- | ||
| 5 | pub async fn ${1:name}($2) { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pafnr b/.emacs.d/snippets/rust-mode/pafnr new file mode 100644 index 0000000..3ce9681 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pafnr | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub async fn name() -> Type { ... } | ||
| 3 | # key: pafnr | ||
| 4 | # -- | ||
| 5 | pub async fn ${1:name}($2) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pafns b/.emacs.d/snippets/rust-mode/pafns new file mode 100644 index 0000000..ad223f9 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pafns | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub async fn name(&self) -> Type { ... } | ||
| 3 | # key: pafns | ||
| 4 | # -- | ||
| 5 | pub async fn ${1:name}(${2:&self}) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pafnw b/.emacs.d/snippets/rust-mode/pafnw new file mode 100644 index 0000000..bea6dd2 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pafnw | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub async fn name<T>(x: T) where T: Clone { ... } | ||
| 3 | # key: pafnw | ||
| 4 | # -- | ||
| 5 | pub async fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pfn b/.emacs.d/snippets/rust-mode/pfn new file mode 100644 index 0000000..5f75131 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pfn | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub fn name() { ... } | ||
| 3 | # key: pfn | ||
| 4 | # -- | ||
| 5 | pub fn ${1:name}($2) { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pfnr b/.emacs.d/snippets/rust-mode/pfnr new file mode 100644 index 0000000..4fdd261 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pfnr | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub fn name() -> Type { ... } | ||
| 3 | # key: pfnr | ||
| 4 | # -- | ||
| 5 | pub fn ${1:name}($2) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/pfns b/.emacs.d/snippets/rust-mode/pfns new file mode 100644 index 0000000..4ad120f --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pfns | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub fn name(&self) -> Type { ... } | ||
| 3 | # key: pfns | ||
| 4 | # -- | ||
| 5 | pub fn ${1:name}(${2:&self}) -> ${3:Type} { | ||
| 6 | $0 | ||
| 7 | } \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/pfnw b/.emacs.d/snippets/rust-mode/pfnw new file mode 100644 index 0000000..c264400 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/pfnw | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: pub fn name<T>(x: T) where T: Clone { ... } | ||
| 3 | # key: pfnw | ||
| 4 | # -- | ||
| 5 | pub fn ${1:name}<${2:T}>(${3:x: T}) where ${4:T: Clone} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/print b/.emacs.d/snippets/rust-mode/print new file mode 100644 index 0000000..403ffd9 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/print | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: print!("{}", value); | ||
| 3 | # key: print | ||
| 4 | # -- | ||
| 5 | print!("${1:{\}}", $2); \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/println b/.emacs.d/snippets/rust-mode/println new file mode 100644 index 0000000..927134e --- /dev/null +++ b/.emacs.d/snippets/rust-mode/println | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: println | ||
| 3 | # key: p | ||
| 4 | # -- | ||
| 5 | println!("$0"); \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/printlnf b/.emacs.d/snippets/rust-mode/printlnf new file mode 100644 index 0000000..ba789e2 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/printlnf | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: println!("{}", value); | ||
| 3 | # key: pf | ||
| 4 | # -- | ||
| 5 | println!("${1:{\}}", $2); \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/result b/.emacs.d/snippets/rust-mode/result new file mode 100644 index 0000000..6996dd4 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/result | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: Result<Type, failure::Error> | ||
| 3 | # key: result | ||
| 4 | # -- | ||
| 5 | Result<${1:Type}, ${2:failure::Error}> \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/spawn b/.emacs.d/snippets/rust-mode/spawn new file mode 100644 index 0000000..c5b7445 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/spawn | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: spawn(proc() { ... }); | ||
| 3 | # key: spawn | ||
| 4 | # -- | ||
| 5 | spawn(proc() { | ||
| 6 | $0 | ||
| 7 | }); | ||
diff --git a/.emacs.d/snippets/rust-mode/static b/.emacs.d/snippets/rust-mode/static new file mode 100644 index 0000000..eef8072 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/static | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: CONSTANT: Type = value; | ||
| 3 | # key: static | ||
| 4 | # -- | ||
| 5 | static ${1:CONSTANT}: ${2:Type} = ${3:value}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/struct b/.emacs.d/snippets/rust-mode/struct new file mode 100644 index 0000000..7de2ffa --- /dev/null +++ b/.emacs.d/snippets/rust-mode/struct | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: struct TypeName { .. } | ||
| 3 | # key: struct | ||
| 4 | # -- | ||
| 5 | struct ${1:TypeName} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/test b/.emacs.d/snippets/rust-mode/test new file mode 100644 index 0000000..26efca1 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/test | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[test] fn test_name() { .. } | ||
| 3 | # key: test | ||
| 4 | # -- | ||
| 5 | #[test] | ||
| 6 | fn ${1:test_name}() { | ||
| 7 | $0 | ||
| 8 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/testmod b/.emacs.d/snippets/rust-mode/testmod new file mode 100644 index 0000000..d3494b7 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/testmod | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: test module | ||
| 3 | # key: testmod | ||
| 4 | # -- | ||
| 5 | #[cfg(test)] | ||
| 6 | mod ${1:tests} { | ||
| 7 | use super::*; | ||
| 8 | |||
| 9 | #[test] | ||
| 10 | fn ${2:test_name}() { | ||
| 11 | $0 | ||
| 12 | } | ||
| 13 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/trait b/.emacs.d/snippets/rust-mode/trait new file mode 100644 index 0000000..724df7f --- /dev/null +++ b/.emacs.d/snippets/rust-mode/trait | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: trait Type { ... } | ||
| 3 | # key: trait | ||
| 4 | # -- | ||
| 5 | trait ${1:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/type b/.emacs.d/snippets/rust-mode/type new file mode 100644 index 0000000..584a089 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/type | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: type TypeName = TypeName; | ||
| 3 | # key: type | ||
| 4 | # -- | ||
| 5 | type ${1:TypeName} = ${2:TypeName}; \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/union b/.emacs.d/snippets/rust-mode/union new file mode 100644 index 0000000..92585a2 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/union | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: union Type { ... } | ||
| 3 | # key: union | ||
| 4 | # -- | ||
| 5 | union ${1:Type} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/warn b/.emacs.d/snippets/rust-mode/warn new file mode 100644 index 0000000..acf5c5c --- /dev/null +++ b/.emacs.d/snippets/rust-mode/warn | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #[warn(lint)] | ||
| 3 | # key: warn | ||
| 4 | # -- | ||
| 5 | #[warn(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/warn! b/.emacs.d/snippets/rust-mode/warn! new file mode 100644 index 0000000..2f4885d --- /dev/null +++ b/.emacs.d/snippets/rust-mode/warn! | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: #![warn(lint)] | ||
| 3 | # key: warn! | ||
| 4 | # -- | ||
| 5 | #![warn(${1:lint})] \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/rust-mode/while b/.emacs.d/snippets/rust-mode/while new file mode 100644 index 0000000..dbb3663 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/while | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: while expression { ... } | ||
| 3 | # key: while | ||
| 4 | # -- | ||
| 5 | while ${1:expression} { | ||
| 6 | $0 | ||
| 7 | } | ||
diff --git a/.emacs.d/snippets/rust-mode/whilel b/.emacs.d/snippets/rust-mode/whilel new file mode 100644 index 0000000..9137014 --- /dev/null +++ b/.emacs.d/snippets/rust-mode/whilel | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: while let pattern = expression { ... } | ||
| 3 | # key: whilel | ||
| 4 | # -- | ||
| 5 | while let ${1:pattern} = ${2:expression} { | ||
| 6 | $0 | ||
| 7 | } | ||
