From 92106484ed89efb364568fa27a689bd8be83d066 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Thu, 6 Jun 2024 21:52:40 +0300 Subject: [PATCH] fix(mini.files): fix error about `opts.mappings` (#3507) --- .../plugins/extras/editor/mini-files.lua | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lua/lazyvim/plugins/extras/editor/mini-files.lua b/lua/lazyvim/plugins/extras/editor/mini-files.lua index 8f0a4954..2261567d 100644 --- a/lua/lazyvim/plugins/extras/editor/mini-files.lua +++ b/lua/lazyvim/plugins/extras/editor/mini-files.lua @@ -1,6 +1,14 @@ return { "echasnovski/mini.files", opts = { + mappings = { + toggle_hidden = "g.", + change_cwd = "gc", + go_in_horizontal = "s", + go_in_vertical = "v", + go_in_horizontal_plus = "S", + go_in_vertical_plus = "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 "s", "horizontal", false) - map_split(buf_id, opts.mappings.go_in_vertical or "v", "vertical", false) - map_split(buf_id, opts.mappings.go_in_horizontal_plus or "S", "horizontal", true) - map_split(buf_id, opts.mappings.go_in_vertical_plus or "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, })