Skip to content
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

国内用户建议使用 ghproxy 加快插件安装速度 #22

Open
jonahfang opened this issue Oct 7, 2023 · 5 comments
Open

国内用户建议使用 ghproxy 加快插件安装速度 #22

jonahfang opened this issue Oct 7, 2023 · 5 comments

Comments

@jonahfang
Copy link

例如:

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://ghproxy.com/https://github.com/folke/lazy.nvim.git",
    "--branch=v10.4.1",
    lazypath,
  })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

require("lazy").setup({
	spec = {
	...
	},
    git = {
      url_format = "https://ghproxy.com/https://github.com/%s"
    },
	performance = {
		rtp = {
			-- disable some rtp plugins
			disabled_plugins = {
               "2html_plugin",
               "getscript",
               "getscriptPlugin",
               "gzip",
               "logipat",
               "netrw",
               "netrwPlugin",
               "netrwSettings",
               "netrwFileHandlers",
               "matchit",
               "tar",
               "tarPlugin",
               "rrhelper",
               "spellfile_plugin",
               "vimball",
               "vimballPlugin",
               "zip",
               "zipPlugin",
               "tutor",
               "rplugin",
               "synmenu",
               "optwin",
               "compiler",
               "bugreport",
               "ftplugin",
			},
		},
	},
})
-- EOF

@nshen
Copy link
Owner

nshen commented Oct 17, 2023

感觉没有全局网络环境使用 neovim 挺难的,即使下载了lazy.nvim,还有其他插件,lsp,treesitter语法高亮等等都要下载,用代理感觉不是很稳定。

@jonahfang
Copy link
Author

jonahfang commented Oct 17, 2023

请仔细看我的上述配置,不是光解决lazy.nvim的下载,而是使用ghproxy.com后其他所有插件下载速度很快啊:

...
require("lazy").setup({
	spec = {
	...
	},
    git = {
      url_format = "https://ghproxy.com/https://github.com/%s"
    },
	...

@s-leeq
Copy link
Contributor

s-leeq commented Jan 26, 2024

lsp的配置可以在lua/insis/lsp/init.luamason.setup里添加:

  github = {
    download_url_template = "https://ghproxy.com/https://github.com/%s/releases/download/%s/%s",
  },

copilot可以在lua/insis/basic.lua里的任意位置添加一行:

vim.g.copilot_proxy = "localhost:1234"

treesitter可以在lua/insis/plugins/treesitter.luapRequire("nvim-treesitter.install").prefer_git = true行下面添加:

  for _, config in pairs(require("nvim-treesitter.parsers").get_parser_configs()) do
    config.install_info.url = config.install_info.url:gsub("https://github.com/", "https://ghproxy.com/https://github.com/")
  end

@jonahfang
Copy link
Author

@s-leeq ghproxy 好像不好用了,我现在用 521github, 例如:

 git clone https://521github.com/jonahfang/cd-project.nvim.git

@s-leeq
Copy link
Contributor

s-leeq commented Jan 26, 2024

@s-leeq ghproxy 好像不好用了,我现在用 521github, 例如:

 git clone https://521github.com/jonahfang/cd-project.nvim.git

不重要,反正就是类似修改就好了:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants