diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-12-21 00:38:05 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-12-21 00:38:05 +0100 |
commit | ff83f6d332c93c6f5124dfd7ba08bcebab2099e3 (patch) | |
tree | 13fdb3e7036a5df414a453d0840d1a6689f603d0 /init.lua | |
parent | 3a04ae4dff27c859f223885109ae7dfa581d56cc (diff) |
Replace packer with lazy
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", |