diff options
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 38 |
1 files changed, 17 insertions, 21 deletions
@@ -1,30 +1,26 @@ -- ensure nvim with essential plugins. -local fn = vim.fn +local data_path = vim.fn.stdpath "data" +local aniseed_path = vim.fn.stdpath "data" .. "/aniseed/aniseed.nvim" +local lazy_path = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 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) - ) - execute(fmt("packadd %s", repository)) +local function ensure(user, plugin, path) + if not vim.loop.fs_stat(path) then + vim.fn.system { + "git", + "clone", + "--filter=blob:none", + "--single-branch", + fmt("https://github.com/%s/%s.git", user, plugin), + path, + } end end -ensure("wbthomason", "packer.nvim") -ensure("Olical", "aniseed") -ensure("lewis6991", "impatient.nvim") - -if sync then - require("packer").sync() -end - -require "impatient" +ensure("folke", "lazy.nvim", lazy_path) +ensure("Olical", "aniseed", aniseed_path) +vim.opt.runtimepath:prepend(lazy_path) +vim.opt.runtimepath:prepend(aniseed_path) vim.g["aniseed#env"] = { module = "init", |