-
Notifications
You must be signed in to change notification settings - Fork 11
/
plugins.lua
201 lines (200 loc) · 5.64 KB
/
plugins.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
-- Install Lazy.nvim automatically if it's not installed(Bootstraping)
-- Hint: string concatenation is done by `..`
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)
-- After installation, run `checkhealth lazy` to see if everything goes right
-- Hints:
-- build: it will be executed when a plugin is installed or updated
-- config: it will be executed when the plugin loads
-- event: Lazy-load on event
-- dependencies: A list of plugin names or plugin specs that should be loaded when the plugin loads
-- ft: Lazy-load on filetype
-- cmd: Lazy-load on command
-- init: functions are always executed during startup
require("lazy").setup({
-- LSP manager
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
-- Add hooks to LSP to support Linter && Formatter
{
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"nvimtools/none-ls.nvim",
},
config = function()
-- Note:
-- the default search path for `require` is ~/.config/nvim/lua
-- use a `.` as a path seperator
-- the suffix `.lua` is not needed
require("config.mason-null-ls")
end,
},
-- Vscode-like pictograms
{
"onsails/lspkind.nvim",
event = { "VimEnter" },
},
-- Auto-completion engine
{
"hrsh7th/nvim-cmp",
dependencies = { "lspkind.nvim" },
config = function()
require("config.nvim-cmp")
end,
},
{ "hrsh7th/cmp-nvim-lsp", dependencies = { "nvim-cmp" } },
{ "hrsh7th/cmp-buffer", dependencies = { "nvim-cmp" } }, -- buffer auto-completion
{ "hrsh7th/cmp-path", dependencies = { "nvim-cmp" } }, -- path auto-completion
{ "hrsh7th/cmp-cmdline", dependencies = { "nvim-cmp" } }, -- cmdline auto-completion
-- Code snippet engine
{
"L3MON4D3/LuaSnip",
version = "v2.*",
},
-- Colorscheme
"tanvirtin/monokai.nvim",
-- Git integration
"tpope/vim-fugitive",
-- Git decorations
{
"lewis6991/gitsigns.nvim",
config = function()
require("config.gitsigns")
end,
},
-- Autopairs: [], (), "", '', etc
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require("config.nvim-autopairs")
end,
},
-- Code comment helper
-- 1. `gcc` to comment a line
-- 2. select lines in visual mode and run `gc` to comment/uncomment lines
"tpope/vim-commentary",
-- Treesitter-integration
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("config.nvim-treesitter")
end,
},
-- Show indentation and blankline
{
"lukas-reineke/indent-blankline.nvim",
config = function()
require("config.indent-blankline")
end,
},
-- Status line
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("config.lualine")
end,
},
-- Markdown support
{ "preservim/vim-markdown", ft = { "markdown" } },
-- Markdown previewer
-- NOTE: It require nodejs and yarn. Use homebrew to install first
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && yarn install",
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
},
-- File explorer
{
"nvim-tree/nvim-tree.lua",
dependencies = {
"nvim-tree/nvim-web-devicons", -- optional, for file icons
},
config = function()
require("config.nvim-tree")
end,
},
-- Smart motion
-- Usage: Enter 2-character search pattern then press a label character to
-- pick your target.
-- Initiate the sesarch with `s`(forward) or `S`(backward)
{
"ggandor/leap.nvim",
config = function()
-- See `:h leap-custom-mappings` for more details
require("leap").create_default_mappings()
end,
},
-- Make surrounding easier
-- ------------------------------------------------------------------
-- Old text Command New text
-- ------------------------------------------------------------------
-- surr*ound_words gziw) (surround_words)
-- *make strings gz$" "make strings"
-- [delete ar*ound me!] gzd] delete around me!
-- remove <b>HTML t*ags</b> gzdt remove HTML tags
-- 'change quot*es' gzc'" "change quotes"
-- delete(functi*on calls) gzcf function calls
-- ------------------------------------------------------------------
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
-- You can use the VeryLazy event for things that can
-- load later and are not important for the initial UI
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- To solve the conflicts with leap.nvim
-- See: https://github.com/ggandor/leap.nvim/discussions/59
keymaps = {
insert = "<C-g>z",
insert_line = "gC-ggZ",
normal = "gz",
normal_cur = "gZ",
normal_line = "gzgz",
normal_cur_line = "gZgZ",
visual = "gz",
visual_line = "gZ",
delete = "gzd",
change = "gzc",
},
})
end,
},
-- Better terminal integration
{
"akinsho/toggleterm.nvim",
version = "*",
config = function()
require("config.toggleterm")
end,
},
-- Fuzzy finder
{
"nvim-telescope/telescope.nvim",
branch = "0.1.x",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("config.telescope")
end,
},
})