folke / neoconf.nvim

💼 Neovim plugin to manage global and project-local settings
Apache License 2.0
715 stars 29 forks source link

Question: how to use neoconf API to get self-defined configs/fields? #36

Closed linrongbin16 closed 11 months ago

linrongbin16 commented 1 year ago

Hi, I'm trying to understand the API doc: https://github.com/folke/neoconf.nvim#-api.

But still have some questions:

  1. Where does the Neoconf defined? I copied the sample but my neovim reports: there's no Neoconf defined, it's nil value.
  2. I add some configs to global ~/.config/nvim/neoconf.json (see below), but cannot get it with API: require('neoconf').get('myconfig.perf.file.maxsize'), nvim reports the returned value is nil:
    {
     "myconfig": {
       "perf.file.maxsize": 1024
     }
    }
ogios commented 12 months ago

maybe dot refers to object, better off with this? :

{
  "myconfig": {
    "perf": {
      "file":{
        "maxsize": 1024
      }    
    }
  }
}
linrongbin16 commented 11 months ago

thank you! @ogios it solves my issue!