Skip to content

goropikari/devcontainer-template.nvim

Repository files navigation

devcontainer-template.nvim

Ask DeepWiki

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.

Features

  • Fetches the available templates from devcontainers/templates
  • Uses vim.ui.select() by default
  • Optionally uses snacks.nvim as the picker backend
  • Copies the selected template's .devcontainer files into your project
  • Supports overwrite with :DevcontainerTemplatePick!

Requirements

  • Neovim 0.12+
  • curl
  • tar

Installation

lazy.nvim

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

Usage

:DevcontainerTemplatePick

Overwrite existing files under .devcontainer:

:DevcontainerTemplatePick!

Refresh the cached template list:

:DevcontainerTemplateRefresh

Lua API:

require("devcontainer_template").pick()
require("devcontainer_template").apply("python")

Development

git submodule update --init --recursive
make nvim
make nvim-snacks

snacks.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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors