Skip to content

(docs) incorrect filename suggested for adding snippets #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
jNaimXIII opened this issue Apr 2, 2023 · 2 comments
Closed
3 tasks done

(docs) incorrect filename suggested for adding snippets #70

jNaimXIII opened this issue Apr 2, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jNaimXIII
Copy link

Checklist

  • Using a stable version of Neovim (i.e. not neovim nightly)
  • :AstroUpdate
  • Restarted AstroNvim

Operating system/version

macOS 13.3

Terminal/GUI

iTerm

AstroNvim Health

astronvim: require("astronvim.health").check()

AstroNvim

  • INFO: AstroNvim Version: v3.7.0
  • INFO: Neovim Version: v0.8.3
  • 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: python is installed: Used for mappings to pull up python REPL (Optional)

Describe the bug

The doc mentions that you have to add the following options to the user/init.lua file but, adding it has no effect. You have to add it to the user/plugins/luasnip.lua file and a modified version of it to work.

return {
  plugins = {
    {
      "L3MON4D3/LuaSnip",
      config = function(plugin, opts)
        require "plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call
        require("luasnip.loaders.from_vscode").lazy_load { paths = { "./lua/user/snippets" } } -- load snippets paths
      end,
    },
  },
}

Steps to Reproduce

https://astronvim.com/Recipes/snippets

It's at the top of this page.

Expected behavior

It should've configured the snippets but, I was able to get it working only by adding it to the user/plugins/luasnip.lua file.

Screenshots

No response

Additional Context

No response

@jNaimXIII jNaimXIII added the bug Something isn't working label Apr 2, 2023
@mehalter
Copy link
Member

mehalter commented Apr 2, 2023

This actually does work but a key piece is split up configuration files take presidence over the user/init.lua file. So if you didn't have a plugins/ folder then the snippet would work as specified in the documentation. The documentation provides minimal and complete user configurations for each individual piece and we leave it up to the user to put it into the correct location for their own configuration. If you have any recommendations to make this clearer across the documentation please feel free to open up a PR!

@mehalter mehalter closed this as completed Apr 2, 2023
@mehalter mehalter transferred this issue from AstroNvim/AstroNvim Apr 2, 2023
@mehalter
Copy link
Member

mehalter commented Apr 2, 2023

Also just a heads up @jNaimXIII , I went ahead and transferred this issue to the correct repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants