I have a lua plugins script defining local fn = vim.fn. A couple of lines later it defines local install_path = fn.stdpath('data'). This script is called from my init.vim by lua require('plugins').
Whenever I start nvim, I get the error message:
Error while calling lua chunk: /home/MYUSERNAME/.config/nvim/lua/plugins.lua: attempt to index local 'fn' (a nil value),
So I figure, vim.fn is nil. I guess something with my setup is wrong, but I don't know what and I don't know how to debug this. The only idea I had was running :checkhealth. It gave me no errors:
health#nvim#check
========================================================================
## Configuration
- OK: no issues found
Performance
- OK: Build type: Release
Remote Plugins
- OK: Up to date
terminal
- INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
- INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
- INFO: $VTE_VERSION='6003'
- INFO: $COLORTERM='truecolor'
I also tried un- and reinstalling neovim already
$ sudo apt remove neovim
$ sudo apt install neovim
My machine is running on Ubuntu 20.04 LTS.
What could be the source of this bug, how can I debug and fix this?