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

self-installing example #129

Closed
craigmac opened this issue Dec 19, 2022 · 2 comments · Fixed by #138
Closed

self-installing example #129

craigmac opened this issue Dec 19, 2022 · 2 comments · Fixed by #138
Labels
documentation Improvements or additions to documentation

Comments

@craigmac
Copy link
Contributor

craigmac commented Dec 19, 2022

In case this might be useful for others looking for a one-file kickstart-style setup, here's what I'm doing:

In ~/.config/nvim/init.lua:

local path = vim.fn.stdpath('data') .. '/site/pack/paqs/start/paq-nvim'
local first_install = false

if vim.fn.glob(path) == "" then
  first_install = true
  vim.fn.system({ 'git', 'clone', 'https://github.com/savq/paq-nvim', path })
  vim.cmd.packadd('paq-nvim')
end

local packages = {
  'savq/paq-nvim',
  -- your packages
}

local paq = require('paq')
if first_install then print('Paq: first install, plugins being installed, if prompted hit Enter to continue.') end
paq(packages)
paq.install()

vim.api.nvim_create_autocmd('BufWritePost', {
  command = 'silent PaqClean | silent PaqInstall',
  group = vim.api.nvim_create_augroup('Paq', { clear = true }),
  pattern = vim.fn.expand('$MYVIMRC'),
})

Don't know if it's worth adding to the docs or not, but just thought I'd add it here in case someone is looking how to do it. Feel free to point out mistakes I might have made in the above! Thanks.

@craigmac
Copy link
Contributor Author

Benefit of this way, is there's no restart Neovim required. I can wipe out my packpath start nvim with this, it installs everything and I can work right away.

@savq
Copy link
Owner

savq commented Dec 19, 2022

Maybe we could edit :h paq-bootstrapping to show both the script-ish and the config-ish ways to install paq and plugins.

On that note, I should make my own kickstart.nvim

@savq savq added the documentation Improvements or additions to documentation label Dec 25, 2022
@savq savq mentioned this issue Feb 1, 2023
@savq savq closed this as completed in #138 Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants