-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathminimal.lua
51 lines (43 loc) · 1.22 KB
/
minimal.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
-- Based on https://github.com/folke/lazy.nvim/blob/3bde7b5ba8b99941b314a75d8650a0a6c8552144/tests/init.lua
local CWD = vim.loop.cwd() .. '/'
vim.opt.shiftwidth = 2
vim.opt.writebackup = false
vim.opt.swapfile = false
vim.opt.shadafile = 'NONE'
vim.opt.expandtab = true
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.opt.runtimepath:append(CWD)
vim.opt.packpath = { CWD .. '.tests/site' }
local dependencies = {
'nvim-lua/plenary.nvim',
'nvim-treesitter/nvim-treesitter',
}
local function install_dep(plugin)
local name = plugin:match('.*/(.*)')
local package_root = CWD .. '.tests/site/pack/deps/start/'
if not vim.loop.fs_stat(package_root .. name) then
vim.fn.mkdir(package_root, 'p')
vim.fn.system({
'git',
'clone',
'--depth=1',
'https://github.com/' .. plugin .. '.git',
package_root .. '/' .. name,
})
end
end
for _, plugin in ipairs(dependencies) do
install_dep(plugin)
end
vim.api.nvim_create_autocmd('FileType', {
callback = function()
if vim.bo.filetype == 'go' then
vim.bo.expandtab = false
end
end,
})
require('plenary.busted')
require('nvim-treesitter.configs').setup({
ensure_installed = require('treesj.langs').configured_langs,
sync_install = true,
})