-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.lua
1115 lines (1102 loc) · 44.8 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
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
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local function bootstrap_package_manager()
-- Testing out lazy.nvim though this same logic can
-- be used to pull down packer if we revert to that
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)
end
local function get_plugins()
local lsp_settings = {}
local excluded_filetypes_array = {
"lsp-installer",
"lspinfo",
"Outline",
"lazy",
"help",
"packer",
"netrw",
"qf",
"dbui",
"Trouble",
"fugitive",
"floaterm",
"spectre_panel",
"spectre_panel_write",
"checkhealth",
"man",
"dap-repl",
"toggleterm",
"neo-tree",
"ImportManager",
"aerial",
}
local excluded_filetypes_table = {}
for _, value in ipairs(excluded_filetypes_array) do
excluded_filetypes_table[value] = 1
end
local active_bg = '#A066E8'
local plugins = {
-- Local import function
{
"miversen33/import.nvim",
lazy = false,
dev = true,
config = function()
require("import").config({ output_split_type = "vertical", import_enable_better_printing = true })
end,
priority = 1001, -- Highest priority?
},
-- General Utilities
{
"folke/trouble.nvim",
config = true
},
{
"kevinhwang91/nvim-hlslens",
config = function()
local hlslens = require("hlslens")
hlslens.setup({
override_lens = function(render, posList, nearest, idx, relIdx)
local sfw = vim.v.searchforward == 1
local indicator, text, chunks
local absRelIdx = math.abs(relIdx)
if absRelIdx > 1 then
indicator = ('%d%s'):format(absRelIdx, sfw ~= (relIdx > 1) and '▲' or '▼')
elseif absRelIdx == 1 then
indicator = sfw ~= (relIdx == 1) and '▲' or '▼'
else
indicator = ''
end
local lnum, col = unpack(posList[idx])
if nearest then
local cnt = #posList
if indicator ~= '' then
text = ('[%s %d/%d]'):format(indicator, idx, cnt)
else
text = ('[%d/%d]'):format(idx, cnt)
end
chunks = { { ' ', 'Ignore' }, { text, 'HlSearchLensNear' } }
else
text = ('[%s %d]'):format(indicator, idx)
chunks = { { ' ', 'Ignore' }, { text, 'HlSearchLens' } }
end
render.setVirt(0, lnum - 1, col - 1, chunks, nearest)
end
})
end
},
{
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
opts = {
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.norg.concealer"] = {}, -- Adds pretty icons to your documents
["core.norg.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
notes = "~/.local/share/nvim/neorg/notes",
ideas = "~/.local/share/nvim/neorg/ideas",
presentations = "~/.local/share/nvim/neorg/presentations",
scratch = "~/.local/share/nvim/neorg/scratch",
work = "~/.local/share/nvim/neorg/work"
},
default_workspace = "scratch"
},
},
}
},
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter"
},
config = true
},
-- Themes
{
"Mofiqul/vscode.nvim", -- Vscode type theme
lazy = false,
priority = 1000,
config = {
-- -- Enable transparent background
-- transparent = true,
-- Enable italic comment
italic_comments = true,
},
},
{
'nvim-zh/colorful-winsep.nvim',
config = function()
local winsep = require("colorful-winsep")
local bg = require("vscode.colors").get_colors().vscBack
winsep.setup({
highlight = {
fg = active_bg,
bg = bg
},
no_exec_files = excluded_filetypes_array,
-- Rounded corners gud
symbols = { "─", "│", "╭", "╮", "╰", "╯" },
})
end
},
{
"nvim-lualine/lualine.nvim", -- Neovim status line
dependencies = {
"kyazdani42/nvim-web-devicons",
"SmiteshP/nvim-navic",
"onsails/lspkind-nvim",
"f-person/git-blame.nvim"
},
lazy = false,
priority = 999,
config = function()
vim.g.gitblame_display_virtual_text = 0
local lualine = require("lualine")
local nvim_navic = require("nvim-navic")
local git_blame = require("gitblame")
nvim_navic.setup({
seperator = "",
highlight = true,
})
local create_symbol_bar = function()
if not nvim_navic.is_available() then
return ""
end
local details = {}
for _, item in ipairs(nvim_navic.get_data()) do
-- For some reason sumneko adds a random ` ->` to the end of the name *sometimes*
-- This accounts for that I guess...
table.insert(details, item.icon .. item.name:gsub("%s*->%s*", ""))
-- Looks like we have some more weirdness coming from sumneko...
end
return table.concat(details, " > ")
end
local get_buf_filetype = function()
return vim.api.nvim_buf_get_option(0, "filetype")
end
local format_name = function(output)
if excluded_filetypes_table[get_buf_filetype()] then
return ""
end
return output
end
local branch_max_width = 40
local branch_min_width = 10
lualine.setup({
options = {
theme = "vscode",
disabled_filetypes = {
winbar = excluded_filetypes_array,
},
globalstatus = true,
},
sections = {
lualine_a = {
"mode",
{
"branch",
fmt = function(output)
local win_width = vim.o.columns
local max = branch_max_width
if win_width * 0.25 < max then
max = math.floor(win_width * 0.25)
end
if max < branch_min_width then
max = branch_min_width
end
if max % 2 ~= 0 then
max = max + 1
end
if output:len() >= max then
return output:sub(1, (max / 2) - 1)
.. "..."
.. output:sub( -1 * ((max / 2) - 1), -1)
end
return output
end,
},
},
lualine_b = {
{
"filename",
file_status = false,
path = 1,
fmt = format_name,
},
{
"diagnostics",
update_in_insert = true,
},
},
lualine_c = {
{
git_blame.get_current_blame_text,
cond = git_blame.is_blame_text_available,
color = { fg = '#ABABAB', gui='italic'}
}
},
lualine_x = {
"import",
},
-- Combine x and y
lualine_y = {
{
function()
local lsps = vim.lsp.get_active_clients({ bufnr = vim.fn.bufnr() })
local icon = require("nvim-web-devicons").get_icon_by_filetype(
vim.api.nvim_buf_get_option(0, "filetype")
)
if lsps and #lsps > 0 then
local names = {}
for _, lsp in ipairs(lsps) do
table.insert(names, lsp.name)
end
return string.format("%s %s", table.concat(names, ", "), icon)
else
return icon or ""
end
end,
on_click = function()
vim.api.nvim_command("LspInfo")
end,
color = function()
local _, color = require("nvim-web-devicons").get_icon_cterm_color_by_filetype(
vim.api.nvim_buf_get_option(0, "filetype")
)
return { fg = color }
end,
},
"encoding",
"progress",
},
lualine_z = {
"location",
{
function()
local starts = vim.fn.line("v")
local ends = vim.fn.line(".")
local count = starts <= ends and ends - starts + 1 or starts - ends + 1
return count .. "V"
end,
cond = function()
return vim.fn.mode():find("[Vv]") ~= nil
end,
},
},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {
{
"filetype",
icon_only = true,
},
{
"filename",
path = 1,
fmt = format_name,
},
},
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
winbar = {
lualine_a = {
{ "filetype", icon_only = true, icon = { align = "left" } },
{ "filename", file_status = false, path = 0 },
},
lualine_b = {},
lualine_c = { create_symbol_bar },
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
inactive_winbar = {
lualine_a = {
{ "filetype", icon_only = true, icon = { align = "left" } },
{ "filename", file_status = false, path = 0 },
},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {},
lualine_z = {},
},
})
end,
},
{
"noib3/nvim-cokeline", -- Neovim Tab/Buffer Bar.
priority = 999,
config = function()
local cokeline = require("cokeline")
local colors = require("vscode.colors").get_colors()
local get_hex = require("cokeline.utils").get_hex
local active_bg_color = active_bg
local inactive_bg_color = colors.vscContext
local bg_color = get_hex("ColorColumn", "bg")
local no_error_color = "#3DEB63"
local error_color = "#C95157"
local warn_color = "#e1c400"
local setup = {
show_if_buffers_are_at_least = 1,
buffers = {
filter_valid = function(buffer)
if excluded_filetypes_table[buffer.type] or excluded_filetypes_table[buffer.filetype] then
return false
end
return true
end,
},
mappings = {
cycle_prev_next = true,
},
default_hl = {
bg = function(buffer)
if buffer.is_focused then
return active_bg_color
else
return inactive_bg_color
end
end,
},
components = {
{
text = function(buffer)
local _text = ""
if buffer.index > 1 then
_text = " "
end
if buffer.is_focused or buffer.is_first then
_text = _text .. ""
end
return _text
end,
fg = function(buffer)
if buffer.is_focused then
return active_bg_color
elseif buffer.is_first then
return inactive_bg_color
end
end,
bg = function(buffer)
if buffer.is_focused then
if buffer.is_first then
return bg_color
else
return inactive_bg_color
end
elseif buffer.is_first then
return bg_color
end
end,
},
{
text = function(buffer)
local status = ""
if buffer.is_readonly then
status = " ➖"
elseif buffer.is_modified then
status = " "
end
return status
end,
fg = function(buffer)
if buffer.is_focused and (buffer.is_readonly or buffer.is_modified) then
return warn_color
end
end,
},
{
text = function(buffer)
return " " .. buffer.devicon.icon
end,
fg = function(buffer)
if buffer.is_focused then
return buffer.devicon.color
end
end,
},
{
text = function(buffer)
return buffer.unique_prefix .. buffer.filename .. " "
end,
fg = function(buffer)
if buffer.diagnostics.errors > 0 then
return error_color
end
end,
style = function(buffer)
local text_style = "NONE"
if buffer.is_focused then
text_style = "bold"
end
if buffer.diagnostics.errors > 0 then
if text_style ~= "NONE" then
text_style = text_style .. ",underline"
else
text_style = "underline"
end
end
return text_style
end,
},
{
text = function(buffer)
local errors = buffer.diagnostics.errors
if errors <= 9 then
errors = ""
else
errors = "🙃"
end
return errors .. " "
end,
fg = function(buffer)
if buffer.diagnostics.errors == 0 then
return no_error_color
elseif buffer.diagnostics.errors <= 9 then
return error_color
end
end,
},
{
text = " ",
delete_buffer_on_left_click = true,
},
{
text = function(buffer)
if buffer.is_focused or buffer.is_last then
return ""
else
return " "
end
end,
fg = function(buffer)
if buffer.is_focused then
return active_bg_color
elseif buffer.is_last then
return inactive_bg_color
else
return bg_color
end
end,
bg = function(buffer)
if buffer.is_focused then
if buffer.is_last then
return bg_color
else
return inactive_bg_color
end
elseif buffer.is_last then
return bg_color
end
end,
},
},
}
cokeline.setup(setup)
end,
},
-- use('edluffy/specs.nvim') -- Neovim cursorline jump highlighter
-- Utilities
{
"RRethy/vim-illuminate",
config = function()
require("illuminate").configure()
vim.api.nvim_set_keymap(
"n",
"<C-n>",
':lua require("illuminate").goto_next_reference()<CR>',
{ silent = true, noremap = true }
)
vim.api.nvim_set_keymap(
"n",
"<C-N>",
':lua require("illuminate").goto_prev_reference()<CR>',
{ silent = true, noremap = true }
)
end,
},
{
"phaazon/mind.nvim", -- Mind mapping/note taking
dependencies = {
"nvim-lua/plenary.nvim",
},
config = true,
},
{
"lukas-reineke/indent-blankline.nvim", -- Neovim indentation handling
config = {
filetype_exclude = excluded_filetypes_array,
show_current_context = true,
show_current_context_start = true,
use_treesitter = true,
},
},
{
"tami5/sqlite.lua", -- Neovim SQlite database
lazy = true,
},
{
"nvim-treesitter/nvim-treesitter", -- Neovim treesitter
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
-- If TS highlights are not enabled at all, or disabled via `disable` prop, highlighting will fallback to default Vim syntax highlighting
highlight = { enable = true },
markid = { enable = true },
})
end,
},
{
"nvim-telescope/telescope.nvim", -- Fuzzy Finder
dependencies = {
"nvim-lua/plenary.nvim",
},
},
{
"rcarriga/nvim-notify", -- Notify
config = function()
local notify = require("notify")
vim.notify = notify
notify.setup({})
end,
},
{
"ziontee113/icon-picker.nvim", -- Nerdfont picker
dependencies = {
"stevearc/dressing.nvim",
"nvim-telescope/telescope.nvim",
},
config = true,
},
{
"RaafatTurki/hex.nvim", -- Enables hex editor for neovim
config = true,
},
{
"kevinhwang91/nvim-ufo", -- Better folding? Idk we will see
dependencies = "kevinhwang91/promise-async",
},
{
"famiu/bufdelete.nvim", -- Better buffer deletion
},
{
"anuvyklack/hydra.nvim", -- Keymaps
config = function()
require("plugins.keymaps")
end,
},
{
"mrjones2014/smart-splits.nvim", -- Neovim better split handling?
lazy = true,
config = {
tmux_integration = false,
},
},
{
"stevearc/aerial.nvim", -- Better code outline??
config = {
ignore = { filetypes = excluded_filetypes_array },
backends = { "treesitter", "lsp", "markdown", "man" },
filter_kind = {
"Class",
"Constructor",
"Enum",
"Function",
"Interface",
"Module",
"Method",
"Struct",
"Variable",
},
layout = {
placement = "edge",
},
highlight_on_hover = true,
lazy_mode = false,
update_events = "TextChanged,InsertLeave,WinEnter,WinLeave",
show_guides = true,
attach_mode = "global",
},
},
{
"akinsho/toggleterm.nvim", -- Neovim Floating Terminal Framework
config = true,
},
{
"m-demare/hlargs.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter" },
config = true,
},
{
"numToStr/Comment.nvim", -- Neovim Commenting
config = true,
},
{
"ojroques/nvim-osc52", -- Neovim clipboard integration
config = function()
local osc52 = require("osc52")
osc52.setup({
max_length = 0,
silent = false,
trim = false,
})
local function copy(lines, _)
osc52.copy(table.concat(lines, "\n"))
end
local function paste()
return { vim.fn.split(vim.fn.getreg(""), "\n"), vim.fn.getregtype("") }
end
vim.keymap.set("n", "<leader>c", osc52.copy_operator, { expr = true })
vim.keymap.set("n", "<leader>cc", "<leader>c_", { remap = true })
vim.keymap.set("x", "<leader>c", osc52.copy_visual)
vim.g.clipboard = {
name = "osc52",
copy = {
["+"] = copy,
["*"] = copy,
},
paste = {
["+"] = paste,
["*"] = paste,
},
}
end,
},
-- Language Specific
{
"simrat39/rust-tools.nvim", -- Rust tools specific to neovim
config = true,
},
{
'mfussenegger/nvim-jdtls', -- Setup is done in the java filetype loader
},
-- IDE
{
"nvim-pack/nvim-spectre", -- Better search and replace?
},
{
"williamboman/mason.nvim", -- Neovim Language Tools (LSP, Debugger, Formatter, Linter, etc)
dependencies = {
"neovim/nvim-lspconfig", -- Neovim LSP Setup
"williamboman/mason-lspconfig.nvim", -- Mason lsp config bindings
"rcarriga/nvim-dap-ui", -- UI for Dap
"mfussenegger/nvim-dap", -- Debugger, setup below
"mfussenegger/nvim-lint", -- Neovim linter
"mhartington/formatter.nvim", -- Neovim formatter
"SmiteshP/nvim-navic", -- Navigational helper using lspconfig
"hrsh7th/cmp-nvim-lsp", -- Neovim LSP feeder for cmp
"jbyuki/one-small-step-for-vimkind", -- Neovim Dap
},
config = function()
require("mason").setup()
local lspconf = require("lspconfig")
local mason_lspconfig = require("mason-lspconfig")
local nvim_navic = require("nvim-navic")
local cmp_nvim_lsp = require("cmp_nvim_lsp")
local dap = require("dap")
local dapui = require("dapui")
local osv = require("osv")
local lsp_capabilities = cmp_nvim_lsp.default_capabilities()
lsp_capabilities.textDocument.completion.completionItem.snippetSupport = true
local lsp_handlers = {
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }),
["textDocument/signatureHelp"] = vim.lsp.with(
vim.lsp.handlers.signature_help,
{ border = "rounded" }
),
}
local global_on_attach = function(client, bufnr)
if client.server_capabilities.documentSymbolProvider then
nvim_navic.attach(client, bufnr)
end
end
vim.fn.sign_define("DiagnosticSignError", {
text = "",
numhl = "DiagnosticSignError",
texthl = "DiagnosticSignError",
})
vim.fn.sign_define("DiagnosticSignWarn", {
text = "⚠",
numhl = "DiagnosticSignWarn",
texthl = "DiagnosticSignWarn",
})
vim.fn.sign_define("DiagnosticSignInformation", {
text = "",
numhl = "DiagnosticSignInformation",
texthl = "DiagnosticSignInformation",
})
vim.fn.sign_define("DiagnosticSignHint", {
text = "",
numhl = "DiagnosticSignHint",
texthl = "DiagnosticSignHint",
})
mason_lspconfig.setup({
automatic_installation = true,
})
mason_lspconfig.setup_handlers({
function(lsp)
local lsp_setting = lsp_settings[lsp] or {}
local _ = lsp_setting.on_attach
local lsp_on_attach = function(client, bufnr)
global_on_attach(client, bufnr)
if _ then
_(client, bufnr)
end
end
lsp_setting.on_attach = lsp_on_attach
lsp_setting.capabilities = lsp_capabilities
lsp_setting.handles = lsp_handlers
lspconf[lsp].setup(lsp_setting)
end,
["rust_analyzer"] = function()
require("rust-tools").setup()
end,
})
require("formatter").setup({
filetype = {
['*'] = {
require("formatter.filetypes.any"),
},
lua = {
-- You can also define your own configuration
function()
local util = require("formatter.util")
-- Full specification of configurations is down below and in Vim help
-- files
return {
exe = "stylua",
args = {
"--indent-type",
"Spaces",
"--search-parent-directories",
"--stdin-filepath",
util.escape_path(util.get_current_buffer_file_path()),
"--",
"-",
},
stdin = true,
}
end,
},
},
})
vim.fn.sign_define('DapBreakpoint', { text = '🔴', texthl = '', linehl = '', numhl = '' })
vim.fn.sign_define('DapBreakpointCondition', { text = '🔵', texthl = '', linehl = '', numhl = '' })
require('dap.ext.vscode').load_launchjs()
dapui.setup()
dap.listeners.after.event_initialized['dapui_config'] = function()
dapui.open()
end
dap.listeners.before.event_terminated['dapui_config'] = function()
dapui.close()
end
dap.listeners.after.event_exited['dapui_config'] = function()
dapui.close()
end
local osv_port = 8086
if not dap.launch_server then dap.launch_server = {} end
dap.configurations.lua = {
{
type = 'nlua',
request = 'attach',
name = "Attach to running Neovim instance",
}
}
dap.adapters.nlua = function(callback, config)
callback({ type = 'server', host = config.host or "127.0.0.1", port = config.port or osv_port })
end
dap.launch_server['nil'] = function()
print("Starting OSV DAP Server")
osv.launch({port = osv_port})
end
end,
},
{
"theHamsta/nvim-dap-virtual-text", -- Neovim DAP Virutal Text lol what else do you think this is?'
build = ":TSUpdate",
},
{
"hrsh7th/nvim-cmp", -- Neovim autocompletion
dependencies = {
"rcarriga/cmp-dap", -- Neovim autocomplete for dap
"L3MON4D3/LuaSnip", -- Neovim Lua based snippet manager
"saadparwaiz1/cmp_luasnip", -- Neovim LuaSnip autocompletion engine for nvim-cmp
"hrsh7th/cmp-nvim-lsp", -- vim/neovim snippet stuffs
"KadoBOT/cmp-plugins", -- Neovim plugin autocompletion
"hrsh7th/cmp-buffer", -- vim/neovim snippet stuffs
"hrsh7th/cmp-path", -- vim/neovim snippet stuffs
"hrsh7th/cmp-cmdline", -- vim/neovim snippet stuffs
"hrsh7th/cmp-nvim-lsp-signature-help",
"windwp/nvim-autopairs", -- Auto pairs
"theHamsta/nvim-dap-virtual-text", -- Neovim DAP Virutal Text lol what else do you think this is?
"ray-x/cmp-treesitter", -- Neovim snippet for treesitter (Maybe replace the buffer completion?)
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
local cmp_dap = require("cmp_dap")
local cmp_plugins = require("cmp-plugins")
local nvim_autopairs = require("nvim-autopairs")
local ndvt = require("nvim-dap-virtual-text")
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
ndvt.setup()
nvim_autopairs.setup({
disabled_filetypes = excluded_filetypes_array,
})
cmp_plugins.setup({ files = { ".*\\.lua" } })
luasnip.config.set_config({ history = true, update_events = "TextChanged,TextChangedI" })
require("luasnip.loaders.from_vscode").lazy_load()
local confirm_mapping = function(fallback)
if luasnip.expandable() then
return luasnip.expand()
end
if cmp and cmp.visible() and cmp.get_active_entry() then
cmp.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = false,
})
return
end
fallback()
end
local next_option_mapping = function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
fallback()
end
end
local previous_option_mapping = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end
cmp.setup({
enabled = function()
return vim.api.nvim_buf_get_option(0, "buftype") ~= "prompt" or cmp_dap.is_dap_buffer()
end,
formatting = {
format = lspkind.cmp_format(),
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body) -- For `luasnip` users.
end,
},
mapping = {
["<Enter>"] = confirm_mapping,
["<Tab>"] = cmp.mapping({
i = confirm_mapping,
c = next_option_mapping,
}),
["<Down>"] = cmp.mapping(next_option_mapping, { "i" }),
["<Up>"] = cmp.mapping(previous_option_mapping, { "i" }),
["<S-Tab>"] = cmp.mapping(previous_option_mapping, { "c" }),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
["<C-Up>"] = cmp.mapping(cmp.mapping.scroll_docs( -4)),
["<C-Down>"] = cmp.mapping(cmp.mapping.scroll_docs(4)),
["<Esc>"] = cmp.mapping({
i = cmp.abort(),
c = cmp.close(),
}),
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "plugins" },
{ name = "luasnip", option = { show_autosnippets = true } }, -- For luasnip users.
{ name = "nvim_lsp_signature_help" },
{ name = "dictionary", keyword_length = 2 },
{ name = "path" },
-- { name = "treesitter" }
}, {
{ name = "buffer" },
}),
})
cmp.setup.cmdline("/", {
sources = {
{ name = "buffer" },
},
})
cmp.setup.cmdline(":", {
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
})
cmp.setup.filetype({ "dap-repl", "dapui_watches", "dapui_hover" }, {
sources = { name = "dap" },
})
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
},
{
"nvim-neo-tree/neo-tree.nvim", -- File Explorer
branch = "v2.x",
dependencies = {
"nvim-lua/plenary.nvim",
"kyazdani42/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
dev = false,
config = {
popup_border_style = 'rounded',
sources = {
"filesystem",
"buffers",
"netman.ui.neo-tree",
},
filesystem = {
filtered_items = {
visible = true,
hide_gitignored = false,
hide_hidden = false,
hide_dotfiles = false,
},
follow_current_file = true,
},
},
},
{
"miversen33/netman.nvim", -- Remove Resource Browser
dev = true,
branch = "v1.15",
config = function()
require("netman")
end,
},
{
"folke/lsp-colors.nvim", -- Neovim create missing lsp color highlight groups
config = true,
},
{