Skip to content

harlamenko/ng-generate.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ng-generate.nvim

Neovim plugin that adds a handy popup menu for running ng generate commands in Angular projects.

ng-generate.mp4

✨ Features

  • folke/snacks.nvim support
  • nvim-neo-tree/neo-tree.nvim support
  • Popup menu for all ng generate commands
  • Automatically detects path relative to src/app
  • Supports additional command-line options
  • Works with npx ng g ... out of the box
  • Automatically refreshes file explorer after generation

🍿 Snacks Explorer setup

{
  { "harlamenko/ng-generate.nvim" },
  {
    "folke/snacks.nvim",
    opts = {
      picker = {
        sources = {
          explorer = {
            actions = {
              ng_generate = function(picker, item)
                require("ng-generate").run_snacks(picker, item)
              end,
            },
            win = {
              list = {
                keys = {
                  ["n"] = "ng_generate",
                },
              },
            },
          },
        },
      },
    },
  },
}

📦 Neo-tree setup

{
  { "harlamenko/ng-generate.nvim" },
  {
    "nvim-neo-tree/neo-tree.nvim",
    opts = {
      window = {
        mappings = {
          ["n"] = function(state) require("ng-generate").run_neotree(state) end,
        },
      }
    },
  },
}

🚀 Usage

  1. Open Snacks Explorer or Neotree
  2. Select the desired directory inside src/app
  3. Press n
  4. Press symbol the desired Angular entity or place cursor on it and press Enter to generate (component, service, module, etc.)
  5. Enter a name and any additional options

You can also invoke the picker directly:

:NgGenerate

Optionally pass a directory:

:NgGenerate src/app/path/to/dir

About

Neovim plugin that adds a handy popup menu for running `ng generate` commands in Angular projects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages