dotfiles/.config/nvim/lua/plugins/oil.lua

32 lines
946 B
Lua

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