-
Notifications
You must be signed in to change notification settings - Fork 17
/
init.lua
35 lines (28 loc) · 1.28 KB
/
init.lua
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
-- Welcome to your magic kit!
-- This is the first file Neovim will load.
-- We'll ensure we have a plugin manager and Aniseed.
-- This will allow us to load more Fennel based code and download more plugins.
-- Make some modules easier to access.
local execute = vim.api.nvim_command
local fn = vim.fn
local fmt = string.format
-- Work out where our plugins will be stored.
local pack_path = fn.stdpath("data") .. "/site/pack"
function ensure (user, repo)
-- Ensures a given github.com/USER/REPO is cloned in the pack/packer/start directory.
local install_path = fmt("%s/packer/start/%s", pack_path, repo, repo)
if fn.empty(fn.glob(install_path)) > 0 then
execute(fmt("!git clone https://github.com/%s/%s %s", user, repo, install_path))
execute(fmt("packadd %s", repo))
end
end
-- Packer is our plugin manager.
ensure("wbthomason", "packer.nvim")
-- Aniseed compiles our Fennel code to Lua and loads it automatically.
ensure("Olical", "aniseed")
-- Enable Aniseed's automatic compilation and loading of Fennel source code.
-- Aniseed looks for this when it's loaded then loads the rest of your
-- configuration if it's set.
vim.g["aniseed#env"] = {module = "magic.init"}
-- Now head to fnl/magic/init.fnl to continue your journey.
-- Try pressing gf on the file path to [g]o to the [f]ile.