34 lines
1.0 KiB
Lua
34 lines
1.0 KiB
Lua
|
local function save_dir()
|
||
|
local dir = require("oil").get_current_dir()
|
||
|
if dir ~= nil then
|
||
|
local f = io.open("/tmp/oil_dir", "w")
|
||
|
if f then
|
||
|
f:write(dir)
|
||
|
f:close()
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
return {
|
||
|
'stevearc/oil.nvim',
|
||
|
dependencies = { "nvim-tree/nvim-web-devicons" }, lazy = true,
|
||
|
opts = {
|
||
|
default_file_explorer = true,
|
||
|
keymaps = {
|
||
|
["g?"] = "actions.show_help",
|
||
|
["<CR>"] = function() require("oil").select({}, save_dir) end,
|
||
|
["<leader>v"] = "actions.select_vsplit",
|
||
|
["<leader>s"] = "actions.select_split",
|
||
|
["<leader>p"] = "actions.preview",
|
||
|
["<backspace>"] = function() vim.cmd("q!") end,
|
||
|
["<leader>r"] = "actions.refresh",
|
||
|
["-"] = function() require("oil").open(); save_dir() end,
|
||
|
["_"] = "actions.open_cwd",
|
||
|
["`"] = "actions.cd",
|
||
|
["~"] = "actions.tcd",
|
||
|
["g."] = "actions.toggle_hidden",
|
||
|
},
|
||
|
use_default_keymaps = false,
|
||
|
}
|
||
|
}
|