lazynvim-proxy

https://blog.houhaibushihai.me/archives/aboutlazyvim

System-wide Git Proxy (Recommended):

1
2
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890

In LazyVim Configuration: Create or edit ~/.config/nvim/lua/config/options.lua and add:

1
2
-- Set proxy for network operations
vim.g.proxy = 'http://127.0.0.1:7890'

For Mason Package Manager: Edit ~/.config/nvim/lua/config/lazy.lua and add:

1
2
3
4
5
6
7
{
"williamboman/mason.nvim",
opts = {
-- Add proxy settings to mason
proxy_url = "http://127.0.0.1:7890",
},
}

For Neovim’s built-in LSP: Add to your ~/.config/nvim/lua/config/options.lua:

1
2
vim.env.http_proxy = 'http://127.0.0.1:7890'
vim.env.https_proxy = 'http://127.0.0.1:7890'

Notes:

Replace 7890 with your actual proxy port
Common proxy ports are: 7890 (Clash), 1080 (SOCKS5), 8080 (HTTP)
After making changes, restart Neovim for the settings to take effect
You might need to run :Mason and :MasonUpdate to verify the proxy settings are working

To remove the proxy settings:

1
2
git config --global --unset http.proxy
git config --global --unset https.proxy

Remember to adjust the proxy address and port according to your specific proxy setup (e.g., if you’re using a different proxy service or port).