17 lines
375 B
Lua
17 lines
375 B
Lua
local M = {}
|
|||
|
|
|
||
|
|
function M.open(name)
|
||
|
|
local titles = {
|
||
|
|
zsh = 'ZSH Cheat Sheet',
|
||
|
|
bash = 'Bash Cheat Sheet',
|
||
|
|
regex = 'RegExp Cheat Sheet',
|
||
|
|
}
|
||
|
|
|
||
|
|
local path = vim.fn.stdpath 'config' .. '/cheatsheets/' .. name .. '.md'
|
||
|
|
print('Opening cheat sheet: ' .. path)
|
||
|
|
|
||
|
|
require('../helpers').open_file_modal(path, titles[name] or name)
|
||
|
|
end
|
||
|
|
|
||
|
|
return M
|