25 lines
563 B
Lua
25 lines
563 B
Lua
local M = {}
|
|
|
|
---@return table<string, function>
|
|
function M.generate_shortcut_maps()
|
|
local shortcuts = Config.shortcuts
|
|
local fs = require("neo-tree.sources.filesystem")
|
|
local maps = {}
|
|
for map, path in pairs(shortcuts) do
|
|
maps[map] = function(state)
|
|
fs._navigate_internal(state, path, nil, nil, false)
|
|
end
|
|
end
|
|
return maps
|
|
end
|
|
|
|
---@param key string
|
|
---@return string?
|
|
function M.get_secret(key)
|
|
local ok, keys = pcall(require, "config.secrets")
|
|
if ok then
|
|
return keys[key]
|
|
end
|
|
end
|
|
|
|
return M
|