2023-10-31 14:21:12 +08:00
|
|
|
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)
|
2023-11-11 10:22:57 +08:00
|
|
|
|
|
|
|
local opts = {
|
2023-10-31 14:21:12 +08:00
|
|
|
install = {
|
|
|
|
colorscheme = { "gruvbox" }
|
2023-11-23 15:24:50 +08:00
|
|
|
},
|
|
|
|
dev = {
|
|
|
|
path = "~/.local/src"
|
2023-10-31 14:21:12 +08:00
|
|
|
}
|
|
|
|
}
|
2023-11-11 10:22:57 +08:00
|
|
|
|
|
|
|
local plugins = {
|
2023-11-11 11:45:14 +08:00
|
|
|
-- main UI
|
2023-10-31 14:21:12 +08:00
|
|
|
{
|
|
|
|
"ellisonleao/gruvbox.nvim",
|
|
|
|
lazy = false,
|
|
|
|
priority = 1000,
|
|
|
|
config = function()
|
|
|
|
vim.cmd([[colorscheme gruvbox]])
|
|
|
|
end
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"nvim-lualine/lualine.nvim",
|
|
|
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
|
|
config = function()
|
|
|
|
require("plugins.statusline")
|
|
|
|
end
|
|
|
|
},
|
2023-11-11 11:45:14 +08:00
|
|
|
-- TS, LSP, Completion
|
2023-10-31 14:21:12 +08:00
|
|
|
{
|
2023-11-11 16:53:57 +08:00
|
|
|
"williamboman/mason.nvim",
|
|
|
|
lazy = true
|
2023-10-31 14:21:12 +08:00
|
|
|
},
|
|
|
|
{
|
2023-11-11 11:45:14 +08:00
|
|
|
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
2023-11-11 16:53:57 +08:00
|
|
|
lazy = true,
|
2023-11-11 11:45:14 +08:00
|
|
|
config = function()
|
|
|
|
require("plugins.treesitter")
|
2023-11-23 15:24:50 +08:00
|
|
|
end,
|
|
|
|
build = ":TSUpdate"
|
2023-10-31 14:21:12 +08:00
|
|
|
},
|
|
|
|
{
|
2023-11-11 11:45:14 +08:00
|
|
|
"nvim-treesitter/nvim-treesitter-context",
|
2023-11-20 22:15:47 +08:00
|
|
|
event = { "BufReadPre", "BufNewFile" },
|
2023-10-31 14:21:12 +08:00
|
|
|
dependencies = {
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
|
|
|
},
|
|
|
|
},
|
2023-11-11 16:53:57 +08:00
|
|
|
{
|
|
|
|
"L3MON4D3/LuaSnip",
|
|
|
|
dependencies = { "rafamadriz/friendly-snippets" },
|
|
|
|
lazy = true
|
|
|
|
},
|
2023-10-31 14:21:12 +08:00
|
|
|
{
|
|
|
|
"hrsh7th/nvim-cmp",
|
|
|
|
dependencies = {
|
2023-11-11 16:53:57 +08:00
|
|
|
"hrsh7th/cmp-nvim-lsp",
|
2023-10-31 14:21:12 +08:00
|
|
|
"hrsh7th/cmp-buffer",
|
2023-11-11 16:53:57 +08:00
|
|
|
"hrsh7th/cmp-nvim-lua",
|
2023-10-31 14:21:12 +08:00
|
|
|
"hrsh7th/cmp-cmdline",
|
|
|
|
"FelipeLema/cmp-async-path",
|
|
|
|
"ray-x/cmp-treesitter",
|
|
|
|
{
|
|
|
|
"saadparwaiz1/cmp_luasnip",
|
|
|
|
dependencies = {
|
|
|
|
"L3MON4D3/LuaSnip"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
event = { "InsertEnter", "CmdlineEnter" },
|
|
|
|
config = function()
|
|
|
|
require("plugins/cmp")
|
|
|
|
end
|
|
|
|
},
|
2023-11-20 22:15:47 +08:00
|
|
|
{
|
|
|
|
"windwp/nvim-autopairs",
|
|
|
|
event = "InsertEnter",
|
|
|
|
opts = {
|
|
|
|
map_c_w = true,
|
|
|
|
enable_check_bracket_line = true,
|
|
|
|
check_ts = true,
|
|
|
|
},
|
|
|
|
},
|
2023-11-11 15:04:42 +08:00
|
|
|
{
|
|
|
|
"Dynge/gitmoji.nvim",
|
2023-11-28 13:02:36 +08:00
|
|
|
ft = { "gitcommit", "NeogitCommitMessage" },
|
|
|
|
opts = {
|
|
|
|
filetypes = { "gitcommit", "octo", "NeogitCommitMessage" },
|
|
|
|
completion = {
|
|
|
|
append_space = true,
|
|
|
|
},
|
|
|
|
},
|
2023-11-11 15:04:42 +08:00
|
|
|
dependencies = "hrsh7th/nvim-cmp"
|
|
|
|
},
|
2023-10-31 14:21:12 +08:00
|
|
|
{
|
|
|
|
"hrsh7th/cmp-nvim-lsp",
|
2023-11-11 17:11:57 +08:00
|
|
|
event = { "BufReadPre", "BufNewFile" },
|
2023-10-31 14:21:12 +08:00
|
|
|
dependencies = {
|
|
|
|
"neovim/nvim-lspconfig",
|
2023-11-11 17:11:57 +08:00
|
|
|
},
|
|
|
|
lazy = true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"neovim/nvim-lspconfig",
|
|
|
|
event = { "BufReadPre", "BufNewFile" },
|
|
|
|
dependencies = {
|
|
|
|
{
|
|
|
|
"williamboman/mason-lspconfig.nvim",
|
|
|
|
dependencies = {
|
|
|
|
"williamboman/mason.nvim",
|
|
|
|
}
|
2023-10-31 14:21:12 +08:00
|
|
|
},
|
2023-11-11 17:11:57 +08:00
|
|
|
},
|
|
|
|
config = function()
|
|
|
|
require("plugins.lsp")
|
|
|
|
end,
|
2023-10-31 14:21:12 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"jay-babu/mason-null-ls.nvim",
|
|
|
|
config = function()
|
|
|
|
require("plugins.null-ls")
|
|
|
|
end,
|
2023-11-11 17:11:57 +08:00
|
|
|
event = { "BufReadPre", "BufNewFile" },
|
2023-10-31 14:21:12 +08:00
|
|
|
dependencies = {
|
|
|
|
"williamboman/mason.nvim",
|
2023-11-28 11:10:12 +08:00
|
|
|
"nvimtools/none-ls.nvim"
|
2023-10-31 14:21:12 +08:00
|
|
|
}
|
|
|
|
},
|
2023-11-11 11:45:14 +08:00
|
|
|
-- Code editing
|
|
|
|
{
|
|
|
|
"machakann/vim-sandwich",
|
|
|
|
keys = "s"
|
|
|
|
},
|
2023-11-11 10:22:57 +08:00
|
|
|
{
|
|
|
|
"numToStr/Comment.nvim",
|
2023-11-28 11:10:12 +08:00
|
|
|
event = "ModeChanged",
|
2023-11-11 11:45:14 +08:00
|
|
|
keys = "g",
|
|
|
|
config = function()
|
2023-11-11 10:22:57 +08:00
|
|
|
require("Comment").setup()
|
|
|
|
end
|
|
|
|
},
|
2023-11-11 11:45:14 +08:00
|
|
|
{
|
|
|
|
"andymass/vim-matchup",
|
|
|
|
event = "BufEnter"
|
|
|
|
},
|
2023-10-31 14:21:12 +08:00
|
|
|
{
|
|
|
|
"nvim-telescope/telescope.nvim",
|
2023-11-28 13:02:36 +08:00
|
|
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
2023-11-23 15:24:50 +08:00
|
|
|
event = "CmdlineEnter",
|
2023-11-28 13:02:36 +08:00
|
|
|
keys = {
|
|
|
|
vim.keymap.set('', '<leader>fd', ':Telescope fd<cr>'),
|
|
|
|
vim.keymap.set('', '<leader>bf', ':Telescope buffers<cr>'),
|
|
|
|
},
|
2023-10-31 14:21:12 +08:00
|
|
|
config = function()
|
|
|
|
require("plugins.telescope")
|
|
|
|
end
|
|
|
|
},
|
2023-11-11 15:04:42 +08:00
|
|
|
{
|
2023-11-28 11:10:12 +08:00
|
|
|
"NeogitOrg/neogit",
|
|
|
|
dependencies = {
|
|
|
|
"nvim-lua/plenary.nvim", -- required
|
|
|
|
"nvim-telescope/telescope.nvim", -- optional
|
|
|
|
"sindrets/diffview.nvim", -- optional
|
|
|
|
},
|
|
|
|
event = "CmdlineEnter",
|
|
|
|
config = true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
-- TODO: add events, keys and cmds
|
|
|
|
"folke/trouble.nvim",
|
|
|
|
lazy = true,
|
|
|
|
cmd = "Troubletoggle",
|
|
|
|
keys = {
|
|
|
|
vim.keymap.set("n", "<leader>xx", function() require("trouble").toggle() end),
|
|
|
|
vim.keymap.set("n", "<leader>xw",
|
|
|
|
function() require("trouble").toggle("workspace_diagnostics") end),
|
|
|
|
vim.keymap.set("n", "<leader>xd",
|
|
|
|
function() require("trouble").toggle("document_diagnostics") end),
|
|
|
|
vim.keymap.set("n", "<leader>xq", function() require("trouble").toggle("quickfix") end),
|
|
|
|
vim.keymap.set("n", "<leader>xl", function() require("trouble").toggle("loclist") end),
|
|
|
|
vim.keymap.set("n", "<leader>gr", function() require("trouble").toggle("lsp_references") end)
|
|
|
|
},
|
|
|
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
2023-11-11 15:04:42 +08:00
|
|
|
},
|
2023-11-11 11:45:14 +08:00
|
|
|
|
|
|
|
-- Eye candy UI
|
2023-11-11 15:04:42 +08:00
|
|
|
{
|
|
|
|
"NvChad/nvim-colorizer.lua",
|
|
|
|
cmd = { "ColorizerAttachToBuffer",
|
|
|
|
"ColorizerToggle"
|
|
|
|
},
|
|
|
|
config = function()
|
|
|
|
require("colorizer").setup()
|
|
|
|
end
|
|
|
|
},
|
2023-10-31 14:21:12 +08:00
|
|
|
{
|
|
|
|
"winston0410/range-highlight.nvim",
|
|
|
|
event = "CmdlineEnter"
|
2023-11-11 11:45:14 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'simrat39/symbols-outline.nvim',
|
|
|
|
cmd = { 'SymbolsOutline', 'SymbolsOutlineOpen' },
|
2023-11-28 13:02:36 +08:00
|
|
|
keys = {
|
|
|
|
vim.keymap.set('n', '<leader>o', ':SymbolsOutline<cr>'),
|
|
|
|
},
|
2023-11-11 11:45:14 +08:00
|
|
|
opts = { autofold_depth = 12 }
|
|
|
|
},
|
|
|
|
{
|
2023-11-23 15:24:50 +08:00
|
|
|
'stevearc/dressing.nvim',
|
|
|
|
event = "UIEnter"
|
2023-11-11 11:45:14 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"lewis6991/gitsigns.nvim",
|
|
|
|
event = "BufEnter",
|
2023-11-11 15:04:42 +08:00
|
|
|
opts = {
|
|
|
|
signcolumn = false,
|
|
|
|
numhl = true,
|
|
|
|
current_line_blame_opts = {
|
|
|
|
delay = 300,
|
|
|
|
ignore_whitespace = false,
|
|
|
|
virt_text_priority = 100,
|
|
|
|
},
|
|
|
|
},
|
2023-11-23 15:24:50 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
-- misc and games
|
|
|
|
{
|
|
|
|
"m4xshen/hardtime.nvim",
|
|
|
|
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
|
|
|
|
opts = {
|
|
|
|
restriction_mode = "hint",
|
|
|
|
max_count = 4,
|
|
|
|
disable_mouse = false
|
|
|
|
},
|
|
|
|
event = "VeryLazy"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"seandewar/killersheep.nvim",
|
|
|
|
cmd = "KillKillKill"
|
2023-10-31 14:21:12 +08:00
|
|
|
}
|
2023-11-11 10:22:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
local vscode_plugins = {
|
2023-11-28 13:02:36 +08:00
|
|
|
{
|
|
|
|
"machakann/vim-sandwich",
|
|
|
|
keys = "s"
|
|
|
|
},
|
2023-11-11 10:22:57 +08:00
|
|
|
{
|
|
|
|
"numToStr/Comment.nvim",
|
|
|
|
event = "BufEnter",
|
2023-11-11 11:45:14 +08:00
|
|
|
config = function()
|
2023-11-11 10:22:57 +08:00
|
|
|
require("Comment").setup()
|
|
|
|
end
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
if vim.g.vscode then
|
|
|
|
-- VSCode extension
|
|
|
|
require("lazy").setup(vscode_plugins, opts)
|
|
|
|
else
|
|
|
|
-- ordinary Neovim
|
|
|
|
require("lazy").setup(plugins, opts)
|
|
|
|
end
|