5

How to add a custom plugin to the astronvim distribution? astronvim uses the Packer plugin manager, but I cannot find the default syntax for Packer which looks like this:

return require('packer').startup(function(use)
  -- Packer can manage itself
  use 'wbthomason/packer.nvim'
end)

Is there a special way to do this in astronvim?

1 Answer 1

4

There is a special way indeed.

  1. At first you have to clone the user_example-directory from the project's github page.

git clone https://github.com/AstroNvim/user_example ~/.config/nvim/lua/user

  1. Inside user there is a init.lua where you can make your own custom changes.

  2. Search for plugins with /plugins and you will find a section where you can add custom plugins which looks like this.

  plugins = {
    init = { 
      -- You can also add new plugins here as well:
      -- Add plugins, the packer syntax without the "use"
      -- Custom colorscheme dracula plugin
      { "Mofiqul/dracula.nvim" },
    },
  },

Although Packer is used, in astrovim you specify wanted plugins with { "<user_name>/plugin.nvim" }, inside the init.

  1. At last, use the PackerSync-Command to download and install you wanted plugin.
2
  • 1
    I don't have a user_example directory in my ~/.config/nvim/lua directory. Apr 8, 2023 at 21:59
  • Perhaps the git clone command above is wrapped to a 2nd line and you only copy-pasted the first line? You want the whole command (ends with .../lua/user).
    – U007D
    Aug 10, 2023 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.