From 6cb31718df762c6ebf764986074f08b19d6f82f8 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 16 Oct 2022 01:40:16 +0200 Subject: Refactor loading of plugins with packer --- init.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 455a818..03e828b 100644 --- a/init.lua +++ b/init.lua @@ -3,10 +3,12 @@ local fn = vim.fn local fmt = string.format local execute = vim.api.nvim_command local packer_path = fn.stdpath "data" .. "/site/pack/packer/start" +local sync = false local function ensure(user, repository) local path = fmt("%s/%s", packer_path, repository) if fn.empty(fn.glob(path)) > 0 then + sync = true execute( fmt("!git clone --depth 1 https://github.com/%s/%s %s", user, repository, path) ) @@ -18,6 +20,10 @@ ensure("wbthomason", "packer.nvim") ensure("Olical", "aniseed") ensure("lewis6991", "impatient.nvim") +if sync then + require("packer").sync() +end + require "impatient" vim.g["aniseed#env"] = { -- cgit v1.2.3-70-g09d2