chore(oil): update shortcuts and add custom winbar
This commit is contained in:
parent
55b2405442
commit
2a266755a3
1 changed files with 38 additions and 22 deletions
|
|
@ -1,25 +1,41 @@
|
|||
return {
|
||||
'stevearc/oil.nvim',
|
||||
opts = {
|
||||
keymaps = {
|
||||
["g?"] = "actions.show_help",
|
||||
["<CR>"] = "actions.select",
|
||||
["<C-s>"] = "actions.select_vsplit",
|
||||
["<C-h>"] = "actions.select_split",
|
||||
["<C-t>"] = "actions.select_tab",
|
||||
["<C-p>"] = false,
|
||||
["<C-c>"] = "actions.close",
|
||||
["<C-l>"] = "actions.refresh",
|
||||
["-"] = "actions.parent",
|
||||
["_"] = "actions.open_cwd",
|
||||
["`"] = "actions.cd",
|
||||
["~"] = "actions.tcd",
|
||||
["gs"] = "actions.change_sort",
|
||||
["gx"] = "actions.open_external",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
["g\\"] = "actions.toggle_trash",
|
||||
},
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
CustomOilBar = function()
|
||||
local path = vim.fn.expand "%"
|
||||
path = path:gsub("oil://", "")
|
||||
|
||||
return " " .. vim.fn.fnamemodify(path, ":.")
|
||||
end
|
||||
|
||||
require("oil").setup {
|
||||
columns = { "icon" },
|
||||
keymaps = {
|
||||
["g?"] = "actions.show_help",
|
||||
["<CR>"] = "actions.select",
|
||||
["<C-p>"] = false,
|
||||
["<C-c>"] = "actions.close",
|
||||
["<C-l>"] = "actions.refresh",
|
||||
["-"] = "actions.parent",
|
||||
["_"] = "actions.open_cwd",
|
||||
["`"] = "actions.cd",
|
||||
["~"] = "actions.tcd",
|
||||
["gs"] = "actions.change_sort",
|
||||
["gx"] = "actions.open_external",
|
||||
["g."] = "actions.toggle_hidden",
|
||||
},
|
||||
win_options = {
|
||||
winbar = "%{v:lua.CustomOilBar()}",
|
||||
},
|
||||
}
|
||||
|
||||
-- Open parent directory in current window
|
||||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||
|
||||
-- Open parent directory in floating window
|
||||
vim.keymap.set("n", "<space>-", require("oil").toggle_float)
|
||||
end,
|
||||
},
|
||||
-- Optional dependencies
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue