AckslD / swenv.nvim

Tiny plugin to quickly switch python virtual environments from within neovim without restarting.
206 stars 29 forks source link

Omit "base" from lualine #21

Closed aemonge closed 10 months ago

aemonge commented 11 months ago

Can we have an option that when the "base" env is selected, don't display anything on the lualine ?

AckslD commented 11 months ago

We could have some custom filter for when to display or not but I'm not sure I see the reason for this?

aemonge commented 11 months ago

The main reason, would be when you're editing a none python document, such as a pure front-end workspace. In this case, your python environment is meaningless.

AckslD commented 11 months ago

That seems different though than not displaying it for a given "base" venv. Ie instead you want to only display when ft=python? Although the python venv can still affect non-python files depending on what executables you're relying on. But that can be maybe exposed as an option indeed.

aemonge commented 11 months ago

Yeah, ft=python would work :)

Yeah, as long as it's the base env you should be aware of your global libs applied in other fts .

Ideally, would be nice to have nodenv inside a conda env; but that's defenetelly out of scope.

skolj commented 10 months ago

You can add cond to your lualine config and only show the lualine component in python files. Something like this:

lualine_x = {
  {
    "swenv",
    cond = function()
      return vim.bo.filetype == "python"
    end
  },
}

@aemonge Is that what you were looking for?

AckslD commented 10 months ago

Thanks @skolj!

aemonge commented 10 months ago

Thanks @skolj !