From 2693f0036757be29ccb7124925c9d130333d9047 Mon Sep 17 00:00:00 2001 From: a770 Date: Tue, 10 Jun 2025 22:15:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=80=E9=83=A8=E5=88=86ru?= =?UTF-8?q?st=E4=BB=A3=E7=A0=81=E7=89=87=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lazy-lock.json | 1 + snippets/lua.json | 2 +- snippets/rust.json | 73 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 snippets/rust.json diff --git a/lazy-lock.json b/lazy-lock.json index b8aaed1..6ff610a 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -5,6 +5,7 @@ "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "catppuccin": { "branch": "main", "commit": "a0c769bc7cd04bbbf258b3d5f01e2bdce744108d" }, "cellular-automaton.nvim": { "branch": "main", "commit": "1606e9d5d04ff254023c3f3c62842d065708d6d3" }, + "code_runner.nvim": { "branch": "main", "commit": "65c8d11f507073b915f10faa88ea05bd4fbf69ce" }, "conform.nvim": { "branch": "master", "commit": "0e93e0d12d2f7ebdea9e3e444dfaff0050cefbe6" }, "copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, diff --git a/snippets/lua.json b/snippets/lua.json index d05e5c9..fc1daf2 100644 --- a/snippets/lua.json +++ b/snippets/lua.json @@ -32,7 +32,7 @@ "require_plugins": { "prefix": "require_plugins", "body": [ - "require(\"lazy.plugins.${0}\")" + "require(\"lazy.plugins.${0}\")," ], "description": "Require plugins for Neovim" } diff --git a/snippets/rust.json b/snippets/rust.json new file mode 100644 index 0000000..89f0fed --- /dev/null +++ b/snippets/rust.json @@ -0,0 +1,73 @@ +{ + "main": { + "prefix": "main", + "body": [ + "fn main() {", + "\t${0}", + "}" + ], + "description": "custom main" + }, + "fn": { + "prefix": "fn", + "body": [ + "fn ${1}(${2}) ${3}{", + "\t${4}", + "}" + ], + "description": "custom function" + }, + "let":{ + "prefix": "let", + "body": [ + "let ${1} = ${2};" + ], + "description": "custom let" + }, + "letmut":{ + "prefix": "let mut", + "body": [ + "let mut ${1} = ${2};" + ], + "description": "custom let mut" + }, + "pri":{ + "prefix": "pri", + "body": [ + "println!(\"${1}\"${2});" + ], + "description": "custom println" + }, + "println":{ + "prefix": "println", + "body": [ + "println!(\"${1}\"${2});" + ], + "description": "custom println" + }, + "print":{ + "prefix": "print", + "body": [ + "print!(\"${1}\"${2});" + ], + "description": "custom print" + }, + "if": { + "prefix": "if", + "body": [ + "if ${1} {", + "\t${2}", + "}" + ], + "description": "custom if" + }, + "for": { + "prefix": "for", + "body": [ + "for ${1} in ${2} {", + "\t${3}", + "}" + ], + "description": "custom for" + } +}