aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha/packer_install.lua
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-12-18 18:44:30 +0100
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2022-12-18 18:44:30 +0100
commit605048dda6dc0ab6596bf9b76a6212cedf80a497 (patch)
treebec0e13e209655d14cef112c21a416af1c3a1ff2 /lua/alpha/packer_install.lua
parenteedea2b9c040c41305c0593a22fae7c88a473465 (diff)
downloadnvim-conf-605048dda6dc0ab6596bf9b76a6212cedf80a497.tar.gz
nvim-conf-605048dda6dc0ab6596bf9b76a6212cedf80a497.zip
feat several improvements
Diffstat (limited to 'lua/alpha/packer_install.lua')
-rw-r--r--lua/alpha/packer_install.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/lua/alpha/packer_install.lua b/lua/alpha/packer_install.lua
new file mode 100644
index 0000000..9ef6658
--- /dev/null
+++ b/lua/alpha/packer_install.lua
@@ -0,0 +1,27 @@
+local download_packer = function()
+ if vim.fn.input "Download Packer? (y for yes)" ~= "y" then
+ return
+ end
+
+ local directory = string.format("%s/site/pack/packer/start/", vim.fn.stdpath "data")
+
+ vim.fn.mkdir(directory, "p")
+
+ local out = vim.fn.system(
+ string.format("git clone %s %s", "https://github.com/wbthomason/packer.nvim", directory .. "/packer.nvim")
+ )
+
+ print(out)
+ print "Downloading packer.nvim..."
+ print "( You'll need to restart now )"
+end
+
+return function()
+ if not pcall(require, "packer") then
+ download_packer()
+
+ return true
+ end
+
+ return false
+end