Olical / aniseed

Neovim configuration and plugins in Fennel (Lisp compiled to Lua)
https://discord.gg/wXAMr8F
The Unlicense
610 stars 28 forks source link

Don't know how to access environment variable from within fennel/aniseed #11

Closed ghost closed 4 years ago

ghost commented 4 years ago

I basically need to use a environment variable on object to set an global variable for a plugin that I use a lot: https://github.com/romgrk/todoist.nvim

Basically what I'm doing (and is working greatly) is insert the api key inside code, but with this I can't publish to GitHub and etc...

(module dotfiles.module.plugin.todoist
  {require { nvim aniseed.nvim }})

(set nvim.g.todoist { "key" "api-key" })

Can you help me with that? Thank you so much for you great work with conjure and aniseed, I'm literally addicted to this setup right now.

Olical commented 4 years ago

You need to use the getenv function through the nvim interface to access those, so that'll be (nvim.fn.getenv "SOME_VAR"). :help functions is reaaaaly useful, if you need some functionality definitely have a look through that list for it first, then it's just a nvim.fn. prefix away! :tada:

ghost commented 4 years ago

Thank you so much for the tip! It's worked like a charm 🧙‍♂️