添加一部分rust代码片段

This commit is contained in:
a770 2025-06-10 22:15:02 +08:00
parent 7dff61113b
commit 2693f00367
3 changed files with 75 additions and 1 deletions

View file

@ -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" },

View file

@ -32,7 +32,7 @@
"require_plugins": {
"prefix": "require_plugins",
"body": [
"require(\"lazy.plugins.${0}\")"
"require(\"lazy.plugins.${0}\"),"
],
"description": "Require plugins for Neovim"
}

73
snippets/rust.json Normal file
View file

@ -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"
}
}