-- -- netrw plugin -- local function explore() local windows = vim.api.nvim_tabpage_list_wins(0) for _, win in ipairs(windows) do local buf = vim.api.nvim_win_get_buf(win) local ft = vim.api.nvim_get_option_value("filetype", { buf = buf }) if ft == "netrw" then if win ~= vim.api.nvim_get_current_win() then vim.api.nvim_set_current_win(win) return end break end end vim.cmd.Lexplore() end vim.g.netrw_liststyle = 3 -- 3: list style vim.g.netrw_winsize = -30 -- 30 columns wide vim.g.netrw_banner = 0 -- No banner vim.api.nvim_create_user_command( "GotoExplorer", explore, { desc = "Open/close/focus netrw window" } )