mirror of
https://github.com/Ascyii/typstar.git
synced 2026-01-01 05:24:24 -05:00
feat: get plugin directory from lua debug
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
local M = {}
|
||||
|
||||
local default_config = {
|
||||
typstarRoot = '~/typstar',
|
||||
typstarRoot = nil,
|
||||
anki = {
|
||||
typstarAnkiCmd = 'typstar-anki',
|
||||
typstCmd = 'typst',
|
||||
@@ -30,6 +30,9 @@ local default_config = {
|
||||
|
||||
function M.merge_config(args)
|
||||
M.config = vim.tbl_deep_extend('force', default_config, args or {})
|
||||
M.config.typstarRoot = M.config.typstarRoot
|
||||
or debug.getinfo(1).source:match('^@(.*)/lua/typstar/config%.lua$')
|
||||
or '~/typstar'
|
||||
M.config.excalidraw.templatePath = M.config.excalidraw.templatePath
|
||||
or {
|
||||
['%.excalidraw%.md$'] = M.config.typstarRoot .. '/res/excalidraw_template.excalidraw.md',
|
||||
|
||||
Reference in New Issue
Block a user