Myzel394 / jsonfly.nvim

❴🦋❵ Fly through your JSON / XML / YAML files with ease. Search ✨ blazingly fast ✨ for keys via Telescope.
133 stars 3 forks source link

Plugin installed but fails to initialize #19

Open sujitawake opened 1 week ago

sujitawake commented 1 week ago

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" }
    }
    }
  3. 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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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

Myzel394 commented 3 days ago

@sujitawake did you find a solution to your problem?