function _G.get_oil_winbar() local bufnr = vim.api.nvim_win_get_buf(vim.g.statusline_winid) local dir = require('oil').get_current_dir(bufnr) if dir then return vim.fn.fnamemodify(dir, ':~') else return vim.api.nvim_buf_get_name(0) end end local detail = false return { 'stevearc/oil.nvim', ---@module 'oil' ---@type oil.SetupOpts opts = {}, dependencies = { 'nvim-tree/nvim-web-devicons'}, config = function() require('oil').setup { columns = { 'icon', 'mtime', }, vim.keymap.set('n', 'o', ':Oil'), view_options = { show_hidden = true, }, win_options = { winbar = '%!v:lua.get_oil_winbar()', } } end }