packer.nvim
packer.nvim copied to clipboard
Bootstrap with configs
When I follow the steps documented for bootstraping packer, if I put some pluging specific config, it breaks. This is running from a clean nvim installation
my config file
-- Automatically install packer
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
packer = require("packer")
-- Install your plugins here
return packer.startup(function(use)
use "wbthomason/packer.nvim"
-- Auto close brackets
use {"windwp/nvim-autopairs",
config = function() require("nvim-autopairs").setup() end
}
-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if packer_bootstrap then
packer.sync()
end
end)
the command I'm calling:
nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'
the output
[packer.nvim] [WARN 15:27:17] clean.lua:75: Could not remove /home/susensio/.local/share/nvim/site/pack/packer/start/nvim-autopairspacker.nvim: Error running config for nvim-autopairs: [string "..."]:0: module 'nvim-autopairs' not found:
^Ino field package.preload['nvim-autopairs']
^Ino file './nvim-autopairs.lua'
^Ino file '/usr/share/luajit-2.1.0-beta3/nvim-autopairs.lua'
^Ino file '/usr/local/share/lua/5.1/nvim-autopairs.lua'
^Ino file '/usr/local/share/lua/5.1/nvim-autopairs/init.lua'
^Ino file '/usr/share/lua/5.1/nvim-autopairs.lua'
^Ino file '/usr/share/lua/5.1/nvim-autopairs/init.lua'
^Ino file '/home/susensio/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-autopairs.lua'
^Ino file '/home/susensio/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/nvim-autopairs/init.lua'
^Ino file '/home/susensio/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-autopairs.lua'
^Ino file '/home/susensio/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/nvim-autopairs/init.lua'
^Ino file './nvim-autopairs.so'
^Ino file '/usr/local/lib/lua/5.1/nvim-autopairs.so'
^Ino file '/usr/lib/x86_64-linux-gnu/lua/5.1/nvim-autopairs.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
^Ino file '/home/susensio/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/nvim-autopairs.so'⏎
What am I doing wrong?
How can I bootstrap packer and my plugins?
BTW, if I just start vim, it works without errors. Same if I run nvim --headless -c 'autocmd User PackerComplete quitall', but that wont update any new plugins if packer is already installed.
Duplicate of #8208
Duplicate of https://github.com/mastodon/mastodon/issues/8208
Sort of. I'm also describing a way to follow lists. I just updated the title to reflect this difference.