A Neovim plugin that lists templates from devcontainers/templates, lets you choose one with a picker, and copies that template's .devcontainer directory into the current working directory.
- Fetches the available templates from
devcontainers/templates - Uses
vim.ui.select()by default - Optionally uses
snacks.nvimas the picker backend - Copies the selected template's
.devcontainerfiles into your project - Supports overwrite with
:DevcontainerTemplatePick!
- Neovim
0.12+ curltar
{
"goropikari/devcontainer-template.nvim",
dependencies = {
{
"folke/snacks.nvim",
optional = true,
opts = {
picker = { enabled = true },
},
},
},
opts = {
picker = "auto", -- "auto" | "vim_ui_select" | "snacks"
force = false,
},
}picker = "auto" uses Snacks.picker.select() when snacks.nvim is available and falls back to vim.ui.select() otherwise.
If you always want the built-in selector:
{
"goropikari/devcontainer-template.nvim",
opts = {
picker = "vim_ui_select",
},
}If you always want snacks.nvim:
{
"goropikari/devcontainer-template.nvim",
dependencies = {
{
"folke/snacks.nvim",
opts = {
picker = { enabled = true },
},
},
},
opts = {
picker = "snacks",
},
}:DevcontainerTemplatePickOverwrite existing files under .devcontainer:
:DevcontainerTemplatePick!Refresh the cached template list:
:DevcontainerTemplateRefreshLua API:
require("devcontainer_template").pick()
require("devcontainer_template").apply("python")git submodule update --init --recursive
make nvim
make nvim-snackssnacks.nvim is stored as a git submodule in deps/snacks.nvim. make nvim-snacks starts Neovim with dev/snacks_init.lua and loads that local submodule directly.