feat(neovim): Custom snippet configuration for Docker & Rust

- VS code format snippets for Docker & Rust
- Blink.nvim configured to pick custom snippets automatically
This commit is contained in:
Pratik Tripathy
2025-08-04 11:11:10 +05:30
parent 355bbfd2e8
commit 11dfad34f7
4 changed files with 51 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
{
"Add User in Debian": {
"prefix": "userd",
"description": "Add User to Debian Container",
"body": [
"RUN groupadd -r ${1:username} && useradd -m -r -g ${1:username} ${1:username}",
"USER ${1:username}",
"WORKDIR \/${2:workdir}",
"RUN chown ${1:username}:${1:username} \/${2:workdir}"
]
},
"Add User in Alpine": {
"prefix": "usera",
"description": "Add User to Alpine Container",
"body": [
"RUN addgroup -S ${1:username} && adduser -S ${1} -G ${1}",
"USER ${1}",
"WORKDIR \/${2:workdir}",
"RUN chown ${1}:${1} \/${2}"
]
}
}

View File

@@ -0,0 +1,19 @@
{
"name": "custom-snippets",
"contributes": {
"snippets": [
{
"language": [
"dockerfile"
],
"path": "./dockerfile.json"
},
{
"language": [
"rust"
],
"path": "./rust.json"
}
]
}
}

View File

@@ -67,7 +67,10 @@ return {
signature = { enabled = true },
snippets = { preset = "luasnip" },
snippets = {
preset = "luasnip",
opts = { search_paths = { vim.fn.stdpath("config") .. "/custom-snippets" } },
},
cmdline = {
enabled = true,
@@ -122,7 +125,7 @@ return {
providers = {
lsp = { score_offset = 1000 },
buffer = { score_offset = 950 },
snippets = { score_offset = 1150 },
snippets = { score_offset = 900 },
path = { score_offset = 750 },
conventional_commits = {
name = "Conventional Commits",
@@ -174,6 +177,11 @@ return {
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load({
paths = {
vim.fn.stdpath("config") .. "/custom-snippets",
},
})
end,
},
build = (function()