-
Notifications
You must be signed in to change notification settings - Fork 0
/
uts-plugins.lua
1482 lines (1448 loc) · 52.8 KB
/
uts-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
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 basic_plugins = {
{ "echasnovski/mini.ai", version = false },
{
"saghen/blink.cmp",
lazy = false, -- lazy loading handled internally
-- optional: provides snippets for the snippet source
dependencies = "rafamadriz/friendly-snippets",
-- use a release tag to download pre-built binaries
version = "v0.*",
-- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
-- build = 'cargo build --release',
-- If you use nix, you can build from source using latest nightly rust with:
-- build = 'nix run .#build-plugin',
opts = {
-- 'default' for mappings similar to built-in completion
-- 'super-tab' for mappings similar to vscode (tab to accept, arrow keys to navigate)
-- 'enter' for mappings similar to 'super-tab' but with 'enter' to accept
-- see the "default configuration" section below for full documentation on how to define
-- your own keymap.
keymap = {
["<C-q>"] = { "show", "hide" },
["<Up>"] = { "select_prev", "fallback" },
["<Down>"] = { "select_next", "fallback" },
["<CR>"] = { "accept", "fallback" },
["<Right>"] = { "accept", "fallback" },
["<Left>"] = { "hide" },
},
highlight = {
-- sets the fallback highlight groups to nvim-cmp's highlight groups
-- useful for when your theme doesn't support blink.cmp
-- will be removed in a future release, assuming themes add support
use_nvim_cmp_as_default = true,
},
-- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
-- adjusts spacing to ensure icons are aligned
nerd_font_variant = "mono",
-- experimental auto-brackets support
accept = { auto_brackets = { enabled = true } },
-- experimental signature help support
-- trigger = { signature_help = { enabled = true }, show_in_snippet = false },
sources = {
completion = {
enabled_providers = { "lsp", "path", "snippets", "buffer" }, -- , "emoji" }, -- , 'buffer' },
},
},
providers = {
snippets = {
enabled = function(ctx)
return ctx ~= nil
and ctx.trigger.kind == vim.lsp.protocol.CompletionTriggerKind.TriggerCharacter
end,
},
},
windows = {
autocomplete = {
auto_show = false,
selection = "manual",
draw = "reversed",
-- winblend = vim.o.pumblend,
},
documentation = {
auto_show = false,
},
ghost_text = {
enabled = false,
},
},
-- providers = {
-- -- create provider
-- emoji = {
-- name = "emoji", -- IMPORTANT: use the same name as you would for nvim-cmp
-- module = "blink.compat.source",
-- opts = {
-- -- this table is passed directly to the proxied completion source
-- -- as the `option` field in nvim-cmp's source config
-- },
-- },
-- },
},
},
-- LSP servers and clients communicate what features they support through "capabilities".
-- By default, Neovim support a subset of the LSP specification.
-- With blink.cmp, Neovim has *more* capabilities which are communicated to the LSP servers.
-- Explanation from TJ: https://youtu.be/m8C0Cq9Uv9o?t=1275
--
-- This can vary by config, but in-general for nvim-lspconfig:
{
"neovim/nvim-lspconfig",
dependencies = { "saghen/blink.cmp" },
config = function(_, opts)
local lspconfig = require "lspconfig"
for server, config in pairs(opts.servers or {}) do
config.capabilities = require("blink.cmp").get_lsp_capabilities(config.capabilities)
lspconfig[server].setup(config)
end
end,
},
}
local ui_plugins = {
-- {
-- "lukelex/railscasts.nvim",
-- dependencies = { "rktjmp/lush.nvim" }
-- },
{
"RRethy/base16-nvim",
lazy = false,
-- config = function()
-- vim.cmd "colorscheme base16-railscasts"
-- end,
},
{
"tribela/transparent.nvim",
event = "VimEnter",
config = true,
},
{
"nvim-telescope/telescope-symbols.nvim",
keys = {
{ "<leader>se", "<cmd>Telescope symbols<cr>", desc = "Search Symbols: emoji, latex" },
},
},
{
"j-hui/fidget.nvim",
opts = {
-- options
},
},
{
"oxtna/vshow.nvim",
config = function()
require("vshow").setup {
all = {
{ character = "eol", symbol = "↲" },
{ character = "tab", symbol = "→•" },
{ character = "space", symbol = "·" },
{ character = "multispace", symbol = "··" },
{ character = "lead", symbol = "·" },
{ character = "trail", symbol = "-" },
{ character = "extends", symbol = "" },
{ character = "precedes", symbol = "" },
{ character = "conceal", symbol = "" },
{ character = "nbsp", symbol = "+" },
},
-- char = {},
-- line = {},
-- block = {},
}
end,
},
{
"sindrets/diffview.nvim",
event = "BufRead",
},
{
"kdheepak/lazygit.nvim",
lazy = true,
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
-- keys = {
-- { "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
-- }
},
{
"topaxi/gh-actions.nvim",
keys = {
{ "<leader>gh", "<cmd>GhActions<cr>", desc = "Open Github Actions" },
{ "<leader>ga", "<cmd>GhActions<cr>", desc = "Open Github Actions" },
{
"<leader>gq",
function()
require("gh-actions").close()
end,
desc = "Close Github Actions",
},
},
-- optional, you can also install and use `yq` instead.
-- build = 'make',
opts = {
icons = {
workflow_dispatch = "⚡️",
conclusion = {
success = "✅",
failure = "❌",
startup_failure = "❗",
cancelled = "⊘",
skipped = "◌",
},
status = {
unknown = "?",
pending = "○",
queued = "○",
requested = "○",
waiting = "○",
in_progress = "●",
},
},
},
dependencies = {
"MunifTanjim/nui.nvim",
},
},
{ "wakatime/vim-wakatime", lazy = false },
{
"folke/trouble.nvim",
opts = {}, -- for default options, refer to the configuration section for custom setup.
cmd = "Trouble",
keys = {
{
"<leader>xx",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leader>xX",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>cs",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>cl",
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
desc = "LSP Definitions / references / ... (Trouble)",
},
{
"<leader>xL",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>xQ",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
},
{
"MagicDuck/grug-far.nvim",
config = function()
require("grug-far").setup {
-- options, see Configuration section below
-- there are no required options atm
-- engine = 'ripgrep' is default, but 'astgrep' can be specified
}
end,
keys = {
{
"<leader>ss",
"<cmd>lua require('grug-far').toggle_instance({instanceName='default'})<cr>",
desc = "Toggle Spectre",
},
{
"<leader>sw",
"<cmd>lua require('grug-far').open({ prefills = { search = vim.fn.expand('<cword>') } })<cr>",
desc = "Spectre (word)",
},
},
},
{
"iamcco/markdown-preview.nvim",
build = "cd app && npm install",
ft = "markdown",
config = function()
vim.g.mkdp_auto_start = 1
end,
keys = {
{ "<leader>mm", "<cmd>MarkdownPreviewToggle<cr>", desc = "Toggle Markdown Preview" },
},
},
{
"nvchad/showkeys",
cmd = "ShowkeysToggle",
opts = {
timeout = 1,
maxkeys = 7,
show_count = true,
excluded_modes = { "i" },
position = "top-right",
winopts = {
focusable = false,
relative = "editor",
style = "minimal",
border = "rounded",
height = 1,
row = 1,
col = 0,
},
},
keys = {
{ "<leader>kk", "<cmd>ShowkeysToggle<cr>", desc = "Show Keys" },
},
},
-- {
-- "4513ECHO/nvim-keycastr",
-- init = function()
-- local enabled = false
-- local config_set = false
-- vim.keymap.set("n", "<Leader>kk", function()
-- vim.notify(("%s keycastr"):format(enabled and "Disabling" or "Enabling"))
-- local keycastr = require "keycastr"
-- if not config_set then
-- keycastr.config.set { win_config = { border = "rounded" }, position = "NE" }
-- config_set = true
-- end
-- keycastr[enabled and "disable" or "enable"]()
-- enabled = not enabled
-- end)
-- end,
-- },
{
"MeanderingProgrammer/render-markdown.nvim",
-- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite
-- dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.icons" }, -- if you use standalone mini plugins
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" }, -- if you prefer nvim-web-devicons
opts = {
enable = true,
render_modes = true,
heading = {
position = "inline",
-- border = true,
-- width = "block",
-- min_width = 30,
-- above = "▃",
-- below = "🬂",
width = "full",
-- icons = { "◉ ", "○ ", "✸ ", "✿ " },
-- backgrounds = { "CursorLine" },
-- foregrounds = {
-- "@markup.heading.1.markdown",
-- "@markup.heading.2.markdown",
-- "@markup.heading.3.markdown",
-- "@markup.heading.4.markdown",
-- "@markup.heading.5.markdown",
-- "@markup.heading.6.markdown",
-- },
-- backgrounds = {
-- "@text.title.1.markdown",
-- "@text.title.2.markdown",
-- "@text.title.3.markdown",
-- "@text.title.4.markdown",
-- "@text.title.5.markdown",
-- "@text.title.6.markdown",
-- },
-- border_prefix = true,
-- border = true,
-- border_virtual = true,
-- foregrounds = {
-- "RenderMarkdownH1",
-- "RenderMarkdownH2",
-- "RenderMarkdownH3",
-- "RenderMarkdownH4",
-- "RenderMarkdownH5",
-- "RenderMarkdownH6",
-- -- },
-- backgrounds = {
-- "RenderMarkdownH1",
-- "RenderMarkdownH2",
-- "RenderMarkdownH3",
-- "RenderMarkdownH4",
-- "RenderMarkdownH5",
-- "RenderMarkdownH6",
-- },
},
},
ft = { "markdown", "quarto" },
},
-- {
-- "3rd/image.nvim",
-- config = function()
-- require("image").setup {
-- -- processor = "magick_cli",
-- }
-- end,
-- },
{
"vhyrro/luarocks.nvim",
priority = 1001, -- this plugin needs to run before anything else
opts = {
rocks = { "magick" },
},
},
{
"3rd/image.nvim",
dependencies = { "luarocks.nvim" },
config = function()
require("image").setup {
backend = "kitty",
processor = "magick_cli",
integrations = {
markdown = {
filetypes = { "markdown", "vimwiki", "quarto" },
only_render_image_at_cursor = true,
},
},
}
-- ...
end,
},
{
"folke/noice.nvim",
event = "VeryLazy",
opts = {
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
routes = {
{
filter = {
event = "msg_show",
any = {
{ find = "%d+L, %d+B" },
{ find = "; after #%d+" },
{ find = "; before #%d+" },
},
},
view = "mini",
},
},
presets = {
bottom_search = true,
command_palette = true,
long_message_to_split = true,
},
-- based on https://github.com/folke/noice.nvim/issues/779#issuecomment-2081998250
views = {
cmdline_popup = {
-- backend = "popup",
-- relative = "editor",
-- zindex = 200,
position = {
row = "40%", -- 40% from top of the screen. This will position it almost at the center.
col = "50%",
},
size = {
width = 120,
height = "auto",
},
-- win_options = {
-- winhighlight = {
-- Normal = "NoiceCmdlinePopup",
-- FloatTitle = "NoiceCmdlinePopupTitle",
-- FloatBorder = "NoiceCmdlinePopupBorder",
-- IncSearch = "",
-- CurSearch = "",
-- Search = "",
-- },
-- winbar = "",
-- foldenable = false,
-- cursorline = false,
-- },
},
popupmenu = {
-- relative = 'editor', -- "'cursor'"|"'editor'"|"'win'"
position = {
row = "auto", -- Popup will show up below the cmdline automatically
col = "auto",
},
size = {
width = 120, -- Making this as wide as the cmdline_popup
height = "auto",
},
border = {
style = "double", -- 'double'"|"'none'"|"'rounded'"|"'shadow'"|"'single'"|"'solid'
padding = { 0, 1 },
},
win_options = {
winhighlight = {
Normal = "NoicePopupmenu", -- Normal | NoicePopupmenu
FloatBorder = "NoicePopupmenuBorder", -- DiagnosticInfo | NoicePopupmenuBorder
CursorLine = "NoicePopupmenuSelected",
PmenuMatch = "NoicePopupmenuMatch",
},
},
},
},
cmdline = {
-- view = "cmdline",
view = "cmdline_popup",
},
},
keys = {
{ "<leader>sn", "", desc = "+noice" },
{
"<S-Enter>",
function()
require("noice").redirect(vim.fn.getcmdline())
end,
mode = "c",
desc = "Redirect Cmdline",
},
{
"<leader>snl",
function()
require("noice").cmd "last"
end,
desc = "Noice Last Message",
},
{
"<leader>snh",
function()
require("noice").cmd "history"
end,
desc = "Noice History",
},
{
"<leader>sna",
function()
require("noice").cmd "all"
end,
desc = "Noice All",
},
{
"<leader>snd",
function()
require("noice").cmd "dismiss"
end,
desc = "Dismiss All",
},
{
"<leader>snt",
function()
require("noice").cmd "nick"
end,
desc = "Noice Picker (Telescope/FzfLua)",
},
{
"<c-f>",
function()
if not require("noice.lsp").scroll(4) then
return "<c-f>"
end
end,
silent = true,
expr = true,
desc = "Scroll Forward",
mode = { "i", "n", "s" },
},
{
"<c-b>",
function()
if not require("noice.lsp").scroll(-4) then
return "<c-b>"
end
end,
silent = true,
expr = true,
desc = "Scroll Backward",
mode = { "i", "n", "s" },
},
},
config = function(_, opts)
-- HACK: noice shows messages from before it was enabled,
-- but this is not ideal when Lazy is installing plugins,
-- so clear the messages in this case.
if vim.o.filetype == "lazy" then
vim.cmd [[messages clear]]
end
require("noice").setup(opts)
end,
},
{
"folke/persistence.nvim",
event = "BufReadPre", -- this will only start session saving when an actual file was opened
opts = {
-- add any custom options here
},
keys = {
{
"<leader>rs",
function()
require("persistence").load()
end,
"Load the session for the current working directory",
},
{
"<leader>rS",
function()
require("persistence").select()
end,
"Select a session to load",
},
},
},
{
"hedyhli/outline.nvim",
lazy = true,
cmd = { "Outline", "OutlineOpen" },
keys = { -- Example mapping to toggle outline
{ "<leader>o", "<cmd>Outline<CR>", desc = "Toggle outline" },
},
opts = {
symbol_folding = {
autofold_depth = 1,
auto_unfold = {
hovered = true,
},
},
auto_jump = true,
outline_window = {
auto_jump = true,
},
-- preview_window = {
-- auto_preview = true,
-- },
},
},
}
local lang_plugins = {
{
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
lua = { "stylua" },
bib = { "trim_whitespace" },
},
format_on_save = {
-- These options will be passed to conform.format()
timeout_ms = 500,
lsp_format = "fallback",
},
},
},
{
"kentookura/forester.nvim",
-- "utensil/forester.nvim",
-- branch = "main",
-- dir = "/Users/utensil/projects/forester.nvim",
-- before = { "nvim-cmp" },
-- branch = "36-installation-and-initialization",
-- tried removing this for the auto-completion to have a non-nil `forester_current_config`
event = "VeryLazy",
dependencies = {
{ "nvim-telescope/telescope.nvim" },
{ "nvim-treesitter/nvim-treesitter" },
{ "nvim-lua/plenary.nvim" },
{ "hrsh7th/nvim-cmp" },
},
-- -- maybe could be even lazier with these, but not working, because `forester` filetype is not registered yet
-- ft = "tree",
-- ft = "forester",
config = function()
-- can't run this because it treesitter might not be initialized
-- vim.cmd.TSInstall "toml"
-- this ensures that the treesitter is initialized, and toml is installed
local configs = require "nvim-treesitter.configs"
configs.setup {
ensure_installed = { "toml" },
sync_install = true,
}
-- this ensures forester is initialized, makeing `forester` tree-sitter available
require("forester").setup()
-- can't run this explicitly, because next launch of nvim will ask for reinstallation
-- vim.cmd.TSInstall "forester"
-- installs the forester tree-sitter, so the syntax highlighting is available
configs.setup {
ensure_installed = { "toml", "forester" },
sync_install = false,
}
-- local foresterCompletionSource = require "forester.completion"
-- local cmp = require "cmp"
-- cmp.register_source("forester", foresterCompletionSource)
-- cmp.setup.filetype("forester", { sources = { { name = "forester", dup = 0 } } })
-- cmp.setup()
end,
keys = {
{ "<localleader>n", "<cmd>Forester new<cr>", desc = "Forester - New" },
{ "<localleader>b", "<cmd>Forester browse<cr>", desc = "Forester - Browse" },
{ "<localleader>l", "<cmd>Forester link_new<cr>", desc = "Forester - Link New" },
{ "<localleader>t", "<cmd>Forester transclude_new<cr>", desc = "Forester - Transclude New" },
{
"<localleader>c",
function()
local cmd = "just new"
local prefix = vim.fn.input "Enter prefix: "
if prefix ~= "" then
cmd = cmd .. " " .. prefix
else
cmd = cmd .. " uts"
end
local file = io.popen(cmd):read "*a"
vim.cmd("e " .. file)
end,
desc = "Forester - New from Command",
},
},
},
{
"mrcjkb/rustaceanvim",
version = "^5", -- Recommended
lazy = false, -- This plugin is already lazy
-- ft = { "rust" },
config = function()
vim.g.rustaceanvim = {
-- server = {
-- on_attach = require("lvim.lsp").common_on_attach,
-- },
server = {
default_settings = {
-- rust-analyzer language server configuration
["rust-analyzer"] = {
checkOnSave = {
enable = true,
command = "clippy",
},
cargo = {
buildScripts = {
enable = false,
},
},
-- procMacro = {
-- enable = false,
-- },
cachePriming = {
enable = true,
numThreads = 4,
},
},
},
},
}
end,
},
{
"Julian/lean.nvim",
event = { "BufReadPre *.lean", "BufNewFile *.lean" },
dependencies = {
"neovim/nvim-lspconfig",
"nvim-lua/plenary.nvim",
-- you also will likely want nvim-cmp or some completion engine
},
-- see details below for full configuration options
opts = {
lsp = {},
mappings = true,
},
},
}
local llm_plugins = {
{
"github/copilot.vim",
event = "VeryLazy",
},
{
"CopilotC-Nvim/CopilotChat.nvim",
event = "VeryLazy",
branch = "canary",
dependencies = {
-- { "zbirenbaum/copilot.lua" },
{ "github/copilot.vim" },
{ "nvim-telescope/telescope.nvim" }, -- Use telescope for help actions
{ "nvim-lua/plenary.nvim" }, -- for curl, log wrapper
},
build = "make tiktoken", -- Only on MacOS or Linux
opts = {
-- debug = true, -- Enable debugging
-- See Configuration section for rest
-- window = {
-- layout = "float",
-- relative = "cursor",
-- width = 1,
-- height = 0.4,
-- row = 1,
-- },
},
keys = {
-- Code related commands
{
"<leader>ae",
mode = "x",
"<cmd>'<,'>CopilotChatExplain<cr>",
desc = "CopilotChat - Explain code",
},
{
"<leader>at",
mode = "x",
"<cmd>'<,'>CopilotChatTests<cr>",
desc = "CopilotChat - Generate tests",
},
{
"<leader>ar",
mode = "x",
"<cmd>'<,'>CopilotChatReview<cr>",
desc = "CopilotChat - Review code",
},
{
"<leader>aR",
mode = "x",
"<cmd>'<,'>CopilotChatRefactor<cr>",
desc = "CopilotChat - Refactor code",
},
{
"<leader>an",
mode = "x",
"<cmd>'<,'>CopilotChatBetterNamings<cr>",
desc = "CopilotChat - Better Naming",
},
{
"<leader>ao",
mode = "x",
"<cmd>'<,'>CopilotChatOptimize<cr>",
desc = "CopilotChat - Optimize code",
},
{ "<leader>ad", "<cmd>CopilotChatDebugInfo<cr>", desc = "CopilotChat - Debug Info" },
{ "<leader>af", "<cmd>CopilotChatFixDiagnostic<cr>", desc = "CopilotChat - Fix Diagnostic" },
{ "<leader>al", "<cmd>CopilotChatReset<cr>", desc = "CopilotChat - Clear buffer and chat history" },
{ "<leader>aa", "<cmd>CopilotChatToggle<cr>", desc = "CopilotChat - Toggle" },
{
"<leader>aa",
mode = "x",
function()
require("CopilotChat").ask("Let's discuss the following", {
selection = require("CopilotChat.select").visual,
})
-- local actions = require "CopilotChat.actions"
-- actions.pick(actions.prompt_actions {
-- selection = require("CopilotChat.select").visual,
-- })
end,
desc = "CopilotChat - for selection",
},
{ "<leader>a?", "<cmd>CopilotChatModels<cr>", desc = "CopilotChat - Select Models" },
{
"<leader>ai",
function()
local input = vim.fn.input "Ask Copilot: "
if input ~= "" then
vim.cmd("CopilotChat " .. input)
end
end,
desc = "CopilotChat - Ask input",
},
-- Generate commit message based on the git diff
{
"<leader>am",
"<cmd>CopilotChatCommit<cr>",
desc = "CopilotChat - Generate commit message for all changes",
},
{
"<leader>aM",
"<cmd>CopilotChatCommitStaged<cr>",
desc = "CopilotChat - Generate commit message for staged changes",
},
},
},
}
local unused_llm_plugins = {
-- {
-- "zbirenbaum/copilot.lua",
-- cmd = "Copilot",
-- event = "InsertEnter",
-- config = function()
-- require("copilot").setup {
-- suggestion = {
-- auto_trigger = true,
-- keymap = {
-- -- but this has made the normal tab not working
-- accept = "<Tab>",
-- accept_word = false,
-- accept_line = false,
-- next = "<M-]>",
-- prev = "<M-[>",
-- dismiss = "<S-Tab>",
-- },
-- },
-- }
-- end,
-- },
{
"olimorris/codecompanion.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
-- "hrsh7th/nvim-cmp", -- Optional: For using slash commands and variables in the chat buffer
"nvim-telescope/telescope.nvim", -- Optional: For using slash commands
{ "stevearc/dressing.nvim", opts = {} }, -- Optional: Improves `vim.ui.select`
{ "echasnovski/mini.diff", version = false },
},
config = function()
require("codecompanion").setup {
display = {
diff = {
provider = "mini_diff",
},
},
strategies = {
chat = {
-- adapter = "copilot",
adapter = "xai",
},
inline = {
-- adapter = "copilot",
adapter = "xai",
},
},
}
end,
keys = {
-- use <C-z> to trigger CodeCompanion for both n and v
{ "<localleader>z", mode = "n", "<cmd>CodeCompanion<cr>", desc = "CodeCompanion - Inline" },
{ "<localleader>z", mode = "v", "<cmd>'<,'>CodeCompanion<cr>", desc = "CodeCompanion - Inline" },
{ "<C-a>", mode = "n", "<cmd>CodeCompanionActions<cr>", desc = "CodeCompanion - Actions" },
{ "<C-a>", mode = "v", "<cmd>'<,'>CodeCompanionActions<cr>", desc = "CodeCompanion - Actions" },
{ "<localleader>a", mode = "n", "<cmd>CodeCompanionChat Toggle<cr>", desc = "CodeCompanion - Chat Toggle" },
{
"<localleader>a",
mode = "v",
"<cmd>'<,'>CodeCompanionChat Toggle<cr>",
desc = "CodeCompanion - Chat Toggle",
},
{ "ga", mode = "v", "<cmd>CodeCompanionChat Add<cr>", desc = "CodeCompanion - Chat Add" },
},
},
{
"frankroeder/parrot.nvim",
dependencies = { "ibhagwan/fzf-lua", "nvim-lua/plenary.nvim" }, -- "rcarriga/nvim-notify" },
-- optionally include "rcarriga/nvim-notify" for beautiful notifications
event = "VeryLazy",
lazy = false,
config = function(_, opts)
-- require("notify").setup {
-- background_colour = "#000000",
-- render = "compact",
-- -- top_down = false,
-- }
require("parrot").setup(opts)
end,
opts = {
-- Providers must be explicitly added to make them available.
providers = {
-- anthropic = {
-- api_key = os.getenv "ANTHROPIC_API_KEY",
-- },
-- gemini = {
-- api_key = os.getenv "GEMINI_API_KEY",
-- },
-- groq = {
-- api_key = os.getenv "GROQ_API_KEY",
-- },
-- mistral = {
-- api_key = os.getenv "MISTRAL_API_KEY",
-- },
-- pplx = {
-- api_key = os.getenv "PERPLEXITY_API_KEY",
-- },
-- -- provide an empty list to make provider available (no API key required)
-- ollama = {},
-- openai = {
-- api_key = os.getenv "OPENAI_API_KEY",
-- },
github = {
api_key = os.getenv "GITHUB_TOKEN",
},
-- nvidia = {
-- api_key = os.getenv "NVIDIA_API_KEY",
-- },
-- xai = {
-- api_key = os.getenv "XAI_API_KEY",
-- },
},
user_input_ui = "buffer",