Skip to content
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

Plugin installed but fails to initialize #19

Open
sujitawake opened this issue Sep 24, 2024 · 7 comments
Open

Plugin installed but fails to initialize #19

sujitawake opened this issue Sep 24, 2024 · 7 comments

Comments

@sujitawake
Copy link

I am trying to to install the jsonfly plugin on a fresh linux box. It is one of my favorite plugins I use on a regular basis to deal with many JSON files on a regular basis.

I use lazyvim distribution and use Lazy since it is the default package manager. Below are the methods I followed to install the plugin:

  1. Created jsonfly.lua under ~/.config/nvim/lua/plugins/ directory.
  2. Added the below lua entry
return {
  "nvim-telescope/telescope.nvim",
  dependencies = {
    "Myzel394/jsonfly.nvim"
  },
  keys = {
    { "<leader>j", "<cmd>Telescope jsonfly<cr>", desc = "Open jsonfly", ft = { "json" }, mode = "n" }
  }
}
  1. Added the following entry in init.lua which is under ~/.config/nvim/
-- bootstrap lazy.nvim
require("config.lazy")

# Load jsonfly
require("telescope").load_extension("jsonfly")

Now, whenever I open any JSON document and press the keyboard shortcut <leader>j, nothing pops up.

Am I missing something here?

To provide more context, the below are my neovim versions (trying against two linux flavors in parallel):

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1703358377

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info

Any pointers would be much appreciated.

@Myzel394
Copy link
Owner

Hmm, so for me using two files telescope.lua and jsonfly.lua - with telescope loading jsonfly inside "config" works fine - maybe you can try doing that?

@Myzel394
Copy link
Owner

You can also take a look at my dotfiles, specifically telescope.lua https://github.com/Myzel394/dotfiles/blob/14e4c7b28b95b7e1438bbbdc95fdef4dfcd75f3b/nvim/lua/plugins/telescope.lua

@sujitawake
Copy link
Author

sujitawake commented Sep 24, 2024

Great. I will take a look at your telescope.lua configs, add the changes, and see if that resolves the issue.

In the mean time, if you could also share the configs for jsonfly.lua that goes under ~/.config/nvim/lua/plugins/, it would help me diff the changes with yours. Maybe that would provide hint stating why mine doesn't work in the first place !?

@Myzel394
Copy link
Owner

I removed the jsonfly.lua again merged it into the telescope.lua - but I just copied your provided example.

@Myzel394
Copy link
Owner

@sujitawake did you find a solution to your problem?

@sujitawake
Copy link
Author

After a LOT of back and forth debugging attempts, I was able to resolve the issue.

But yeah, this plugin is tricky indeed to deal with.

@Myzel394
Copy link
Owner

Myzel394 commented Oct 4, 2024

But yeah, this plugin is tricky indeed to deal with.

What was the issue? Why is that the case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants