python configurations for neovim
1. Laggy experience when opening .py files
An issue that I experienced when configuring neovim was this long waiting time when opening python files.
After some searching I realized that neovim didn’t know which python version I was using, and thus had to search through the $PATH to find the right python provider.
To fix this issue I had to sync the python manager that I was using with neovim.
1.1 How to debug
To debug this issue run the command nvim --startuptime nvim_startup.log init.py.
The above command commands neovim to write the output of it’s startup calls into a file called nvim_startup.log.
By examining the log specifically around the init.py file, one can see that it takes a long time for the file to load.
You can confirm this by running the :checkhealth provider command in neovim, which should show that the python provider is missing.
1.2 The fix!
The python manager that I was using was uv and thus to I had to run the command uv tool install --upgrade pynvim.
If you are using any other dependency provider you can follow their documentation here
Once completed you can use the command :checkhealth provider in neovim to return the status of the configured.

Leave a comment