echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
5k stars 185 forks source link

Toggling mini.files #930

Closed 6H075T2 closed 4 months ago

6H075T2 commented 4 months ago

Contributing guidelines

Module(s)

Mini.files

Description

Is toggling this plugin possible? the one in the docs doesnt work for me any thoughts on how to do this? Im not fluent in lua yet

echasnovski commented 4 months ago

This solution works. You can use it to create a mapping like this:

require('mini.files').setup()
local minifiles_toggle = function()
  if not MiniFiles.close() then MiniFiles.open() end
end
vim.keymap.set('n', '<Leader>et', minifiles_toggle)