-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
editor.lua
128 lines (122 loc) · 3.22 KB
/
editor.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
local skip_features_filetypes = require("util.ft").skip_features_filetypes
return {
{
"folke/flash.nvim",
vscode = true,
keys = {
{
"f",
mode = { "n", "x", "o" },
function()
require("flash").jump({
search = { forward = true, wrap = false, multi_window = false },
})
end,
desc = "Flash forward",
},
{
"F",
mode = { "n", "x", "o" },
function()
require("flash").jump({
search = { forward = false, wrap = false, multi_window = false },
})
end,
desc = "Flash backward",
},
{
"gf",
function()
require("flash").jump({
search = { multi_window = true },
})
end,
desc = "Flash window",
},
},
opts = {
modes = {
search = {
enabled = false,
},
-- disable flit, I use `f` for search/find
char = {
enabled = false,
},
},
},
},
{
"abecodes/tabout.nvim",
event = { "VeryLazy" },
keys = {
{ "<m-l>", "<Plug>(TaboutMulti)", desc = "Goto end of pair", mode = { "i" } },
{ "<m-h>", "<Plug>(TaboutBackMulti)", desc = "Goto start of pair", mode = { "i" } },
},
opts = {
exclude = skip_features_filetypes,
completion = true,
},
},
{
"cshuaimin/ssr.nvim",
keys = {
{
"<M-f>",
function()
require("ssr").open()
end,
desc = "Search and replace",
},
},
opts = {
min_width = 50,
min_height = 5,
max_width = 120,
max_height = 25,
keymaps = {
close = "q",
next_match = "n",
prev_match = "N",
replace_confirm = "<cr>",
replace_all = "<leader><cr>",
},
},
},
{
"grug-far.nvim",
keys = {
{
"<leader>sf",
':lua require("grug-far").grug_far({ prefills = { flags = vim.fn.expand("%") } })<CR>',
desc = "Search on current file",
},
{
"<leader>sf",
':<C-u>lua require("grug-far").with_visual_selection({ prefills = { flags = vim.fn.expand("%") } })<CR>',
desc = "Search on current file",
mode = { "v" },
},
},
},
{
"backdround/improved-search.nvim",
lazy = false,
vscode = true,
enabled = true,
keys = function()
local search = require("improved-search")
return {
{ "n", search.stable_next, mode = { "n", "x", "o" }, desc = "Search next" },
{ "N", search.stable_previous, mode = { "n", "x", "o" }, desc = "Search previous" },
-- https://github.com/LazyVim/LazyVim/commit/23e2b073e6fa75dacaa58dc1fe63392af7f54598
{ "gw", search.current_word, mode = { "n", "x" }, desc = "Search current word" },
{ "gW", search.current_word_strict, mode = { "n", "x" }, desc = "Search current word (strict)" },
{ "!", search.in_place, mode = { "x" }, desc = "Search selection without moving" },
{ "*", search.forward, mode = { "x" }, desc = "Search selection forward" },
{ "#", search.forward, mode = { "x" }, desc = "Search selection backward" },
}
end,
config = function() end,
},
}