AutoYADM commit: 2024-12-18 16:45:04
This commit is contained in:
parent
c66cd68dff
commit
24cd695da0
2 changed files with 26 additions and 1 deletions
0
.config/nvim/lua/oil-extras.lua
Normal file
0
.config/nvim/lua/oil-extras.lua
Normal file
|
@ -1,3 +1,14 @@
|
||||||
|
local detail = false
|
||||||
|
|
||||||
|
function _G.get_oil_winbar()
|
||||||
|
local dir = require("oil").get_current_dir()
|
||||||
|
if dir then
|
||||||
|
return vim.fn.fnamemodify(dir, ":~")
|
||||||
|
else
|
||||||
|
return vim.api.nvim_buf_get_names(0)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"stevearc/oil.nvim",
|
"stevearc/oil.nvim",
|
||||||
event = "User DirOpened",
|
event = "User DirOpened",
|
||||||
|
@ -10,9 +21,12 @@ return {
|
||||||
delete_to_trash = true,
|
delete_to_trash = true,
|
||||||
skip_confirm_for_simple_edits = true,
|
skip_confirm_for_simple_edits = true,
|
||||||
watch_for_changes = true,
|
watch_for_changes = true,
|
||||||
|
win_options = {
|
||||||
|
winbar = "%!v:lua.get_oil_winbar()",
|
||||||
|
},
|
||||||
columns = {
|
columns = {
|
||||||
"icon",
|
"icon",
|
||||||
"size",
|
-- "size",
|
||||||
-- TODO:
|
-- TODO:
|
||||||
-- Add a keybind to toggle permissions view?
|
-- Add a keybind to toggle permissions view?
|
||||||
-- There's a recipe for this in the docs
|
-- There's a recipe for this in the docs
|
||||||
|
@ -20,6 +34,17 @@ return {
|
||||||
},
|
},
|
||||||
keymaps = {
|
keymaps = {
|
||||||
["<BS>"] = "actions.parent",
|
["<BS>"] = "actions.parent",
|
||||||
|
["gd"] = {
|
||||||
|
desc = "Toggle file detail view",
|
||||||
|
callback = function()
|
||||||
|
detail = not detail
|
||||||
|
if detail then
|
||||||
|
require("oil").set_columns({ "icon", "permissions", "size", "mtime" })
|
||||||
|
else
|
||||||
|
require("oil").set_columns({ "icon" })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue