-
-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symlink binaries from .../nvim/mason/bin to XDG_BIN_HOME if exists #1505
Comments
I don't think https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html |
Yeah, there are some concerns about that env - it's a common thought, that there is a lack of default dir for executables, like Here are some refs: |
Personally I prefer to treat Seems pip already honored this. |
This is something that an user would need to write a custom config for. This shouldn't be the default behavior or a feature by mason by any means. If you need mason-installed programs visible on your interactive shell, you should simply add $MASON/bin/ to $PATH in your bashrc/zshrc. |
@wookayin, yeah, i agree that this shouldn't be the default behavior, but may be configurable.
Yeah, i did like this, but it looks quite hardcoded, even as like export PATH="${XDG_DATA_HOME}/nvim/mason/bin:${PATH}" Is any way to execute nvim's lua via shell?, like export MASON_BIN=$( ???? 'require("mason-core.path").bin_prefix()')
export PATH="${MASON_BIN}:${PATH}" to fetch actual path to /bin directory and not relying that dir struct of mason won't change? |
$ nvim -i NONE --headless -c 'lua= require("mason-core.path").bin_prefix() .. "\n"' -c qa!
/home/xxxxx/.local/share/nvim/mason/bin But this would be quite expensive to execute every single time SHELL is initialized, because the nvim instance should read and execute all the configs (50~100ms for a good config with reasonable lazy loading). Would you want to cache it? Of course one can optimize this command line to load lazy.nvim and/or mason.nvim only to make it much faster (but it will be still 10~20ms at least):
but I'm not sure if it would be worth or better than doing compared to writing like If you really want to make a symbolic link made to somewhere among |
Hello! This would be out of scope so it won't be considered as a feature. If you want to easily access executables installed via Mason outside of Neovim you can simply add Mason's bin directory to your require("mason").setup {
install_root_dir = vim.fn.expand("~/.mason")
} $ export PATH=~/.mason/bin:$PATH
$ # yay |
I've searched open issues for similar requests
Is your feature request related to a problem? Please describe.
It's a common thing to install via mason some cli tools, linters, lang-servers, etc. and for now, i have to add
${XDG_DATA_HOME}/nvim/mason/bin
into$PATH
to have access to them.In my case,
gopls
requiresgolangci-lint
, both installed via mason, but they can't "see" each other, 'cause both of them not in$PATH
Describe the solution you'd like
I guess it will be more convenient to link binaries not only from
${XDG_DATA_HOME}/nvim/mason/packages/**
to${XDG_DATA_HOME}/nvim/mason/bin
, but also from${XDG_DATA_HOME}/nvim/mason/bin
to${XDG_BIN_HOME}/
Describe potential alternatives you've considered
Alternative is adding
${XDG_DATA_HOME}/nvim/mason/bin
into$PATH
, but it relates not only mason directory structure won't change, but also nvim's one.In case of
$XDG_BIN_HOME
is not set - nothing needs to be doneAdditional context
No response
The text was updated successfully, but these errors were encountered: