I'm using Kubuntu 22.04, and Neovim 0.8 from the Konsole command-line.
I'm using vim-dadbod and vim-dadbod-ui plugins for MySQL database connection.
I don't want to have to type the password every time I open the connection, but I can't just use it directly in the mysql url (mysql://<username>:<password>@<host>:<port>/<db_name>) in the init.vim file, because this file WILL BE SHARED with other people.
Therefore, I want to store the user & password in a separate file, and call it with a variable inside my init.vim.
I've tried to create a ~/.config/nvim/lua/myVars.lua file and use require('myVars') in my init.vim file, but didn't work...
So, how can I import the variables from the lua file, and use it within init.vim?
You could - instead of a required Lua config file - opt for an environment variable which you could then access from Lua using os.getenv.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With