generated from LazyVim/starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoding.lua
More file actions
105 lines (97 loc) · 2.26 KB
/
coding.lua
File metadata and controls
105 lines (97 loc) · 2.26 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
return {
-- Incremental rename
{
"smjonas/inc-rename.nvim",
cmd = "IncRename",
config = true,
},
-- Go forward/backward with square brackets
{
"echasnovski/mini.bracketed",
event = "BufReadPost",
config = function()
local bracketed = require("mini.bracketed")
bracketed.setup({
file = { suffix = "" },
window = { suffix = "" },
quickfix = { suffix = "" },
yank = { suffix = "" },
treesitter = { suffix = "n" },
})
end,
},
-- Better increase/descrease
{
"monaqa/dial.nvim",
-- stylua: ignore
keys = {
{ "<C-a>", function() return require("dial.map").inc_normal() end, expr = true, desc = "Increment" },
{ "<C-x>", function() return require("dial.map").dec_normal() end, expr = true, desc = "Decrement" },
},
config = function()
local augend = require("dial.augend")
require("dial.config").augends:register_group({
default = {
augend.integer.alias.decimal,
augend.integer.alias.hex,
augend.date.alias["%Y/%m/%d"],
augend.constant.alias.bool,
augend.semver.alias.semver,
augend.constant.new({ elements = { "let", "const" } }),
},
})
end,
},
-- copilot
{
"zbirenbaum/copilot.lua",
opts = {
suggestion = {
auto_trigger = true,
keymap = {
accept = "<C-l>",
accept_word = "<M-l>",
accept_line = "<M-S-l>",
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
filetypes = {
markdown = true,
help = true,
},
},
},
{
"numToStr/Comment.nvim",
keys = {
{
"<C-c>",
"<cmd>lua require('Comment.api').toggle.linewise()<CR>",
mode = "n",
desc = "Toggle Line Comment",
},
{
"<C-c>",
"<ESC><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<CR>",
mode = "v",
desc = "Toggle Multi-Line Comment",
},
},
event = "BufReadPre",
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
config = function()
-- import comment plugin safely
local comment = require("Comment")
local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")
-- enable comment
comment.setup({
-- for commenting tsx and jsx files
pre_hook = ts_context_commentstring.create_pre_hook(),
})
end,
}
}