Reputation: 1
Currently im struggling with setting up my workspace with NVIM and TMUX. Im opening two panels, one main for nvim, and another one much smaller for console.
I source env/bin/activate
both of them and after that im openning NVIM on main panel. My issue is that, whenever i use pip install "x"
on lower panel, NVIM doesnt catch that and gives me an errors like "Import "x" could not be resolved"
. I have to close NVIM and reopen it in order to see changes. Using :e
to refresh the file doesnt work. :checkhealth
shows that venv is activated with correct PATH.
Worth to mention, im using the same configs on my MacBook and everything works as it should. Using pip
on lower panel updates main panel as well.
Here is an example photo of my problem.
Example.png
Already tried:
:e
to refresh file:setw synchronize-panes on/off
in TMUX:checkhealth
shows venv is activated and no errors:terminal
to activate venv and somehow refresh it (no luck)Upvotes: 0
Views: 52
Reputation: 1
The problem is LSP.
Using :LspRestart
works like a charm in my case.
Can try to setup auto :LspRestart
on file save.
Add this to your init.lua or init.vim:
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = "*.py",
callback = function()
vim.cmd("LspRestart")
end,
})
Or edit your lspconfig
pyright settings:
require'lspconfig'.pyright.setup{
settings = {
python = {
analysis = {
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "workspace",
},
},
},
}
According to ChatGPT:
Inotify vs. FSEvents (Linux vs. macOS)
Upvotes: 0