yadm-config/.config/nvim/lua/plugins/neotree.lua

36 lines
867 B
Lua

return {
"nvim-neo-tree/neo-tree.nvim",
opts = {
window = {
width = 40,
},
filesystem = {
window = {
mappings = {
["<C-l>"] = function(state)
local node = state.tree:get_node()
if vim.fn.fnamemodify(node.path, ":e") == "opto" then
vim.cmd.Optolith()
return
end
os.execute(string.format('xdg-open "%s" &> /dev/null &', node.path))
end,
},
},
},
},
keys = {
{
"<leader>e",
function()
local filesystemState = require("neo-tree.sources.manager").get_state("filesystem")
local fsPath = table.concat(filesystemState.default_expanded_nodes)
require("neo-tree.command").execute({ toggle = true, dir = fsPath })
end,
desc = "Explorer NeoTree (reopen)",
},
},
}