rafi / neoconf-venom.nvim

Neoconf plugin to automatically set project's virtual-environment python runtime.
12 stars 3 forks source link

If the current file is under the root directory, write environment variables to the buffer. #7

Open mkdir700 opened 1 year ago

mkdir700 commented 1 year ago

closes: #6

Before this, environment variables were only set in the current buffer. This is effective for newly opened buffers, but not for already persistent buffers.

Therefore, my solution is to get all the buffers and iterate through them. If the file of a buffer belongs to the root directory, then set environment variables for that buffer.

mkdir700 commented 1 year ago

Before this, environment variables were only set in the current buffer. This is effective for newly opened buffers, but not for already persistent buffers.

Wait, I seem to have misunderstood. It seems that the newly opened buffer will not be set with environment variables.

So, do you think it's necessary to set environment variables for every buffer? @rafi

The reason why I need to set variables for each buffer is that I may open toggleterm from any buffer, so I hope that when toggleterm is activated from any buffer, the virtual environment can be automatically activated in the shell.