conjure

:neovim:+:clj: https://github.com/Olical/conjure - If you're enjoying Conjure and want to say thanks: https://github.com/users/Olical/sponsorship :smile: (alt https://conjure.fun/discord)
Anthony Khong 2020-06-18T04:55:47.248600Z

@olical, I was trying to upgrade using Plug 'Olical/conjure', {'tag': 'v3.5.0'} as per the README. And I got fatal: invalid reference: v3.5.0. Looking at the releases page, it looks like you tagged it to v3.6.0: https://github.com/Olical/conjure/releases

Olical 2020-06-18T08:11:52.248800Z

Good catch, thank you! I've corrected it to v3.5.0, I got mixed up in my version bumping!

Anthony Khong 2020-06-18T10:20:41.253400Z

Cheers Oli!

Olical 2020-06-18T10:20:55.253600Z

No problem! Apologies for the off by one confusion 😅

Olical 2020-06-18T08:45:27.250400Z

So that

{
  false 0.3
  true 3
}
behaviour is known and expected. If you're importing nvim values into lua you need to duck type check for a table that looks like this and take the false value if so. Check out :h vim.types for more info on this. Hopefully this is the only roadblock in getting config into g:conjure, I've already paved over it

Olical 2020-06-18T08:45:37.250600Z

(defn get-in [ks]
  (let [v (a.get-in (root) ks)]
    (if (and (a.table? v)
             (. v vim.type_idx)
             (. v vim.val_idx))
      (. v vim.val_idx)
      v)))

Olical 2020-06-18T08:47:19.251Z

Hmm, second thought, nested maps are probably awful to work with for setting config in viml.

Olical 2020-06-18T08:48:18.252100Z

Counter point: If you're setting config before conjure loads you can just do let g:conjure = { ... } and nest as much as you want. Then if Conjure is already loaded all of the dicts will already be defined, so let g:conjure.foo.bar.baz = ... should be fine too.

Olical 2020-06-18T10:20:27.253200Z

I think I have to find a way to have a flat map, so instead of setting g:conjure.foo.bar you’d set g:conjure_foo_bar.

Olical 2020-06-18T10:35:43.254400Z

Also the wiki is now editable by anyone, go wild if you want to add more articles / guides / info. I’m totally okay with you adding your own blog posts there.

Olical 2020-06-18T22:48:37.255900Z

Thinking of mapping all config into flat global values, like g:conjure_mapping_prefix, I think this is the simplest approach for users.

Olical 2020-06-18T22:48:52.256300Z

No worrying about "are these intermediate dictionaries defined" if I use nested dictionaries.

👌 1
Olical 2020-06-18T22:49:17.256800Z

The only downside I can think of is that there's no one place to get all config values, you have to interrogate each one.