Install plugin manager - lazy.nvim
bash
nano ~/.config/nvim/lua/sharpchen/lazy.lua
1
lua
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)
require("lazy").setup({})
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
lua
-- ~/.config/nvim/init.lua
require("sharpchen")
require("sharpchen.lazy") // [!code ++]
1
2
3
4
2
3
4
Organize plugins
For plugins need options, store them in none-index file separately.
lua
-- ~/.config/nvim/lua/sharpchen/plugins/colorscheme.lua
return {
-- ... all colorscheme
}
1
2
3
4
2
3
4
For plugins without options, store them in ./init.lua
lua
-- ~/.config/nvim/lua/sharpchen/plugins/init.lua
return {
-- ...
}
1
2
3
4
2
3
4
To import plugins
bash
nano ~/.config/nvim/lua/sharpchen/lazy.lua
1
lua
-- ~/.config/nvim/lua/sharpchen/lazy.lua
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)
require("lazy").setup("sharpchen.plugins") // [!code ++]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16