Closed RoryNesbitt closed 2 years ago
Are you running neovim with --clean
as a argument? If so then the function s:LoadRemotePlugins() is not called. This sets g:loaded_remote_plugins to the correct path.
To get around this you can set vim.g.loaded_remote_plugins = 1
. You could also check argv for --clean
argument.
local function check_clean()
for _, arg in ipairs(vim.v.argv) do
if arg == '--clean' then
vim.g.loaded_remote_plugins = 1
return
end
end
end
check_clean()
Yes that is exactly what I am doing. Thank you for the information, I'll test it as soon as I can
Okay this has removed the error message when running PackerSync, which is great thank you.
However, when running with those settings there is still an issue I thought was related where it seems none of the files that are in config = "require'...'"
are being required. Mainly evidenced by missing keymaps that would exist from those files. They are then loaded as expected when you run PackerCompile.
The launch command I'm using is nvim --clean --cmd "so settings-file.lua" -u /path/to/config/init.lua
so as to load those settings first then load the regular config
vim.opt.rtp:append(join_paths(dir, "config"))
vim.cmd('set packpath=' .. dir)
vim.g.loaded_remote_plugins = 1
-- ...
packer.init({
package_root = join_paths(dir, "pack"),
compile_path = join_paths(dir, "plugin", "packer_compiled.lua"),
})
Looking at your pvim.lua
file it looks like you are adding dir + config
path to the runtimepath but the compile path is creating at dir + plugin + packer_compiled.lua
. This directory is not in your runtimepath. You should also add dir
as well or change the locatio nof your plugin + packer_compiled.lua
file to somewhere in your runtimepath
.
Thanks @EdenEast that fixed it
nvim --version
: NVIM v0.7.2 Build type: Release LuaJIT 2.1.0-beta3 Compiled by builduserFeatures: +acl +iconv +tui See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
git --version
: git version 2.37.1Operating system/version: OS: EndeavourOS Linux Kernel: 5.18.16-arch1-1
Terminal name/version: Kitty 0.25.2-1
Steps to reproduce
This is the file I am running before anything else
I believe the relevant part is:
Actual behaviour
I get the following error when running PackerSync:
Expected behaviour
Packer works the same as when run without these changes
packer files
Plugin specification file(s)
Post or link your plugin specification files here, if you aren't able to provide a minimal reproducer [Relevant setup](https://github.com/RoryNesbitt/pvim/blob/main/pvim.lua)packer log file
Post the contents of ~/.cache/nvim/packer.nvim.log here Emptypacker compiled file
Post the contents of `packer_compiled.vim` here ```lua -- Automatically generated packer.nvim plugin loader code if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') return end vim.api.nvim_command('packadd packer.nvim') local no_errors, error_msg = pcall(function() local time local profile_info local should_profile = false if should_profile then local hrtime = vim.loop.hrtime profile_info = {} time = function(chunk, start) if start then profile_info[chunk] = hrtime() else profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 end end else time = function(chunk, start) end end local function save_profiles(threshold) local sorted_times = {} for chunk_name, time_taken in pairs(profile_info) do sorted_times[#sorted_times + 1] = {chunk_name, time_taken} end table.sort(sorted_times, function(a, b) return a[2] > b[2] end) local results = {} for i, elem in ipairs(sorted_times) do if not threshold or threshold and elem[2] > threshold then results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' end end _G._packer = _G._packer or {} _G._packer.profile_output = results end time([[Luarocks path setup]], true) local package_path_str = "/home/rory/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/rory/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/rory/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/rory/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" local install_cpath_pattern = "/home/rory/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" if not string.find(package.path, package_path_str, 1, true) then package.path = package.path .. ';' .. package_path_str end if not string.find(package.cpath, install_cpath_pattern, 1, true) then package.cpath = package.cpath .. ';' .. install_cpath_pattern end time([[Luarocks path setup]], false) time([[try_loadstring definition]], true) local function try_loadstring(s, component, name) local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) if not success then vim.schedule(function() vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) end) end return result end time([[try_loadstring definition]], false) time([[Defining packer_plugins]], true) _G.packer_plugins = { ["Comment.nvim"] = { config = { "\27LJ\2\n5\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\fComment\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/Comment.nvim", url = "https://github.com/numToStr/Comment.nvim" }, LuaSnip = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/LuaSnip", url = "https://github.com/L3MON4D3/LuaSnip" }, ["base16-vim"] = { loaded = false, needs_bufread = false, path = "/home/rory/Documents/pvim/pack/packer/opt/base16-vim", url = "https://github.com/chriskempson/base16-vim" }, ["cmp-buffer"] = { after_files = { "/home/rory/Documents/pvim/pack/packer/opt/cmp-buffer/after/plugin/cmp_buffer.lua" }, load_after = {}, loaded = true, needs_bufread = false, path = "/home/rory/Documents/pvim/pack/packer/opt/cmp-buffer", url = "https://github.com/hrsh7th/cmp-buffer" }, ["cmp-cmdline"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/cmp-cmdline", url = "https://github.com/hrsh7th/cmp-cmdline" }, ["cmp-nvim-lsp"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/cmp-nvim-lsp", url = "https://github.com/hrsh7th/cmp-nvim-lsp" }, ["cmp-path"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/cmp-path", url = "https://github.com/hrsh7th/cmp-path" }, ["dashboard-nvim"] = { config = { "\27LJ\2\n/\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\20rnvim.dashboard\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/dashboard-nvim", url = "https://github.com/glepnir/dashboard-nvim" }, ["diffview.nvim"] = { config = { "\27LJ\2\n.\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\19rnvim.diffview\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/diffview.nvim", url = "https://github.com/sindrets/diffview.nvim" }, dracula = { after_files = { "/home/rory/Documents/pvim/pack/packer/opt/dracula/after/plugin/dracula.vim" }, loaded = false, needs_bufread = false, path = "/home/rory/Documents/pvim/pack/packer/opt/dracula", url = "https://github.com/dracula/vim" }, ["ejs-syntax"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/ejs-syntax", url = "https://github.com/nikvdp/ejs-syntax" }, firenvim = { config = { "\27LJ\2\n.\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\19rnvim.firenvim\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/firenvim", url = "https://github.com/glacambre/firenvim" }, ["friendly-snippets"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/friendly-snippets", url = "https://github.com/rafamadriz/friendly-snippets" }, ["gitsigns.nvim"] = { config = { "\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rgitsigns\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/gitsigns.nvim", url = "https://github.com/lewis6991/gitsigns.nvim" }, gruvbox = { loaded = false, needs_bufread = false, path = "/home/rory/Documents/pvim/pack/packer/opt/gruvbox", url = "https://github.com/gruvbox-community/gruvbox" }, ["hydra.nvim"] = { config = { "\27LJ\2\n+\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\16rnvim.hydra\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/hydra.nvim", url = "https://github.com/anuvyklack/hydra.nvim" }, ["impatient.nvim"] = { config = { "\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\19enable_profile\14impatient\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/impatient.nvim", url = "https://github.com/lewis6991/impatient.nvim" }, ["indent-blankline.nvim"] = { config = { "\27LJ\2\n6\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\27rnvim.indent-blankline\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/indent-blankline.nvim", url = "https://github.com/lukas-reineke/indent-blankline.nvim" }, ["lspkind-nvim"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/lspkind-nvim", url = "https://github.com/onsails/lspkind-nvim" }, ["lspsaga.nvim"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/lspsaga.nvim", url = "https://github.com/glepnir/lspsaga.nvim" }, ["lualine.nvim"] = { config = { "\27LJ\2\n-\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\18rnvim.lualine\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/lualine.nvim", url = "https://github.com/nvim-lualine/lualine.nvim" }, ["markdown-preview.nvim"] = { config = { "\27LJ\2\n1\0\0\2\0\3\0\0056\0\0\0009\0\1\0)\1\1\0=\1\2\0K\0\1\0\20mkdp_auto_start\6g\bvim\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/markdown-preview.nvim", url = "https://github.com/iamcco/markdown-preview.nvim" }, ["mason-lspconfig.nvim"] = { config = { "\27LJ\2\n+\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\16rnvim.mason\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/mason-lspconfig.nvim", url = "https://github.com/williamboman/mason-lspconfig.nvim" }, ["mason.nvim"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/mason.nvim", url = "https://github.com/williamboman/mason.nvim" }, neogit = { config = { "\27LJ\2\n,\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\17rnvim.neogit\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/neogit", url = "https://github.com/TimUntersberger/neogit" }, ["nord.nvim"] = { loaded = false, needs_bufread = false, path = "/home/rory/Documents/pvim/pack/packer/opt/nord.nvim", url = "https://github.com/shaunsingh/nord.nvim" }, ["null-ls.nvim"] = { config = { "\27LJ\2\n-\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\18rnvim.null-ls\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/null-ls.nvim", url = "https://github.com/jose-elias-alvarez/null-ls.nvim" }, ["nvim-autopairs"] = { config = { "\27LJ\2\n/\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\20rnvim.autopairs\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/nvim-autopairs", url = "https://github.com/windwp/nvim-autopairs" }, ["nvim-cmp"] = { after = { "cmp-buffer" }, config = { "\27LJ\2\n.\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\19rnvim.nvim-cmp\frequire\0" }, loaded = true, only_config = true, path = "/home/rory/Documents/pvim/pack/packer/start/nvim-cmp", url = "https://github.com/hrsh7th/nvim-cmp" }, ["nvim-colorizer.lua"] = { config = { "\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14colorizer\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/nvim-colorizer.lua", url = "https://github.com/norcalli/nvim-colorizer.lua" }, ["nvim-dap"] = { config = { "\27LJ\2\n)\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\14rnvim.dap\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/nvim-dap", url = "https://github.com/mfussenegger/nvim-dap" }, ["nvim-dap-ui"] = { config = { "\27LJ\2\n+\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\16rnvim.dapui\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/nvim-dap-ui", url = "https://github.com/rcarriga/nvim-dap-ui" }, ["nvim-dap-virtual-text"] = { config = { "\27LJ\2\nC\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\26nvim-dap-virtual-text\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/nvim-dap-virtual-text", url = "https://github.com/theHamsta/nvim-dap-virtual-text" }, ["nvim-lspconfig"] = { config = { "\27LJ\2\n)\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\14rnvim.lsp\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/nvim-lspconfig", url = "https://github.com/neovim/nvim-lspconfig" }, ["nvim-treesitter"] = { after = { "playground", "nvim-ts-autotag", "nvim-ts-rainbow" }, config = { "\27LJ\2\n0\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\21rnvim.treesitter\frequire\0" }, loaded = true, only_config = true, path = "/home/rory/Documents/pvim/pack/packer/start/nvim-treesitter", url = "https://github.com/nvim-treesitter/nvim-treesitter" }, ["nvim-ts-autotag"] = { load_after = {}, loaded = true, needs_bufread = false, path = "/home/rory/Documents/pvim/pack/packer/opt/nvim-ts-autotag", url = "https://github.com/windwp/nvim-ts-autotag" }, ["nvim-ts-rainbow"] = { load_after = {}, loaded = true, needs_bufread = false, path = "/home/rory/Documents/pvim/pack/packer/opt/nvim-ts-rainbow", url = "https://github.com/p00f/nvim-ts-rainbow" }, ["nvim-web-devicons"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/nvim-web-devicons", url = "https://github.com/kyazdani42/nvim-web-devicons" }, ["one-small-step-for-vimkind"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/one-small-step-for-vimkind", url = "https://github.com/jbyuki/one-small-step-for-vimkind" }, ["onedark.vim"] = { loaded = false, needs_bufread = false, path = "/home/rory/Documents/pvim/pack/packer/opt/onedark.vim", url = "https://github.com/joshdick/onedark.vim" }, ["packer.nvim"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/packer.nvim", url = "https://github.com/wbthomason/packer.nvim" }, ["pandoc.nvim"] = { config = { "\27LJ\2\n4\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\vpandoc\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/pandoc.nvim", url = "https://github.com/aspeddro/pandoc.nvim" }, playground = { load_after = {}, loaded = true, needs_bufread = true, path = "/home/rory/Documents/pvim/pack/packer/opt/playground", url = "https://github.com/nvim-treesitter/playground" }, ["plenary.nvim"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/plenary.nvim", url = "https://github.com/nvim-lua/plenary.nvim" }, ["popup.nvim"] = { loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/popup.nvim", url = "https://github.com/nvim-lua/popup.nvim" }, ["spellsitter.nvim"] = { config = { "\27LJ\2\n9\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\16spellsitter\frequire\0" }, loaded = true, path = "/home/rory/Documents/pvim/pack/packer/start/spellsitter.nvim", url = "https://github.com/lewis6991/spellsitter.nvim" }, ["stylish.nvim"] = { config = { "\27LJ\2\n8\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\rui_clock\fstylish\frequireW\1\0\6\0\a\0\t6\0\0\0009\0\1\0009\0\2\0'\2\3\0'\3\4\0003\4\5\0005\5\6\0B\0\5\1K\0\1\0\1\0\2\vsilent\2\fnoremap\2\0\n