Repository navigation
Expand file tree
/
Copy pathplugins.lua
More file actions
773 lines (724 loc) · 27.9 KB
/
Copy pathplugins.lua
File metadata and controls
773 lines (724 loc) · 27.9 KB
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
return {
setup = function()
-- bootstrap lazy.nvim
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)
require("lazy").setup({
-- mason
{
"williamboman/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
"jay-babu/mason-nvim-dap.nvim",
},
config = function()
require("lsp.mason").setup()
end,
},
-- colorscheme
{ "NLKNguyen/papercolor-theme", lazy = false, priority = 1000 },
{ "rebelot/kanagawa.nvim" },
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opts = {},
},
-- clangd extensions
{ "p00f/clangd_extensions.nvim" },
-- git
{
"lewis6991/gitsigns.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require("ext.tools.gitsign").setup()
end,
},
{
"sindrets/diffview.nvim",
},
{
"isakbm/gitgraph.nvim",
dependencies = {
"sindrets/diffview.nvim",
},
opts = {
git_cmd = "git",
symbols = {
merge_commit = "M",
commit = "*",
},
format = {
timestamp = "%H:%M:%S %d-%m-%Y",
fields = { "hash", "timestamp", "author", "branch_name", "tag" },
},
hooks = {
on_select_commit = function(commit)
vim.notify("DiffviewOpen " .. commit.hash .. "^!")
vim.cmd(":DiffviewOpen " .. commit.hash .. "^!")
end,
on_select_range_commit = function(from, to)
vim.notify("DiffviewOpen " .. from.hash .. "~1.." .. to.hash)
vim.cmd(":DiffviewOpen " .. from.hash .. "~1.." .. to.hash)
end,
},
},
},
{
"rhysd/git-messenger.vim",
},
{
"tpope/vim-fugitive",
config = function()
require("ext.tools.fugitive").setup()
end,
},
{ "tpope/vim-rhubarb" },
{ "junegunn/gv.vim" },
-- git blame
{
"f-person/git-blame.nvim",
config = function()
require("ext.tools.git-blame").setup()
end,
},
-- neogit
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim", -- required
"sindrets/diffview.nvim", -- optional - Diff integration
"nvim-telescope/telescope.nvim", -- optional
"ibhagwan/fzf-lua", -- optional
"echasnovski/mini.pick", -- optional
},
config = true,
},
-- java
{ "mfussenegger/nvim-jdtls" },
-- treesitter
{
"nvim-treesitter/nvim-treesitter",
branch = "main",
lazy = false,
build = ":TSUpdate",
config = function()
require("ext.tools.treesitter").setup()
end,
},
{
"nvim-treesitter/nvim-treesitter-textobjects",
branch = "main",
dependencies = "nvim-treesitter/nvim-treesitter",
config = function()
require("ext.tools.treesitter").setup_textobjects()
end,
},
-- multiple cursors
{ "terryma/vim-multiple-cursors" },
-- tabline
{
"romgrk/barbar.nvim",
dependencies = { "lewis6991/gitsigns.nvim", "nvim-tree/nvim-web-devicons" },
config = function()
require("ext.tools.barbar").setup()
end,
},
-- markdown
{
"tpope/vim-markdown",
config = function()
require("ext.tools.markdown").setup()
end,
},
{ "christoomey/vim-tmux-navigator" },
-- highlight yank
{ "machakann/vim-highlightedyank" },
{ "nvim-lua/plenary.nvim" },
-- go vim
{ "fatih/vim-go", build = ":GoUpdateBinaries" },
-- vim easy align
{
"junegunn/vim-easy-align",
config = function()
require("ext.tools.easy-align").setup()
end,
},
-- lsp
{
"neovim/nvim-lspconfig",
},
{ "onsails/lspkind-nvim" },
{
"nvimdev/lspsaga.nvim",
event = "LspAttach",
config = function()
require("lspsaga").setup({})
end,
dependencies = {
{ "nvim-tree/nvim-web-devicons" },
--Please make sure you install markdown and markdown_inline parser
{ "nvim-treesitter/nvim-treesitter" },
},
},
{
"j-hui/fidget.nvim",
opts = {
-- options
},
},
-- auto-completion
{
"hrsh7th/nvim-cmp",
}, -- Autocompletion plugin
{ "hrsh7th/cmp-nvim-lsp" }, -- LSP source for nvim-cmp'
{ "hrsh7th/cmp-buffer" },
{ "hrsh7th/cmp-path" },
{ "hrsh7th/cmp-cmdline" },
{
"L3MON4D3/LuaSnip",
version = "v2.*",
build = "make install_jsregexp",
dependencies = {
"rafamadriz/friendly-snippets",
"mstuttgart/vscode-odoo-snippets",
"cstrap/python-snippets",
"xabikos/vscode-javascript",
"golang/vscode-go",
"rust-lang/vscode-rust",
},
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
{ "saadparwaiz1/cmp_luasnip" },
-- snippet
-- { "cstrap/python-snippets" },
-- { "xabikos/vscode-javascript" },
-- { "golang/vscode-go" },
-- { "rust-lang/vscode-rust" },
-- database
{
"kristijanhusak/vim-dadbod-completion",
config = function()
require("ext.tools.db-completion").setup()
end,
},
{ "tpope/vim-dadbod" },
{ "kristijanhusak/vim-dadbod-ui" },
-- ts-rainbow
{
"HiPhish/rainbow-delimiters.nvim",
-- branch = "main",
config = function()
require("ext.tools.rainbow-delimiters").setup()
end,
},
-- colorizer
{
"catgoose/nvim-colorizer.lua",
opts = {
filetypes = { "*" },
options = {
parsers = {
names = { enable = true },
hex = { rgb = true, rrggbb = true, rrggbbaa = true },
rgb = { enable = true },
hsl = { enable = true },
},
},
},
},
-- auto-pairs
{
"windwp/nvim-autopairs",
config = function()
require("ext.tools.autopairs").setup()
end,
},
-- nvim-web-devicons
{
"nvim-tree/nvim-web-devicons",
config = function()
require("ext.tools.devicon").setup()
end,
},
-- lualine
{
"nvim-lualine/lualine.nvim",
-- after = "github-nvim-theme",
dependencies = { "nvim-tree/nvim-web-devicons", opt = true },
config = function()
require("ext.tools.lualine").setup()
end,
},
-- nvim-tree
{
"nvim-tree/nvim-tree.lua",
version = "*",
lazy = false,
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("ext.tools.tree").setup()
end,
},
-- indent
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {},
config = function()
require("ext.tools.indent-blankline").setup()
end,
},
{
"folke/zen-mode.nvim",
config = function()
require("zen-mode").setup({
window = {
backdrop = 0.95,
width = 120, -- width of the Zen window
height = 1, -- height of the Zen window
options = {
signcolumn = "no",
number = true,
relativenumber = true,
cursorline = true,
cursorcolumn = false,
list = false,
},
},
})
end,
},
-- Comments
{
"numToStr/Comment.nvim",
config = function()
require("ext.tools.comment").setup()
end,
},
-- Javascript / Typescript
{
"pmizio/typescript-tools.nvim",
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
opts = {},
},
{
"folke/snacks.nvim",
lazy = false,
priority = 1000,
---@module 'snacks'
---@type snacks.Config
opts = {
terminal = {
win = {
position = "bottom",
height = 11,
},
},
styles = {
terminal = {
keys = {
term_normal = {
"jk",
function(self)
vim.cmd("stopinsert")
end,
mode = "t",
desc = "Normal mode",
},
},
},
gitui = {
position = "float",
width = 0.9,
height = 0.9,
bo = { filetype = "snacks_terminal" },
keys = { q = "hide" },
},
},
},
keys = {
{
"<leader>`",
function()
Snacks.terminal.toggle()
end,
desc = "Toggle Terminal",
},
{
"<leader>gu",
function()
Snacks.terminal.toggle("gitui", { win = { style = "gitui" } })
end,
desc = "Toggle GitUI",
},
},
config = function(_, opts)
require("snacks").setup(opts)
-- terminal mode navigation keymaps
vim.api.nvim_create_autocmd("TermOpen", {
callback = function()
local buf_opts = { buffer = 0 }
vim.keymap.set("t", "<C-h>", [[<C-\><C-n><C-W>h]], buf_opts)
vim.keymap.set("t", "<C-j>", [[<C-\><C-n><C-W>j]], buf_opts)
vim.keymap.set("t", "<C-k>", [[<C-\><C-n><C-W>k]], buf_opts)
vim.keymap.set("t", "<C-l>", [[<C-\><C-n><C-W>l]], buf_opts)
end,
})
end,
},
-- doxygen
{
"kkoomen/vim-doge",
build = ":DoGeUpdate",
config = function()
require("ext.tools.doge").setup()
end,
},
-- debugger
{ "mfussenegger/nvim-dap" },
{ "rcarriga/nvim-dap-ui", dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" } },
-- statusline components
{
"SmiteshP/nvim-navic",
dependencies = "neovim/nvim-lspconfig",
},
{
"nvim-telescope/telescope.nvim",
version = "*",
dependencies = { { "nvim-lua/plenary.nvim" } },
lazy = false,
keys = {
{
"<Leader>fc",
"<CMD>Telescope commands<CR>",
desc = "Open command palette",
},
},
config = function()
require("ext.tools.telescoped").setup()
end,
},
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release",
},
{
"pwntester/octo.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-tree/nvim-web-devicons",
"nvim-lua/plenary.nvim",
},
config = function()
require("octo").setup()
end,
},
-- find and replace tool
{ "windwp/nvim-spectre" },
{
"folke/trouble.nvim",
dependencies = "nvim-tree/nvim-web-devicons",
cmd = "Trouble",
config = function()
require("trouble").setup({})
end,
},
{
"chrisbra/csv.vim",
config = function()
vim.g.csv_delim = ","
vim.g.csv_highlight_column = "y"
-- Tạo autocmd tự động chạy ArrangeColumn và bật conceal khi mở csv
vim.api.nvim_create_autocmd("FileType", {
pattern = "csv",
callback = function()
vim.opt_local.conceallevel = 2
vim.opt_local.concealcursor = "nc"
vim.cmd("silent! ArrangeColumn")
end,
})
end,
},
{
"godlygeek/tabular",
cmd = { "Tabularize" },
keys = {
{ "<leader>tc", ":Tabularize /,<CR>", desc = "Align column CSV with ," },
},
},
-- live server
{
name = "live-server.nvim",
url = "https://forge.barrettruth.com/barrettruth/live-server.nvim",
init = function()
vim.g.live_server = {}
end,
},
-- scala metal
{
"scalameta/nvim-metals",
dependencies = {
"nvim-lua/plenary.nvim",
{
"j-hui/fidget.nvim",
opts = {},
},
},
ft = { "scala", "sbt" },
},
-- csharp
{ "Hoffs/omnisharp-extended-lsp.nvim" },
{
"mfussenegger/nvim-lint",
event = { "BufReadPre", "BufNewFile" },
config = function()
require("ext.tools.linting").setup()
end,
}, -- linting
{
"stevearc/conform.nvim",
opts = {},
config = function()
require("ext.tools.formatting").setup()
end,
},
-- venv selector
{
"linux-cultist/venv-selector.nvim",
enabled = function()
return vim.fn.executable("fd") == 1 or vim.fn.executable("fdfind") == 1
end,
dependencies = {
"nvim-telescope/telescope.nvim",
},
ft = "python",
opts = {
search = {},
options = {},
},
keys = {
-- Keymap to open VenvSelector to pick a venv.
{ "<leader>vs", "<cmd>VenvSelect<cr>" },
-- Keymap to retrieve the venv from a cache (the one previously used for the same project directory).
},
},
{
"nanotee/sqls.nvim",
config = function()
vim.lsp.config("sqls", {
on_attach = function(client, bufnr)
require("sqls").on_attach(client, bufnr)
end,
})
end,
},
{
"stevearc/oil.nvim",
---@module 'oil'
---@type oil.SetupOpts
opts = {},
-- Optional dependencies
dependencies = { { "echasnovski/mini.icons", opts = {} } },
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
lazy = false,
config = function()
require("oil").setup({
-- Your configuration comes here
-- You can also omit the options and use the default settings
-- See:
})
end,
},
{
"folke/which-key.nvim",
lazy = false,
config = function()
require("ext.tools.whichkey").setup()
end,
},
{
"Zeioth/markmap.nvim",
build = "yarn global add markmap-cli",
cmd = { "MarkmapOpen", "MarkmapSave", "MarkmapWatch", "MarkmapWatchStop" },
opts = {
html_output = "/tmp/markmap.html", -- (default) Setting a empty string "" here means: [Current buffer path].html
hide_toolbar = false, -- (default)
grace_period = 3600000, -- (default) Stops markmap watch after 60 minutes. Set it to 0 to disable the grace_period.
},
config = function(_, opts)
require("markmap").setup(opts)
end,
},
{
"coder/claudecode.nvim",
config = function()
vim.api.nvim_set_hl(0, "ClaudeTermBg", { bg = "#1a1b26", fg = "#a9b1d6", ctermbg = 0, ctermfg = 7 })
require("claudecode").setup({
terminal = {
snacks_win_opts = {
wo = {
winhl = "Normal:ClaudeTermBg,FloatBorder:ClaudeTermBg",
},
},
},
})
end,
keys = {
{ "<leader>a", nil, desc = "AI assistants" },
{ "<leader>ac", "<cmd>ClaudeCode<cr>", desc = "Toggle Claude" },
{ "<leader>af", "<cmd>ClaudeCodeFocus<cr>", desc = "Focus Claude" },
{ "<leader>ar", "<cmd>ClaudeCode --resume<cr>", desc = "Resume Claude" },
{ "<leader>aC", "<cmd>ClaudeCode --continue<cr>", desc = "Continue Claude" },
{ "<leader>am", "<cmd>ClaudeCodeSelectModel<cr>", desc = "Select Claude model" },
{ "<leader>ab", "<cmd>ClaudeCodeAdd %<cr>", desc = "Add current buffer" },
{ "<leader>as", "<cmd>ClaudeCodeSend<cr>", mode = "v", desc = "Send to Claude" },
{
"<leader>as",
"<cmd>ClaudeCodeTreeAdd<cr>",
desc = "Add file",
ft = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" },
},
-- Diff management
{ "<leader>aa", "<cmd>ClaudeCodeDiffAccept<cr>", desc = "Accept diff" },
{ "<leader>ad", "<cmd>ClaudeCodeDiffDeny<cr>", desc = "Deny diff" },
},
},
{
"nwiizo/codex.nvim",
cmd = {
"Codex",
"CodexOpen",
"CodexClose",
"CodexFocus",
"CodexResume",
"CodexContinue",
"CodexFork",
"CodexReview",
"CodexImage",
"CodexPrompt",
"CodexAsk",
"CodexAskVisual",
"CodexFollowUp",
"CodexEdit",
"CodexSend",
"CodexSendVisual",
"CodexAddVisual",
"CodexAdd",
"CodexTreeAdd",
"CodexSendText",
"CodexDiff",
"CodexInterrupt",
"CodexStatus",
"CodexStop",
"CodexHealth",
},
opts = {
backend = "terminal",
cwd = "root",
terminal = {
layout = "split",
split_side = "right",
split_width_percentage = 0.3,
},
},
config = function(_, opts)
require("codex").setup(opts)
-- Keep the Codex split at the configured width when another
-- side window (for example nvim-tree) is opened.
vim.api.nvim_create_autocmd("User", {
pattern = { "CodexStarted", "CodexOpened" },
callback = function(event)
local winid = event.data and event.data.winid
if winid and vim.api.nvim_win_is_valid(winid) then
vim.wo[winid].winfixwidth = true
end
end,
})
end,
keys = {
{ "<leader>ax", "<cmd>CodexFocus<cr>", desc = "Toggle Codex" },
{ "<leader>aX", "<cmd>CodexStop<cr>", desc = "Stop Codex" },
{ "<leader>ao", "<cmd>CodexOpen<cr>", desc = "Open Codex" },
{ "<leader>aR", "<cmd>CodexResume<cr>", desc = "Resume Codex session" },
{ "<leader>aN", "<cmd>CodexContinue<cr>", desc = "Continue latest Codex session" },
{ "<leader>aF", "<cmd>CodexFork<cr>", desc = "Fork Codex session" },
{ "<leader>aV", "<cmd>CodexReview<cr>", desc = "Review changes with Codex" },
{ "<leader>ap", "<cmd>CodexPrompt<cr>", desc = "Prompt Codex" },
{ "<leader>aq", "<cmd>CodexAsk<cr>", desc = "Ask Codex about buffer" },
{ "<leader>al", "<cmd>CodexFollowUp<cr>", desc = "Follow up with Codex" },
{ "<leader>aD", "<cmd>CodexDiff<cr>", desc = "Show Codex diff" },
{ "<leader>ai", "<cmd>CodexInterrupt<cr>", desc = "Interrupt Codex" },
{ "<leader>az", "<cmd>CodexStatus<cr>", desc = "Show Codex status" },
{ "<leader>ah", "<cmd>CodexHealth<cr>", desc = "Check Codex health" },
{ "<leader>aB", "<cmd>CodexAdd<cr>", desc = "Add current buffer to Codex" },
{ "<leader>aa", ":<C-U>CodexAskVisual<CR>", mode = "v", desc = "Ask Codex about selection" },
{ "<leader>aE", ":<C-U>CodexEdit<CR>", mode = "v", desc = "Edit selection with Codex" },
{
"<leader>aS",
":<C-U>CodexSendVisual<CR>",
mode = "v",
desc = "Send selection to Codex",
},
{
"<leader>aB",
":<C-U>CodexAddVisual<CR>",
mode = "v",
desc = "Add selection to Codex",
},
{
"<leader>aT",
"<cmd>CodexTreeAdd<cr>",
desc = "Add explorer paths to Codex",
ft = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" },
},
},
},
{
"MeanderingProgrammer/render-markdown.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
ft = { "markdown", "gitcommit" },
---@module 'render-markdown'
---@type render.md.UserConfig
opts = {
render_modes = { "n", "c", "t" },
debounce = 100,
max_file_size = 10.0,
win_options = {
conceallevel = {
default = vim.o.conceallevel,
rendered = 3,
},
concealcursor = {
default = vim.o.concealcursor,
rendered = "",
},
},
},
},
{
"3rd/image.nvim",
build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239
opts = {
processor = "magick_cli",
},
},
})
end,
}