-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmini.lua
59 lines (45 loc) · 1.29 KB
/
mini.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
55
56
57
58
59
vim.opt.runtimepath:remove(vim.fn.stdpath("config"))
vim.opt.packpath:remove(vim.fn.stdpath("data") .. "/site")
vim.opt.termguicolors = true
vim.opt.laststatus = 0
local test_dir = "/tmp/nvim-config"
vim.opt.runtimepath:append(vim.fn.expand(test_dir))
vim.opt.packpath:append(vim.fn.expand(test_dir))
-- install packer
local install_path = test_dir .. "/pack/packer/start/packer.nvim"
local install_plugins = false
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.cmd("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
vim.cmd("packadd packer.nvim")
install_plugins = true
end
local packer = require("packer")
packer.init({
package_root = test_dir .. "/pack",
compile_path = test_dir .. "/plugin/packer_compiled.lua",
})
packer.startup(function(use)
use("wbthomason/packer.nvim")
use('hrsh7th/cmp-path')
use('hrsh7th/cmp-cmdline')
use('hrsh7th/nvim-cmp')
if install_plugins then
packer.sync()
end
end)
local cmp = require'cmp'
cmp.setup({
sources = cmp.config.sources({
{ name = 'path' },
{ name = 'cmdline' },
})
})
cmp.setup.cmdline({':', '@'}, {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
-- nvim --clean -u mini.lua test.c