-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmini-nvim.lua
More file actions
94 lines (85 loc) · 2.81 KB
/
mini-nvim.lua
File metadata and controls
94 lines (85 loc) · 2.81 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
local quick = require("arshlib.quick")
return {
{ -- mini.surround {{{
"echasnovski/mini.surround",
event = { "BufRead", "BufNewFile" },
config = function()
quick.highlight("MiniSurround", { link = "Substitute" })
local ts_input = require("mini.surround").gen_spec.input.treesitter
local surround = require("mini.surround")
surround.setup({
n_lines = 40,
highlight_duration = 1000,
mappings = {
add = "gsa",
delete = "gsd",
replace = "gsc",
find = "gsf",
find_left = "gsF",
highlight = "gsh",
update_n_lines = "gsn",
suffix_last = "l", -- Suffix to search with "prev" method
suffix_next = "n", -- Suffix to search with "next" method
},
custom_surroundings = {
-- Use tree-sitter to search for function call
f = {
input = ts_input({ outer = "@call.outer", inner = "@call.inner" }),
},
-- Use function to compute surrounding info
["*"] = {
input = function()
local n_star = surround.user_input("Number of * to find: ")
local many_star = string.rep("%*", tonumber(n_star) or 1)
return { many_star .. "().-()" .. many_star }
end,
output = function()
local n_star = surround.user_input("Number of * to output: ")
local many_star = string.rep("*", tonumber(n_star) or 1)
return { left = many_star, right = many_star }
end,
},
},
})
end,
enabled = require("config.util").is_enabled("echasnovski/mini.surround"),
}, -- }}}
{ -- mini.trailspace {{{
"echasnovski/mini.trailspace",
event = { "BufRead", "BufNewFile" },
config = function()
quick.highlight("MiniTrailspace", { link = "ExtraWhitespace" })
require("mini.trailspace").setup({})
end,
enabled = require("config.util").is_enabled("echasnovski/mini.trailspace"),
}, -- }}}
{ -- mini.align {{{
"echasnovski/mini.align",
event = { "BufRead", "BufNewFile" },
config = function()
require("mini.align").setup({
mappings = {
start = "ga",
start_with_preview = "gA",
},
-- Default options controlling alignment process
options = {
split_pattern = "",
justify_side = "left",
merge_delimiter = "",
},
-- Default steps performing alignment (if `nil`, default is used)
steps = {
pre_split = {},
split = nil,
pre_justify = {},
justify = nil,
pre_merge = {},
merge = nil,
},
})
end,
enabled = require("config.util").is_enabled("echasnovski/mini.align"),
}, -- }}}
}
-- vim: fdm=marker fdl=0