-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
1074 lines (996 loc) · 35 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 rocks_config = {
rocks_path = vim.env.HOME .. "/.local/share/nvim/rocks",
}
vim.g.rocks_nvim = rocks_config
local luarocks_path = {
vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?.lua"),
vim.fs.joinpath(rocks_config.rocks_path, "share", "lua", "5.1", "?", "init.lua"),
}
package.path = package.path .. ";" .. table.concat(luarocks_path, ";")
local luarocks_cpath = {
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.so"),
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.so"),
-- Remove the dylib and dll paths if you do not need macos or windows support
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dylib"),
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.dylib"),
vim.fs.joinpath(rocks_config.rocks_path, "lib", "lua", "5.1", "?.dll"),
vim.fs.joinpath(rocks_config.rocks_path, "lib64", "lua", "5.1", "?.dll"),
}
package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";")
vim.opt.runtimepath:append(vim.fs.joinpath(rocks_config.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*"))
local path_package = vim.fn.stdpath('data') .. '/site'
local mini_path = path_package .. '/pack/deps/start/mini.nvim'
if not vim.loop.fs_stat(mini_path) then
vim.cmd('echo "Installing `mini.nvim`" | redraw')
local clone_cmd = {
'git', 'clone', '--filter=blob:none',
-- Uncomment next line to use 'stable' branch
-- '--branch', 'stable',
'https://github.com/echasnovski/mini.nvim', mini_path
}
vim.fn.system(clone_cmd)
vim.cmd('packadd mini.nvim | helptags ALL')
end
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or 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)
-- Example using a list of specs with the default options
vim.g.mapleader = " " -- Make sure to set `mapleader` before lazy so your mappings are correct
vim.g.maplocalleader = "\\" -- Same for `maplocalleader`
require("lazy").setup({
'https://github.com/folke/which-key.nvim',
{ "folke/neoconf.nvim", cmd = "Neoconf" },
'https://github.com/folke/neodev.nvim',
'https://github.com/ErichDonGubler/vim-sublime-monokai',
'https://github.com/vim-airline/vim-airline',
'https://github.com/ryanoasis/vim-devicons',
'https://github.com/vim-airline/vim-airline.git',
'https://github.com/preservim/nerdtree',
'https://github.com/ap/vim-css-color.git',
'https://github.com/ryanoasis/vim-devicons',
'https://github.com/terryma/vim-multiple-cursors',
'https://github.com/exvim/ex-tagbar',
'https://github.com/junegunn/fzf.vim',
'https://github.com/skywind3000/vim-quickui',
'https://github.com/folke/noice.nvim',
'https://github.com/epwalsh/obsidian.nvim.git',
'https://github.com/williamboman/mason.nvim',
'https://github.com/rafi/awesome-vim-colorschemes.git',
'https://github.com/MunifTanjim/nui.nvim',
'https://github.com/rcarriga/nvim-notify',
'https://github.com/folke/lazy.nvim.git',
'https://github.com/folke/todo-comments.nvim.git',
'https://github.com/nvim-lua/plenary.nvim',
'https://github.com/j-hui/fidget.nvim',
'eandrju/cellular-automaton.nvim',
{
"williamboman/mason.nvim"
},
'https://github.com/petertriho/nvim-scrollbar.git',
'https://github.com/ryanoasis/vim-devicons',
{
"gbprod/yanky.nvim",
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
},
{
"vhyrro/luarocks.nvim",
priority = 1001, -- this plugin needs to run before anything else
opts = {
rocks = { "magick" },
},
},
{
"3rd/image.nvim",
dependencies = { "luarocks.nvim" },
config = function()
-- ...
end
},
{
'nvimdev/dashboard-nvim',
event = 'VimEnter',
config = function()
require('dashboard').setup {
-- config
}
end,
dependencies = { {'nvim-tree/nvim-web-devicons'}}
},
{
'goolord/alpha-nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function ()
require'alpha'.setup(require'alpha.themes.startify'.config)
end
},
'https://github.com/VonHeikemen/lsp-zero.nvim.git',
'https://github.com/rebelot/kanagawa.nvim.git',
'https://github.com/rebelot/kanagawa.nvim.git',
{
'nvimdev/lspsaga.nvim',
config = function()
require('lspsaga').setup({})
end,
dependencies = {
'nvim-treesitter/nvim-treesitter', -- optional
'nvim-tree/nvim-web-devicons', -- optional
}
},
{"ellisonleao/glow.nvim", config = true, cmd = "Glow"},
'https://github.com/junegunn/fzf.vim',
{'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons'},
{
'nvim-orgmode/orgmode',
},
{
"vhyrro/luarocks.nvim",
priority = 1000, -- Very high priority is required, luarocks.nvim should run as the first plugin in your config.
opts = {
rocks = { "fzy", "pathlib.nvim ~> 1.0" }, -- specifies a list of rocks to install
-- luarocks_build_args = { "--with-lua=/my/path" }, -- extra options to pass to luarocks's configuration script
},
},
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = function()
require("copilot").setup({})
end,
},
{
'mrcjkb/rustaceanvim',
version = '^4', -- Recommended
lazy = false, -- This plugin is already lazy
},
'https://github.com/wbthomason/packer.nvim',
'https://github.com/iamcco/markdown-preview.nvim.git',
{ "EdenEast/nightfox.nvim" },
{'tpope/vim-dispatch', opt = true, cmd = {'Dispatch', 'Make', 'Focus', 'Start'}},
{'andymass/vim-matchup', event = 'VimEnter *'},
{
'akinsho/flutter-tools.nvim',
lazy = false,
dependencies = {
'nvim-lua/plenary.nvim',
'stevearc/dressing.nvim', -- optional for vim.ui.select
},
config = true,
},
'https://github.com/neoclide/coc.nvim.git',
{
"vhyrro/luarocks.nvim",
priority = 1000,
config = true,
opts = {
rocks = { "lua-curl", "nvim-nio", "mimetypes", "xml2lua" }
}
},
{
"rest-nvim/rest.nvim",
ft = "http",
dependencies = { "luarocks.nvim" },
config = function()
require("rest-nvim").setup()
end,
},
'https://github.com/rktjmp/lush.nvim.git',
{
'stevearc/overseer.nvim',
opts = {},
},
{
'stevearc/overseer.nvim',
opts = {},
},
'https://github.com/rcarriga/nvim-notify.git',
{
'stevearc/dressing.nvim',
opts = {},
},
{'akinsho/toggleterm.nvim', version = "*", config = true},
'https://github.com/m4xshen/autoclose.nvim.git',
})
require("flutter-tools").setup {} -- use defaults
require("autoclose").setup()
require('overseer').setup()
require("dressing").setup({
input = {
-- Set to false to disable the vim.ui.input implementation
enabled = true,
-- Default prompt string
default_prompt = "Input",
-- Trim trailing `:` from prompt
trim_prompt = true,
-- Can be 'left', 'right', or 'center'
title_pos = "left",
-- When true, <Esc> will close the modal
insert_only = true,
-- When true, input will start in insert mode.
start_in_insert = true,
-- These are passed to nvim_open_win
border = "rounded",
-- 'editor' and 'win' will default to being centered
relative = "cursor",
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
prefer_width = 40,
width = nil,
-- min_width and max_width can be a list of mixed types.
-- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total"
max_width = { 140, 0.9 },
min_width = { 20, 0.2 },
buf_options = {},
win_options = {
-- Disable line wrapping
wrap = false,
-- Indicator for when text exceeds window
list = true,
listchars = "precedes:…,extends:…",
-- Increase this for more context when text scrolls off the window
sidescrolloff = 0,
},
-- Set to `false` to disable
mappings = {
n = {
["<Esc>"] = "Close",
["<CR>"] = "Confirm",
},
i = {
["<C-c>"] = "Close",
["<CR>"] = "Confirm",
["<Up>"] = "HistoryPrev",
["<Down>"] = "HistoryNext",
},
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
-- see :help dressing_get_config
get_config = nil,
},
select = {
-- Set to false to disable the vim.ui.select implementation
enabled = true,
-- Priority list of preferred vim.select implementations
backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" },
-- Trim trailing `:` from prompt
trim_prompt = true,
-- Options for telescope selector
-- These are passed into the telescope picker directly. Can be used like:
-- telescope = require('telescope.themes').get_ivy({...})
telescope = nil,
-- Options for fzf selector
fzf = {
window = {
width = 0.5,
height = 0.4,
},
},
-- Options for fzf-lua
fzf_lua = {
-- winopts = {
-- height = 0.5,
-- width = 0.5,
-- },
},
-- Options for nui Menu
nui = {
position = "50%",
size = nil,
relative = "editor",
border = {
style = "rounded",
},
buf_options = {
swapfile = false,
filetype = "DressingSelect",
},
win_options = {
winblend = 0,
},
max_width = 80,
max_height = 40,
min_width = 40,
min_height = 10,
},
-- Options for built-in selector
builtin = {
-- Display numbers for options and set up keymaps
show_numbers = true,
-- These are passed to nvim_open_win
border = "rounded",
-- 'editor' and 'win' will default to being centered
relative = "editor",
buf_options = {},
win_options = {
cursorline = true,
cursorlineopt = "both",
},
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- the min_ and max_ options can be a list of mixed types.
-- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total"
width = nil,
max_width = { 140, 0.8 },
min_width = { 40, 0.2 },
height = nil,
max_height = 0.9,
min_height = { 10, 0.2 },
-- Set to `false` to disable
mappings = {
["<Esc>"] = "Close",
["<C-c>"] = "Close",
["<CR>"] = "Confirm",
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
},
-- Used to override format_item. See :help dressing-format
format_item_override = {},
-- see :help dressing_get_config
get_config = nil,
},
})
require('copilot').setup({
panel = {
enabled = true,
auto_refresh = false,
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<CR>",
refresh = "gr",
open = "<M-CR>"
},
layout = {
position = "bottom", -- | top | left | right
ratio = 0.4
},
},
suggestion = {
enabled = true,
auto_trigger = false,
debounce = 75,
keymap = {
accept = "<M-l>",
accept_word = false,
accept_line = false,
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
filetypes = {
yaml = false,
markdown = false,
help = false,
gitcommit = false,
gitrebase = false,
hgcommit = false,
svn = false,
cvs = false,
["."] = false,
},
copilot_node_command = 'node', -- Node.js version must be > 18.x
server_opts_overrides = {},
})
require("copilot.suggestion").is_visible()
require("copilot.suggestion").accept(modifier)
require("copilot.suggestion").accept_word()
require("copilot.suggestion").accept_line()
require("copilot.suggestion").next()
require("copilot.suggestion").prev()
require("copilot.suggestion").dismiss()
require("copilot.suggestion").toggle_auto_trigger()
require("luarocks-nvim").setup()
vim.opt.termguicolors = true
require("bufferline").setup{}
require("glow").setup({
glow_path = "", -- will be filled automatically with your glow bin in $PATH, if any
install_path = "~/.local/bin", -- default path for installing glow binary
border = "shadow", -- floating window border config
style = "dark|light", -- filled automatically with your current editor background, you can override using glow json style
pager = false,
width = 80,
height = 100,
width_ratio = 0.7, -- maximum width of the Glow window compared to the nvim window size (overrides `width`)
height_ratio = 0.7,
})
require("image").setup({
backend = "kitty",
integrations = {
markdown = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
},
neorg = {
enabled = true,
clear_in_insert_mode = false,
download_remote_images = true,
only_render_image_at_cursor = false,
filetypes = { "norg" },
},
html = {
enabled = true,
},
css = {
enabled = true,
},
},
max_width = nil,
max_height = nil,
max_width_window_percentage = nil,
max_height_window_percentage = 50,
window_overlap_clear_enabled = false, -- toggles images when windows are overlapped
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "" },
editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus
tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened
})
require("yanky").setup({
ring = {
history_length = 100,
storage = "shada",
storage_path = vim.fn.stdpath("data") .. "/databases/yanky.db", -- Only for sqlite storage
sync_with_numbered_registers = true,
cancel_event = "update",
ignore_registers = { "_" },
update_register_on_cycle = false,
},
picker = {
select = {
action = nil, -- nil to use default put action
},
telescope = {
use_default_mappings = true, -- if default mappings should be used
mappings = nil, -- nil to use default mappings or no mappings (see `use_default_mappings`)
},
},
system_clipboard = {
sync_with_ring = true,
clipboard_register = nil,
},
highlight = {
on_put = true,
on_yank = true,
timer = 500,
},
preserve_cursor_position = {
enabled = true,
},
textobj = {
enabled = true,
},
})
require("scrollbar").setup({
show = true,
show_in_active_only = false,
set_highlights = true,
folds = 1000, -- handle folds, set to number to disable folds if no. of lines in buffer exceeds this
max_lines = false, -- disables if no. of lines in buffer exceeds this
hide_if_all_visible = false, -- Hides everything if all lines are visible
throttle_ms = 100,
handle = {
text = " ",
blend = 30, -- Integer between 0 and 100. 0 for fully opaque and 100 to full transparent. Defaults to 30.
color = nil,
color_nr = nil, -- cterm
highlight = "CursorColumn",
hide_if_all_visible = true, -- Hides handle if all lines are visible
},
marks = {
Cursor = {
text = "•",
priority = 0,
gui = nil,
color = nil,
cterm = nil,
color_nr = nil, -- cterm
highlight = "Normal",
},
Search = {
text = { "-", "=" },
priority = 1,
gui = nil,
color = nil,
cterm = nil,
color_nr = nil, -- cterm
highlight = "Search",
},
Error = {
text = { "-", "=" },
priority = 2,
gui = nil,
color = nil,
cterm = nil,
color_nr = nil, -- cterm
highlight = "DiagnosticVirtualTextError",
},
Warn = {
text = { "-", "=" },
priority = 3,
gui = nil,
color = nil,
cterm = nil,
color_nr = nil, -- cterm
highlight = "DiagnosticVirtualTextWarn",
},
Info = {
text = { "-", "=" },
priority = 4,
gui = nil,
color = nil,
cterm = nil,
color_nr = nil, -- cterm
highlight = "DiagnosticVirtualTextInfo",
},
Hint = {
text = { "-", "=" },
priority = 5,
gui = nil,
color = nil,
cterm = nil,
color_nr = nil, -- cterm
highlight = "DiagnosticVirtualTextHint",
},
Misc = {
text = { "-", "=" },
priority = 6,
gui = nil,
color = nil,
cterm = nil,
color_nr = nil, -- cterm
highlight = "Normal",
},
GitAdd = {
text = "┆",
priority = 7,
gui = nil,
color = nil,
cterm = nil,
color_nr = nil, -- cterm
highlight = "GitSignsAdd",
},
GitChange = {
text = "┆",
priority = 7,
gui = nil,
color = nil,
cterm = nil,
color_nr = nil, -- cterm
highlight = "GitSignsChange",
},
GitDelete = {
text = "▁",
priority = 7,
gui = nil,
color = nil,
cterm = nil,
color_nr = nil, -- cterm
highlight = "GitSignsDelete",
},
},
excluded_buftypes = {
"terminal",
},
excluded_filetypes = {
"cmp_docs",
"cmp_menu",
"noice",
"prompt",
"TelescopePrompt",
},
autocmd = {
render = {
"BufWinEnter",
"TabEnter",
"TermEnter",
"WinEnter",
"CmdwinLeave",
"TextChanged",
"VimResized",
"WinScrolled",
},
clear = {
"BufWinLeave",
"TabLeave",
"TermLeave",
"WinLeave",
},
},
handlers = {
cursor = true,
diagnostic = true,
gitsigns = false, -- Requires gitsigns
handle = true,
search = false, -- Requires hlslens
ale = false, -- Requires ALE
},
})
require("mason").setup()
require("fidget").setup({
-- Options related to LSP progress subsystem
progress = {
poll_rate = 0, -- How and when to poll for progress messages
suppress_on_insert = false, -- Suppress new messages while in insert mode
ignore_done_already = false, -- Ignore new tasks that are already complete
ignore_empty_message = false, -- Ignore new tasks that don't contain a message
clear_on_detach = -- Clear notification group when LSP server detaches
function(client_id)
local client = vim.lsp.get_client_by_id(client_id)
return client and client.name or nil
end,
notification_group = -- How to get a progress message's notification group key
function(msg) return msg.lsp_client.name end,
ignore = {}, -- List of LSP servers to ignore
-- Options related to how LSP progress messages are displayed as notifications
display = {
render_limit = 16, -- How many LSP messages to show at once
done_ttl = 3, -- How long a message should persist after completion
done_icon = "✔", -- Icon shown when all LSP progress tasks are complete
done_style = "Constant", -- Highlight group for completed LSP tasks
progress_ttl = math.huge, -- How long a message should persist when in progress
progress_icon = -- Icon shown when LSP progress tasks are in progress
{ pattern = "dots", period = 1 },
progress_style = -- Highlight group for in-progress LSP tasks
"WarningMsg",
group_style = "Title", -- Highlight group for group name (LSP server name)
icon_style = "Question", -- Highlight group for group icons
priority = 30, -- Ordering priority for LSP notification group
skip_history = true, -- Whether progress notifications should be omitted from history
format_message = -- How to format a progress message
require("fidget.progress.display").default_format_message,
format_annote = -- How to format a progress annotation
function(msg) return msg.title end,
format_group_name = -- How to format a progress notification group's name
function(group) return tostring(group) end,
overrides = { -- Override options from the default notification config
rust_analyzer = { name = "rust-analyzer" },
},
},
-- Options related to Neovim's built-in LSP client
lsp = {
progress_ringbuf_size = 0, -- Configure the nvim's LSP progress ring buffer size
log_handler = false, -- Log `$/progress` handler invocations (for debugging)
},
},
-- Options related to notification subsystem
notification = {
poll_rate = 10, -- How frequently to update and render notifications
filter = vim.log.levels.INFO, -- Minimum notifications level
history_size = 128, -- Number of removed messages to retain in history
override_vim_notify = false, -- Automatically override vim.notify() with Fidget
configs = -- How to configure notification groups when instantiated
{ default = require("fidget.notification").default_config },
redirect = -- Conditionally redirect notifications to another backend
function(msg, level, opts)
if opts and opts.on_open then
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
end
end,
-- Options related to how notifications are rendered as text
view = {
stack_upwards = true, -- Display notification items from bottom to top
icon_separator = " ", -- Separator between group name and icon
group_separator = "---", -- Separator between notification groups
group_separator_hl = -- Highlight group used for group separator
"Comment",
render_message = -- How to render notification messages
function(msg, cnt)
return cnt == 1 and msg or string.format("(%dx) %s", cnt, msg)
end,
},
-- Options related to the notification window and buffer
window = {
normal_hl = "Comment", -- Base highlight group in the notification window
winblend = 100, -- Background color opacity in the notification window
border = "none", -- Border around the notification window
zindex = 45, -- Stacking priority of the notification window
max_width = 0, -- Maximum width of the notification window
max_height = 0, -- Maximum height of the notification window
x_padding = 1, -- Padding from right edge of window boundary
y_padding = 0, -- Padding from bottom edge of window boundary
align = "bottom", -- How to align the notification window
relative = "editor", -- What the notification window position is relative to
},
},
-- Options related to integrating with other plugins
integration = {
["nvim-tree"] = {
enable = true, -- Integrate with nvim-tree/nvim-tree.lua (if installed)
},
["xcodebuild-nvim"] = {
enable = true, -- Integrate with wojciech-kulik/xcodebuild.nvim (if installed)
},
},
-- Options related to logging
logger = {
level = vim.log.levels.WARN, -- Minimum logging level
max_size = 10000, -- Maximum log file size, in KB
float_precision = 0.01, -- Limit the number of decimals displayed for floats
path = -- Where Fidget writes its logs to
string.format("%s/fidget.nvim.log", vim.fn.stdpath("cache")),
},
})
require("todo-comments").setup({
signs = true, -- show icons in the signs column
sign_priority = 8, -- sign priority
-- keywords recognized as todo comments
keywords = {
FIX = {
icon = " ", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = " ", color = "info" },
HACK = { icon = " ", color = "warning" },
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
},
gui_style = {
fg = "NONE", -- The gui style to use for the fg highlight group.
bg = "BOLD", -- The gui style to use for the bg highlight group.
},
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
-- highlighting of the line containing the todo comment
-- * before: highlights before the keyword (typically comment characters)
-- * keyword: highlights of the keyword
-- * after: highlights after the keyword (todo text)
highlight = {
multiline = true, -- enable multine todo comments
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
before = "", -- "fg" or "bg" or empty
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
after = "fg", -- "fg" or "bg" or empty
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
comments_only = true, -- uses treesitter to match keywords in comments only
max_line_len = 400, -- ignore lines longer than this
exclude = {}, -- list of file types to exclude highlighting
},
-- list of named colors where we try to extract the guifg from the
-- list of highlight groups or use the hex color if hl not found as a fallback
colors = {
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
info = { "DiagnosticInfo", "#2563EB" },
hint = { "DiagnosticHint", "#10B981" },
default = { "Identifier", "#7C3AED" },
test = { "Identifier", "#FF00FF" }
},
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
},
-- regex that will be used to match keywords.
-- don't replace the (KEYWORDS) placeholder
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
},
})
require("noice").setup({
cmdline = {
enabled = true, -- enables the Noice cmdline UI
view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom
opts = {}, -- global options for the cmdline. See section on views
---@type table<string, CmdlineFormat>
format = {
-- conceal: (default=true) This will hide the text in the cmdline that matches the pattern.
-- view: (default is cmdline view)
-- opts: any options passed to the view
-- icon_hl_group: optional hl_group for the icon
-- title: set to anything or empty string to hide
cmdline = { pattern = "^:", icon = "", lang = "vim" },
search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" },
search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" },
filter = { pattern = "^:%s*!", icon = "$", lang = "bash" },
lua = { pattern = { "^:%s*lua%s+", "^:%s*lua%s*=%s*", "^:%s*=%s*" }, icon = "", lang = "lua" },
help = { pattern = "^:%s*he?l?p?%s+", icon = "?" },
input = { view = "cmdline_input", icon = " " }, -- Used by input()
-- lua = false, -- to disable a format, set to `false`
},
},
messages = {
-- NOTE: If you enable messages, then the cmdline is enabled automatically.
-- This is a current Neovim limitation.
enabled = true, -- enables the Noice messages UI
view = "notify", -- default view for messages
view_error = "notify", -- view for errors
view_warn = "notify", -- view for warnings
view_history = "messages", -- view for :messages
view_search = "virtualtext", -- view for search count messages. Set to `false` to disable
},
popupmenu = {
enabled = true, -- enables the Noice popupmenu UI
---@type 'nui'|'cmp'
backend = "nui", -- backend to use to show regular cmdline completions
---@type NoicePopupmenuItemKind|false
-- Icons for completion item kinds (see defaults at noice.config.icons.kinds)
kind_icons = {}, -- set to `false` to disable icons
},
-- default options for require('noice').redirect
-- see the section on Command Redirection
---@type NoiceRouteConfig
redirect = {
view = "popup",
filter = { event = "msg_show" },
},
-- You can add any custom commands below that will be available with `:Noice command`
---@type table<string, NoiceCommand>
commands = {
history = {
-- options for the message history that you get with `:Noice`
view = "split",
opts = { enter = true, format = "details" },
filter = {
any = {
{ event = "notify" },
{ error = true },
{ warning = true },
{ event = "msg_show", kind = { "" } },
{ event = "lsp", kind = "message" },
},
},
},
-- :Noice last
last = {
view = "popup",
opts = { enter = true, format = "details" },
filter = {
any = {
{ event = "notify" },
{ error = true },
{ warning = true },
{ event = "msg_show", kind = { "" } },
{ event = "lsp", kind = "message" },
},
},
filter_opts = { count = 1 },
},
-- :Noice errors
errors = {
-- options for the message history that you get with `:Noice`
view = "popup",
opts = { enter = true, format = "details" },
filter = { error = true },
filter_opts = { reverse = true },
},
all = {
-- options for the message history that you get with `:Noice`
view = "split",
opts = { enter = true, format = "details" },
filter = {},
},
},
notify = {
-- Noice can be used as `vim.notify` so you can route any notification like other messages
-- Notification messages have their level and other properties set.
-- event is always "notify" and kind can be any log level as a string
-- The default routes will forward notifications to nvim-notify
-- Benefit of using Noice for this is the routing and consistent history view
enabled = true,
view = "notify",
},
lsp = {
progress = {
enabled = true,
-- Lsp Progress is formatted using the builtins for lsp_progress. See config.format.builtin
-- See the section on formatting for more details on how to customize.
--- @type NoiceFormat|string
format = "lsp_progress",
--- @type NoiceFormat|string
format_done = "lsp_progress_done",
throttle = 1000 / 30, -- frequency to update lsp progress message
view = "mini",
},
override = {
-- override the default lsp markdown formatter with Noice
["vim.lsp.util.convert_input_to_markdown_lines"] = false,
-- override the lsp markdown formatter with Noice
["vim.lsp.util.stylize_markdown"] = false,
-- override cmp documentation with Noice (needs the other options to work)
["cmp.entry.get_documentation"] = false,
},
hover = {
enabled = true,
silent = false, -- set to true to not show a message if hover is not available
view = nil, -- when nil, use defaults from documentation
---@type NoiceViewOptions
opts = {}, -- merged with defaults from documentation
},