savq / paq-nvim

🌚 Neovim package manager
MIT License
652 stars 39 forks source link

Automatically installing plugins after paq install #16

Closed ghost closed 3 years ago

ghost commented 3 years ago
  -- paq.nvim automatic install
  local install_path = vim.fn.stdpath("data") .. "/site/pack/paq/opt/paq-nvim"
  if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
      vim.cmd("!git clone https://github.com/savq/paq-nvim " .. install_path)
  end
  -- plugins
  vim.cmd "packadd paq-nvim"
  local paq = require "paq-nvim".paq
  paq {"savq/paq-nvim", opt = true}
  paq "junegunn/fzf"
  paq "vimwiki/vimwiki"
  paq "romainl/vim-cool"
  paq "junegunn/fzf.vim"
  paq "t9md/vim-choosewin"
  paq "qpkorr/vim-bufkill"
  paq "dense-analysis/ale"
  paq "airblade/vim-rooter"
  paq "jiangmiao/auto-pairs"
  paq "itchyny/lightline.vim"
  paq "lifepillar/vim-solarized8"
  paq "norcalli/nvim-colorizer.lua"
  paq "junegunn/rainbow_parentheses.vim"
  paq "mengelbrecht/lightline-bufferline"
  paq "nvim-treesitter/nvim-treesitter"
  paq {"neoclide/coc.nvim", branch = "release"}

  local plugin_path = vim.fn.stdpath("data") .. "/site/pack/paqs"
  if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
      vim.cmd[[ PaqInstall ]]
  end

  vim.cmd "source /home/pun/.bio/conf/vim/conf.vim"
  -- nvim-colorizer
  require "colorizer".setup()
  -- nvim-treesitter
  require "nvim-treesitter.configs".setup {
      ensure_installed = {"bash", "json", "lua", "python"},
      highlight = {
          enable = true
      }
  }

I'm trying to automatically install all the plugins before sourcing my remaining vimscript. Is this the right way of going at it ? Also is there a way I can get the location of the init.lua file so I don't have to use the full path in that source vim.cmd ?

ghost commented 3 years ago

if vim.fn.empty(vim.fn.glob(install_path)) > 0 then it's this, I forgot to edit this piece