fix(mini.files): fix error about opts.mappings (#3507)

This commit is contained in:
Iordanis Petkakis 2024-06-06 21:52:40 +03:00 committed by GitHub
parent 1699091d70
commit 92106484ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,14 @@
return {
"echasnovski/mini.files",
opts = {
mappings = {
toggle_hidden = "g.",
change_cwd = "gc",
go_in_horizontal = "<C-w>s",
go_in_vertical = "<C-w>v",
go_in_horizontal_plus = "<C-w>S",
go_in_vertical_plus = "<C-w>V",
},
windows = {
preview = true,
width_focus = 30,
@ -82,22 +90,17 @@ return {
vim.keymap.set(
"n",
opts.mappings.toggle_hidden or "g.",
opts.mappings.toggle_hidden,
toggle_dotfiles,
{ buffer = buf_id, desc = "Toggle hidden files" }
)
vim.keymap.set(
"n",
opts.mappings.change_cwd or "gc",
files_set_cwd,
{ buffer = args.data.buf_id, desc = "Set cwd" }
)
vim.keymap.set("n", opts.mappings.change_cwd, files_set_cwd, { buffer = args.data.buf_id, desc = "Set cwd" })
map_split(buf_id, opts.mappings.go_in_horizontal or "<C-w>s", "horizontal", false)
map_split(buf_id, opts.mappings.go_in_vertical or "<C-w>v", "vertical", false)
map_split(buf_id, opts.mappings.go_in_horizontal_plus or "<C-w>S", "horizontal", true)
map_split(buf_id, opts.mappings.go_in_vertical_plus or "<C-w>V", "vertical", true)
map_split(buf_id, opts.mappings.go_in_horizontal, "horizontal", false)
map_split(buf_id, opts.mappings.go_in_vertical, "vertical", false)
map_split(buf_id, opts.mappings.go_in_horizontal_plus, "horizontal", true)
map_split(buf_id, opts.mappings.go_in_vertical_plus, "vertical", true)
end,
})