AstroNvim / user_example

An example user configuration with a split up structure
228 stars 799 forks source link

plugin.default_config(opts) throws nil value error #5

Closed ckt114 closed 1 year ago

ckt114 commented 1 year ago

Checklist

Operating system/version

13.2.1

Terminal/GUI

wezterm

AstroNvim Health

astronvim: require("astronvim.health").check()
========================================================================
## AstroNvim
  - INFO: AstroNvim Version: v3.0.1
  - INFO: Neovim Version: v0.8.2
  - OK: Using stable Neovim >= 0.8.0
  - OK: `git` is installed: Used for core functionality such as updater and plugin
  management
  - OK: `open` is installed: Used for `gx` mapping for opening files with system opener
  (Optional)
  - OK: `lazygit` is installed: Used for mappings to pull up git TUI (Optional)
  - OK: `node` is installed: Used for mappings to pull up node REPL (Optional)
  - OK: `gdu` is installed: Used for mappings to pull up disk usage analyzer (Optional)
  - WARNING: `btm` is not installed: Used for mappings to pull up system monitor
  (Optional)
  - OK: `python3` is installed: Used for mappings to pull up python REPL (Optional)

Describe the bug

Calling plugin.default_config(opts) in a plugin throws nil value error.

Steps to Reproduce

File: plugins/treesitter.lua

return {
  "nvim-treesitter/nvim-treesitter",
  config = function(plugin, opts)
    plugin.default_config(opts)
  end
}

Expected behavior

Should not throw error.

Screenshots

image

Additional Context

No response

mehalter commented 1 year ago

@ckt114 this is outdated syntax that is not in the v3 release. If you found this in the documentation somewhere please let me know so I can update it but I think I got all of it updated everywhere. Check the user_example that was released with the official stable release of v3 (https://github.com/AstroNvim/user_example) to see the most up to date syntax or follow the migration guide.

ckt114 commented 1 year ago

@mehalter That user_example is where I get the syntax from. See this: https://github.com/AstroNvim/user_example/blob/main/plugins/core.lua#L68-L69

ckt114 commented 1 year ago

How do I set additional configs? Do I just do like below?

config = function(plugin, opts)
  -- my settings go here?
end

OR

config = {
  -- my settings go here?
}
mehalter commented 1 year ago

ah thank you for pointing this out! I have fixed this in the latest commit: https://github.com/AstroNvim/user_example/blob/main/plugins/core.lua#L68-L69

mehalter commented 1 year ago

@ckt114 just a heads up, I transferred this issue to the relevant repository and fixed the issue :)

Fixed with 821aa73190976814d57b63171d9288c58575fdd8