-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
51 lines (44 loc) · 1.61 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- vim.lsp.set_log_level("debug")
local mygroup = vim.api.nvim_create_augroup("ziglings", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = { "[0123456789][0123456789][0123456789]_*.zig" },
group = mygroup,
callback = function(t)
local file = vim.fn.fnamemodify(t.file, ":t")
local n = file:sub(0, 3)
n = string.format("%i", n)
vim.o.makeprg = "zig build -Dn=" .. n
local nf = vim.fn.glob(string.format("%03i_*", n + 1))
local pf = vim.fn.glob(string.format("%03i_*", n - 1))
vim.keymap.set("n", "<leader>n", "<cmd>e " .. nf .. "<cr>")
vim.keymap.set("n", "<leader>p", "<cmd>e " .. pf .. "<cr>")
vim.keymap.set("n", "<leader>m", "<cmd>vert sp term://zig build -Dn=" .. n .. "<cr>")
end,
})
package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua"
package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua"
require("vim-options")
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
-- checker = { enabled = true },
-- rocks = { enabled = false },
})