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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
|
local PKGS = {
-- Plugin manager
{ url = "https://github.com/savq/paq-nvim.git" };
-- Common
{ url = "https://github.com/kyazdani42/nvim-web-devicons.git" };
{ url = "https://github.com/ojroques/nvim-osc52.git" };
{ url = "https://github.com/chrisgrieser/nvim-spider.git" };
{ url = "https://github.com/nvim-orgmode/orgmode.git" };
{ url = "https://github.com/kyazdani42/nvim-tree.lua.git" };
{ url = "https://github.com/nvim-telescope/telescope.nvim.git" };
{ url = "https://github.com/nvim-lua/plenary.nvim.git" };
{ url = "https://github.com/kevinhwang91/nvim-ufo.git" };
{ url = "https://github.com/kevinhwang91/promise-async.git" };
{ url = "https://github.com/iamcco/markdown-preview.nvim.git" };
{ url = "https://github.com/folke/which-key.nvim.git" };
{ url = "https://github.com/tpope/vim-abolish.git" };
{ url = "https://github.com/mg979/vim-visual-multi.git" };
{ url = "https://github.com/echasnovski/mini.nvim.git" };
{ url = "https://github.com/catppuccin/nvim.git" };
{ url = "https://github.com/mbbill/undotree.git" };
{ url = "https://github.com/chentoast/marks.nvim.git" };
-- Status line
{ url = "https://github.com/akinsho/bufferline.nvim.git" };
{ url = "https://github.com/nvim-lualine/lualine.nvim.git" };
-- Code colors
{ url = "https://github.com/lukas-reineke/indent-blankline.nvim.git" };
{ url = "https://github.com/nvim-treesitter/nvim-treesitter.git" };
{ url = "https://github.com/nvim-treesitter/nvim-treesitter-context" };
{ url = "https://github.com/norcalli/nvim-colorizer.lua.git" };
{ url = "https://github.com/mracos/mermaid.vim.git" };
{ url = "https://github.com/jlcrochet/vim-razor.git" };
-- Themes
{ url = "https://github.com/dracula/vim.git" };
{ url = "https://github.com/folke/tokyonight.nvim.git" };
{ url = "https://github.com/Mofiqul/vscode.nvim.git" };
{ url = "https://github.com/sainnhe/sonokai.git" };
{ url = "https://github.com/navarasu/onedark.nvim.git" };
{ url = "https://github.com/Mofiqul/adwaita.nvim.git" };
{ url = "https://github.com/projekt0n/github-nvim-theme.git" };
-- LCOV Coverage
{ url = "https://github.com/google/vim-coverage.git" };
{ url = "https://github.com/google/vim-maktaba.git" };
{ url = "https://github.com/editorconfig/editorconfig-vim.git" };
-- Some bugs when opening shell files
-- { url = "https://github.com/nathom/filetype.nvim.git" };
{ url = "https://github.com/wfxr/minimap.vim.git" };
-- LSP
{ url = "https://github.com/neovim/nvim-lspconfig.git" };
{ url = "https://github.com/hrsh7th/nvim-cmp.git" };
{ url = "https://github.com/hrsh7th/cmp-nvim-lsp.git" };
{ url = "https://github.com/hrsh7th/cmp-buffer.git" };
{ url = "https://github.com/hrsh7th/cmp-path.git" };
{ url = "https://github.com/hrsh7th/cmp-cmdline.git" };
{ url = "https://github.com/hrsh7th/cmp-vsnip.git" };
{ url = "https://github.com/hrsh7th/vim-vsnip.git" };
{ url = "https://github.com/onsails/lspkind.nvim.git" };
{ url = "https://github.com/folke/trouble.nvim.git" };
{ url = "https://github.com/folke/lsp-colors.nvim.git" };
{ url = "https://github.com/nanotee/sqls.nvim.git" };
{ url = "https://github.com/lvimuser/lsp-inlayhints.nvim.git" };
{ url = "https://github.com/sigmaSd/deno-nvim.git" };
{ url = "https://github.com/ray-x/lsp_signature.nvim.git" };
{ url = "https://github.com/Hoffs/omnisharp-extended-lsp.nvim.git" };
{ url = "https://github.com/lewis6991/gitsigns.nvim.git" };
{ url = "https://github.com/jacobsimpson/nvim-mercurial.git" };
-- Deprecated
-- { url = "https://github.com/jose-elias-alvarez/null-ls.nvim.git" };
{ url = "https://github.com/nvimtools/none-ls.nvim.git" };
{ url = "https://github.com/mfussenegger/nvim-dap.git" };
{ url = "https://github.com/rcarriga/nvim-dap-ui.git" };
{ url = "https://github.com/nvim-neotest/nvim-nio.git" };
{ url = "https://github.com/antoinemadec/FixCursorHold.nvim.git" };
{ url = "https://github.com/nvim-neotest/neotest.git" };
{ url = "https://github.com/nvim-neotest/nvim-nio.git" };
{ url = "https://github.com/Issafalcon/neotest-dotnet.git" };
{ url = "https://github.com/VidocqH/lsp-lens.nvim.git" };
{ url = "https://github.com/simrat39/rust-tools.nvim.git" };
-- Dev container
{ url = "https://codeberg.org/esensar/nvim-dev-container.git" };
-- Games
{ url = "https://github.com/alec-gibson/nvim-tetris.git" };
{ url = "https://github.com/seandewar/nvimesweeper.git" };
}
local function init_plugins()
local paq = require("paq")
local indent_blankline = require("ibl")
local indent_blankline_hooks = require("ibl.hooks")
local colorizer = require("colorizer")
local ufo = require("ufo")
local catppuccin = require("catppuccin")
local osc52 = require("osc52")
local devcontainer = require("devcontainer")
local whichkey = require("which-key")
local orgmode = require("orgmode")
local nvim_treesitter_config = require("nvim-treesitter.configs")
local mini_surround = require("mini.surround")
local mini_comment = require("mini.comment")
local gitsigns = require("gitsigns")
local marks = require("marks")
local neotest = require("neotest")
local telescope = require("telescope")
local telescopeConfig = require("telescope.config")
local previewers = require("telescope.previewers")
local lsp_lens = require('lsp-lens')
local _bad = { ".*%.cshtml" }
local bad_files = function(filepath)
for _, v in ipairs(_bad) do if filepath:match(v) then return false end end
return true
end
local new_maker = function(filepath, bufnr, opts)
opts = opts or {}
if opts.use_ft_detect == nil then opts.use_ft_detect = true end
opts.use_ft_detect = opts.use_ft_detect == false and false or
bad_files(filepath)
previewers.buffer_previewer_maker(filepath, bufnr, opts)
end
paq(PKGS)
local highlight = {
"RainbowRed";
"RainbowYellow";
"RainbowBlue";
"RainbowOrange";
"RainbowGreen";
"RainbowViolet";
"RainbowCyan";
}
-- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes
indent_blankline_hooks.register(indent_blankline_hooks.type.HIGHLIGHT_SETUP,
function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)
indent_blankline.setup({ indent = { highlight = highlight; tab_char = "▎" } })
colorizer.setup({ "*" }, {
RGB = true; -- #RGB hex codes
RRGGBB = true; -- #RRGGBB hex codes
names = true; -- "Name" codes like Blue
RRGGBBAA = false; -- #RRGGBBAA hex codes
rgb_fn = false; -- CSS rgb() and rgba() functions
hsl_fn = false; -- CSS hsl() and hsla() functions
css = false; -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = false; -- Enable all CSS *functions*: rgb_fn, hsl_fn
-- Available modes: foreground, background
mode = "foreground"; -- Set the display mode.
})
vim.g.minimap_auto_start = 0
vim.g.minimap_highlight_range = 1
vim.g.minimap_highlight_search = 1
ufo.setup({
provider_selector = function(bufnr, filetype, buftype)
return { "treesitter"; "indent" }
end;
});
catppuccin.setup({
transparent_background = true;
show_end_of_line = true;
term_colors = true;
})
vim.o.foldcolumn = "1"
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
osc52.setup {
max_length = 0; -- Maximum length of selection (0 for no limit)
silent = false; -- Disable message on successful copy
trim = false; -- Trim surrounding whitespaces before copy
}
devcontainer.setup({ always_mount = {} })
whichkey.setup({})
nvim_treesitter_config.setup({
ensure_installed = {
"javascript";
"typescript";
"lua";
"c_sharp";
"jsonc";
"org";
};
ignore_install = {};
modules = {};
sync_install = false;
auto_install = true;
highlight = {
enable = true;
disable = { "markdown"; "yaml"; "sql"; "help" };
additional_vim_regex_highlighting = { "org" };
};
})
orgmode.setup({ org_default_notes_file = "~/.cache/org/refile.org" })
mini_surround.setup({})
mini_comment.setup({
-- Options which control module behavior
options = {
-- Whether to ignore blank lines
ignore_blank_line = true;
-- Whether to recognize as comment only lines without indent
start_of_line = false;
-- Whether to ensure single space pad for comment parts
pad_comment_parts = true;
};
-- Module mappings. Use `''` (empty string) to disable one.
mappings = {
-- Toggle comment (like `gcip` - comment inner paragraph) for both
-- Normal and Visual modes
comment = "gc";
-- Toggle comment on current line
comment_line = "gcc";
-- Define 'comment' textobject (like `dgc` - delete whole comment block)
textobject = "gc";
};
})
gitsigns.setup {
signs = {
add = {
hl = "GitSignsAdd";
text = "│";
numhl = "GitSignsAddNr";
linehl = "GitSignsAddLn";
};
change = {
hl = "GitSignsChange";
text = "│";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
delete = {
hl = "GitSignsDelete";
text = "_";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
topdelete = {
hl = "GitSignsDelete";
text = "‾";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
changedelete = {
hl = "GitSignsChange";
text = "~";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
untracked = {
hl = "GitSignsAdd";
text = "┆";
numhl = "GitSignsAddNr";
linehl = "GitSignsAddLn";
};
};
signcolumn = true; -- Toggle with `:Gitsigns toggle_signs`
numhl = true; -- Toggle with `:Gitsigns toggle_numhl`
linehl = false; -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false; -- Toggle with `:Gitsigns toggle_word_diff`
watch_gitdir = { interval = 1000; follow_files = true };
attach_to_untracked = true;
current_line_blame = true; -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true;
virt_text_pos = "eol"; -- 'eol' | 'overlay' | 'right_align'
delay = 0;
ignore_whitespace = false;
};
current_line_blame_formatter = "<author>, <author_time:%Y-%m-%d> - <summary>";
sign_priority = 6;
update_debounce = 100;
status_formatter = nil; -- Use default
max_file_length = 40000; -- Disable if file is longer than this (in lines)
preview_config = {
-- Options passed to nvim_open_win
border = "single";
style = "minimal";
relative = "cursor";
row = 0;
col = 1;
};
yadm = { enable = false };
}
marks.setup({
-- whether to map keybinds or not. default true
default_mappings = false;
-- which builtin marks to show. default {}
builtin_marks = { "."; "<"; ">"; "^" };
-- whether movements cycle back to the beginning/end of buffer. default true
cyclic = true;
-- whether the shada file is updated after modifying uppercase marks. default false
force_write_shada = false;
-- how often (in ms) to redraw signs/recompute mark positions.
-- higher values will have better performance but may cause visual lag,
-- while lower values may cause performance penalties. default 150.
refresh_interval = 250;
-- sign priorities for each type of mark - builtin marks, uppercase marks, lowercase
-- marks, and bookmarks.
-- can be either a table with all/none of the keys, or a single number, in which case
-- the priority applies to all marks.
-- default 10.
sign_priority = { lower = 10; upper = 15; builtin = 8; bookmark = 20 };
-- disables mark tracking for specific filetypes. default {}
excluded_filetypes = { "" };
mappings = {};
})
neotest.setup({ adapters = { require("neotest-dotnet") } })
-- Clone the default Telescope configuration
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
-- I want to search in hidden/dot files.
table.insert(vimgrep_arguments, "--hidden")
-- I don't want to search in the `.git` directory.
table.insert(vimgrep_arguments, "--glob")
table.insert(vimgrep_arguments, "!**/.git/*")
telescope.setup({
defaults = {
-- `hidden = true` is not supported in text grep commands.
vimgrep_arguments = vimgrep_arguments;
buffer_previewer_maker = new_maker;
};
pickers = {
find_files = {
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
find_command = {
"rg";
"--files";
"--hidden";
"--glob";
"!**/.git/*";
"--trim";
};
};
live_grep = {
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
find_command = {
"rg";
"--files";
"--hidden";
"--glob";
"!**/.git/*";
"--trim";
};
path_display = { "smart" };
only_sort_text = true;
word_match = "-w";
search = "";
};
};
})
local SymbolKind = vim.lsp.protocol.SymbolKind
local all_symbols = {
vim.lsp.protocol.SymbolKind.File,
vim.lsp.protocol.SymbolKind.Module,
vim.lsp.protocol.SymbolKind.Namespace,
vim.lsp.protocol.SymbolKind.Package,
vim.lsp.protocol.SymbolKind.Class,
vim.lsp.protocol.SymbolKind.Method,
vim.lsp.protocol.SymbolKind.Property,
vim.lsp.protocol.SymbolKind.Field,
vim.lsp.protocol.SymbolKind.Constructor,
vim.lsp.protocol.SymbolKind.Enum,
vim.lsp.protocol.SymbolKind.Interface,
vim.lsp.protocol.SymbolKind.Function,
vim.lsp.protocol.SymbolKind.Variable,
vim.lsp.protocol.SymbolKind.Constant,
vim.lsp.protocol.SymbolKind.String,
vim.lsp.protocol.SymbolKind.Number,
vim.lsp.protocol.SymbolKind.Boolean,
vim.lsp.protocol.SymbolKind.Array,
vim.lsp.protocol.SymbolKind.Object,
vim.lsp.protocol.SymbolKind.Key,
vim.lsp.protocol.SymbolKind.Null,
vim.lsp.protocol.SymbolKind.EnumMember,
vim.lsp.protocol.SymbolKind.Struct,
vim.lsp.protocol.SymbolKind.Event,
vim.lsp.protocol.SymbolKind.Operator,
vim.lsp.protocol.SymbolKind.TypeParameter,
}
lsp_lens.setup({
enable = false,
include_declaration = false, -- Reference include declaration
sections = { -- Enable / Disable specific request, formatter example looks 'Format Requests'
definition = true,
references = true,
implements = true,
git_authors = false,
},
ignore_filetype = {
"prisma",
},
-- Target Symbol Kinds to show lens information
target_symbol_kinds = all_symbols, -- { SymbolKind.Function, SymbolKind.Method, SymbolKind.Interface, },
-- Symbol Kinds that may have target symbol kinds as children
wrapper_symbol_kinds = { SymbolKind.Class, SymbolKind.Struct, SymbolKind.Enum, SymbolKind.Interface, },
})
end
local function clone_paq()
local path = vim.fn.stdpath("data") .. "/site/pack/paqs/start/paq-nvim"
if vim.fn.empty(vim.fn.glob(path)) > 0 then
vim.fn.system {
"git";
"clone";
"--depth=1";
"https://github.com/savq/paq-nvim.git";
path;
}
return true
else
return false
end
end
local function bootstrap_paq()
clone_paq()
-- Load Paq
vim.cmd("packadd paq-nvim")
local paq = require("paq")
-- Read and install packages
paq(PKGS)
paq.install()
end
return {
clone_paq = clone_paq;
bootstrap_paq = bootstrap_paq;
init_plugins = init_plugins;
}
|