forked from nvim-lua/kickstart.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
74 lines (61 loc) · 1.84 KB
/
init.lua
File metadata and controls
74 lines (61 loc) · 1.84 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
vim.loader.enable()
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
require 'options'
require 'commands'
require 'autocmds'
require 'keymaps'
require 'term'
require 'session'
require 'diagnostics'
vim.g.gruvbox_material_transparent_background = 1
vim.api.nvim_create_user_command('PackClean', function()
local orphans = vim
.iter(vim.pack.get(nil, { info = false }))
:filter(function(p)
return not p.active
end)
:map(function(p)
return p.spec.name
end)
:totable()
if #orphans > 0 then
vim.pack.del(orphans)
vim.notify('Removed: ' .. table.concat(orphans, ', '))
else
vim.notify 'No orphaned plugins found'
end
end, {})
vim.api.nvim_create_user_command('PackUpdate', function()
vim.pack.update()
end, {})
vim.api.nvim_create_user_command('PackSync', function()
vim.pack.update(nil, { target = 'lockfile' })
end, {})
vim.api.nvim_create_user_command('PackStatus', function()
vim.pack.update(nil, { offline = true })
end, {})
vim.api.nvim_create_autocmd('PackChanged', {
callback = function(ev)
local name, kind = ev.data.spec.name, ev.data.kind
if name == 'nvim-treesitter' and (kind == 'install' or kind == 'update') then
if not ev.data.active then
vim.cmd.packadd 'nvim-treesitter'
end
vim.cmd 'TSUpdate'
end
end,
})
vim.pack.add {
-- Keep first
'https://github.com/sainnhe/gruvbox-material',
'https://github.com/tpope/vim-sleuth',
'https://github.com/tpope/vim-abolish',
'https://github.com/tpope/vim-surround',
'https://github.com/nvim-tree/nvim-web-devicons',
'https://github.com/ofseed/copilot-status.nvim',
'https://github.com/folke/todo-comments.nvim',
'https://github.com/nvim-lua/plenary.nvim',
'https://github.com/nvim-pack/nvim-spectre',
-- { src = 'https://github.com/mrcjkb/rustaceanvim', version = vim.version.range('8.x') },
}