Skip to content
Snippets Groups Projects
Verified Commit 37ad091f authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

add directory name to Oil winbar

parent 4a86b6e5
Branches
No related tags found
No related merge requests found
......@@ -12,6 +12,16 @@ return {
{ "mtime", highlight = "Whitespace", format = "%Y-%m-%d %T" },
}
function _G.get_oil_winbar()
local bufnr = vim.api.nvim_win_get_buf(vim.g.statusline_winid)
local dir = oil.get_current_dir(bufnr)
if dir then
return vim.fn.fnamemodify(dir, ":~")
else
return vim.api.nvim_buf_get_name(0)
end
end
oil.setup {
default_file_explorer = true,
watch_for_changes = false,
......@@ -36,6 +46,9 @@ return {
view_options = {
show_hidden = true,
},
win_options = {
winbar = "%!v:lua.get_oil_winbar()",
},
}
vim.keymap.set("n", "-", oil.open)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment