about summary refs log tree commit diff
path: root/init.lua
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-02-12 00:21:45 +0900
committersefidel <contact@sefidel.net>2022-02-12 00:21:45 +0900
commit5df5dbcabfb9c895371465a526864f4e914f2c26 (patch)
tree6edfef5884c2f55e108925bf8dd357b333a0a1ce /init.lua
parentb7b8de20921c47dc1b38702b1828e190feada361 (diff)
downloadnvimrc-5df5dbcabfb9c895371465a526864f4e914f2c26.tar.gz
nvimrc-5df5dbcabfb9c895371465a526864f4e914f2c26.zip
chore: minor edits
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua30
1 files changed, 10 insertions, 20 deletions
diff --git a/init.lua b/init.lua
index 07f792e..6829152 100644
--- a/init.lua
+++ b/init.lua
@@ -1,33 +1,23 @@
-local ok, impatient = pcall(require, "impatient")
-if ok then
-  impatient.enable_profile()
-else
-  vim.notify(impatient)
-end
-
 local fmt = string.format
 local run = vim.api.nvim_command
 
 vim.opt.shadafile = "NONE"
 
-local function assert_installed(repo, type)
-  local _, _, pack_name = string.find(repo, [[%S+/(%S+)]])
-  local install_path = vim.fn.stdpath("data") .. "/site/pack/packer/" .. (type or "start") .. "/" .. pack_name
+local function ensure(user, repo)
+  local install_path = fmt("%s/site/pack/packer/start/%s", vim.fn.stdpath("data"), repo)
   if vim.fn.empty(vim.fn.glob(install_path)) ~= 0 then
-    print(fmt("Pack '%s' not found, cloning to %s", pack_name, install_path))
-    vim.fn.system {
-      "git",
-      "clone",
-      "https://github.com/" .. repo,
-      install_path
-    }
-    run(fmt("packadd %s", pack_name))
+    print(fmt("Pack '%s' not found, cloning to %s", repo, install_path))
+    run(fmt("!git clone https://github.com/%s/%s %s", user, repo, install_path))
+    run(fmt("packadd %s", repo))
   end
 end
 
-assert_installed("wbthomason/packer.nvim")
-assert_installed("rktjmp/hotpot.nvim")
+ensure("lewis6991", "impatient.nvim")
+require("impatient")
+
+ensure("wbthomason", "packer.nvim")
 
+ensure("rktjmp", "hotpot.nvim")
 require("hotpot").setup { provide_require_fennel = true }
 
 vim.opt.termguicolors = true