-
Notifications
You must be signed in to change notification settings - Fork 2
/
init.lua
318 lines (295 loc) · 9.42 KB
/
init.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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
do -- Install lazy.nvim plugin manager.
local lazypath = vim.fn.stdpath("config") .. "/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)
end
local function transparent_bg()
-- 透明
vim.cmd [[highlight Normal guibg=NONE guisp=NONE]]
vim.cmd [[highlight SignColumn guibg=NONE guisp=NONE]]
vim.cmd [[highlight ColorColumn guibg=NONE guisp=NONE]]
vim.cmd [[highlight CursorColumn guibg=NONE guisp=NONE]]
vim.cmd [[highlight CursorLineNr guibg=NONE guisp=NONE]]
vim.cmd [[highlight LineNr guibg=NONE guisp=NONE]]
vim.cmd [[highlight CursorLine guibg=NONE guisp=NONE]]
vim.cmd [[highlight DiagnosticSignInfo guibg=NONE guisp=NONE]]
vim.cmd [[highlight DiagnosticSignError guibg=NONE guisp=NONE]]
vim.cmd [[highlight DiagnosticSignWarn guibg=NONE guisp=NONE]]
vim.cmd [[highlight DiagnosticSignHint guibg=NONE guisp=NONE]]
vim.cmd [[highlight! link WinSeparator CursorLine]]
end
-- load global configuration
require('options-config')
require('lazy').setup({
-- LSP
{
'neovim/nvim-lspconfig',
config = function()
require('config.lspconfig').setup()
require('utils.keymap').register_module(require('config.lspconfig.keymap'))
end
},
{
'folke/trouble.nvim',
config = function() require('config.trouble') end,
dependencies = {
'nvim-tree/nvim-web-devicons',
'nvim-telescope/telescope.nvim',
}
},
{ 'kosayoda/nvim-lightbulb', config = function() require('config.nvim-lightbulb') end },
{
'weilbith/nvim-code-action-menu',
config = function()
local mod = require('config.nvim-code-action-menu')
mod.setup()
require('utils.keymap').register_module(mod)
end
},
{ 'folke/neodev.nvim', config = function() require('neodev').setup() end },
-- Linter
{
"mfussenegger/nvim-lint",
config = function()
require("config.nvim-lint").setup()
end
},
-- Compeletion
{
'hrsh7th/nvim-cmp',
dependencies = {
'hrsh7th/cmp-nvim-lsp-signature-help',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lua',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-vsnip',
'hrsh7th/vim-vsnip',
'onsails/lspkind.nvim', -- require by nvim-cmp configuration
},
config = function() require('config.nvim-cmp').setup() end
},
-- Treesitter
{ 'nvim-treesitter/nvim-treesitter', config = function() require('config.nvim-treesitter') end },
{ 'nvim-treesitter/playground', dependencies = { 'nvim-treesitter/nvim-treesitter' } },
-- { 'nvim-treesitter/nvim-treesitter-context', config = function() require('config.treesitter-context') end },
-- Git
{
'kdheepak/lazygit.nvim',
config = function()
local lazygit = require('config.lazygit')
require('utils.keymap').register_module(lazygit)
end
},
{
'lewis6991/gitsigns.nvim',
config = function()
require('config.gitsigns').setup()
require('utils.keymap').register_module(require('config.gitsigns.keymap'))
end
},
-- File Explore
{ 'kyazdani42/nvim-tree.lua', config = function() require('config.nvim-tree') end },
-- Tasks
{
'stevearc/overseer.nvim',
config = function()
require('config.overseer').setup()
require('utils.keymap').register_module(require('config.overseer.keymap'))
end,
},
-- Navigation.
{
"cbochs/grapple.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
},
{
'MattesGroeger/vim-bookmarks',
lazy = false,
config = function()
require('config.bookmarks').setup()
end
},
{
'nvim-telescope/telescope.nvim',
lazy = false,
dependencies = {
'smartpde/telescope-recent-files',
'BurntSushi/ripgrep',
"nvim-lua/plenary.nvim",
},
config = function()
local mod = require('config.telescope')
mod.setup()
require('utils.keymap').register_module(require('config.telescope.keymap'))
end
},
{
'simrat39/symbols-outline.nvim',
config = function()
require('config.symbols-outline').setup()
require('utils.keymap').register_module(require('config.symbols-outline'))
end
},
'itchyny/vim-cursorword',
{
'phaazon/hop.nvim',
branch = 'v2', -- optional but strongly recommended
config = function()
local hop = require('config.hop')
hop.setup()
require('utils.keymap').register_module(hop)
end
},
-- StatusLine.
{
'glepnir/galaxyline.nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
'nvim-treesitter/nvim-treesitter',
'neovim/nvim-lspconfig',
'nvim-telescope/telescope.nvim',
},
config = function() require('config.galaxyline').setup() end
},
'nvim-lua/lsp-status.nvim',
-- Tabline
{
'seblj/nvim-tabline',
dependencies = {
'nvim-tree/nvim-web-devicons',
},
config = function()
require('tabline').setup({
no_name = '[No Name]', -- Name for buffers with no name
modified_icon = '', -- Icon for showing modified buffer
close_icon = '', -- Icon for closing tab with mouse
separator = "▌", -- Separator icon on the left side
padding = 3, -- Prefix and suffix space
color_all_icons = false, -- Color devicons in active and inactive tabs
right_separator = false, -- Show right separator on the last tab
show_index = true, -- Shows the index of tab before filename
show_icon = true, -- Shows the devicon
})
end
},
-- Themes.
{
'JoosepAlviste/palenightfall.nvim',
cond = true,
config = function()
-- vim.cmd [[colorscheme palenightfall]]
end
},
{
'folke/tokyonight.nvim',
cond = true,
config = function()
-- vim.cmd [[colorscheme tokyonight-night]]
end
},
{
"rebelot/kanagawa.nvim",
cond = true,
config = function()
require('config.themes.kanagawa').setup()
end,
dependencies = {
'nvim-telescope/telescope.nvim',
},
},
{
'AlexvZyl/nordic.nvim',
lazy = false,
cond = false,
priority = 1000,
config = function()
require('nordic').setup {
transparent_bg = true,
brighter_border = true,
reduce_blue = false,
bold_keywork = true,
}
require 'nordic'.load()
end
},
{
"catppuccin/nvim",
cond = false,
name = "catppuccin",
config = function()
vim.cmd('set termguicolors')
vim.cmd('colorscheme catppuccin-mocha')
transparent_bg()
end
},
-- 'EdenEast/nightfox.nvim',
-- Notification.
{
'rcarriga/nvim-notify',
dependencies = { "rebelot/kanagawa.nvim" },
config = function()
require('config.nvim-notify').setup()
require('utils.keymap').register_module(require('config.nvim-notify.keymap'))
end
},
-- Indent.
-- UI
{
"folke/noice.nvim",
--event = "VeryLazy",
opts = {},
dependencies = {
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
"MunifTanjim/nui.nvim",
-- OPTIONAL:
-- `nvim-notify` is only needed, if you want to use the notification view.
-- If not available, we use `mini` as the fallback
"rcarriga/nvim-notify",
},
config = function()
require('config.noice').setup()
transparent_bg()
require('utils.keymap').register_module(require('config.noice'))
end
},
{
'stevearc/dressing.nvim',
},
-- Animation
-- { 'echasnovski/mini.animate', config = function() require('config.mini-animate').setup() end },
-- Highlight
{
'brenoprata10/nvim-highlight-colors',
config = function()
require('nvim-highlight-colors').setup()
--vim.api.nvim_set_option('t_Co', '256')
end
},
-- Other.
'tpope/vim-surround',
{ 'ii14/neorepl.nvim', config = function() require('config.neorepl').setup() end },
}, {
root = vim.fn.stdpath('config') .. "/lazy",
defaults = {
lazy = false
},
})
-- load global configuration.
require('global-config')
-- Load autocmd configuration.
require('autocmd-config').setup()
-- Load rpc plugin.
require('rplugin-config').setup()
-- Do key mapping.
require('utils.keymap').apply_modules_keymap()