-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminimal_init.lua
54 lines (47 loc) · 1.18 KB
/
minimal_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
52
53
54
vim.g.mapleader = " "
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{
"nvim-telescope/telescope.nvim",
dir = "/home/jt/projects/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
},
config = function()
require("telescope").setup({})
vim.keymap.set("n", "<C-p>", ":Telescope find_files<CR>")
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
if pcall(require, "plenary") then
RELOAD = require("plenary.reload").reload_module
R = function(name)
RELOAD(name)
return require(name)
end
end
vim.keymap.set("n", "<leader>asht", function()
print("reloading telescope...")
R("telescope")
end)