-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
39 lines (31 loc) · 1.13 KB
/
Copy pathinit.lua
File metadata and controls
39 lines (31 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require("defaults.override")
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
-- Install lazy.nvim if it's not already installed
if not vim.loop.fs_stat(lazypath) then
if vim.fn.executable('curl') == 0 then
vim.notify_once(
"Couldn't find curl, is it installed on your system?",
vim.log.levels.ERROR
)
return 1
end
if vim.fn.executable('tar') == 0 then
vim.notify_once(
"Couldn't find tar, is it installed on your system?",
vim.log.levels.ERROR
)
return 1
end
local lazyurl = "https://github.com/folke/lazy.nvim/archive/refs/tags/stable.tar.gz"
local curlCmd = string.format("curl -sfL %s", lazyurl)
local tarCmd = string.format("tar -xz --one-top-level=%s --strip-components=1", lazypath)
print("Downloading lazy.nvim from upstream")
-- TODO handle results/failure
local result = vim.fn.system(curlCmd .. " | " .. tarCmd)
end
vim.opt.rtp:prepend(lazypath)
-- All plugins under ./lua/plugins/* get picked up by this.
-- 'plugins' isn't a special or reserved name it simply refers
-- to the 'plugins' directory under ./lua, it could be named
-- anything you like.
require('lazy').setup('plugins')