2022-10-25 18:35:51 +08:00
|
|
|
--=============================================================================
|
|
|
|
-- zettelkasten.lua --- init plugin for zk
|
2023-03-26 13:44:47 +08:00
|
|
|
-- Copyright (c) 2016-2023 Wang Shidong & Contributors
|
2022-10-25 18:35:51 +08:00
|
|
|
-- Author: Wang Shidong < wsdjeg@outlook.com >
|
|
|
|
-- URL: https://spacevim.org
|
|
|
|
-- License: GPLv3
|
|
|
|
--=============================================================================
|
2022-10-18 22:55:34 +08:00
|
|
|
if vim.fn.exists(":ZkNew") == 0 then
|
2024-06-13 08:44:55 +08:00
|
|
|
vim.cmd([[command ZkNew :lua require('zettelkasten').zknew({})]])
|
2022-10-18 22:55:34 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
if vim.fn.exists(":ZkBrowse") == 0 then
|
|
|
|
vim.cmd([[command ZkBrowse :lua _G.zettelkasten.zkbrowse()]])
|
|
|
|
end
|
|
|
|
|
2024-07-05 23:11:59 +08:00
|
|
|
if vim.fn.exists(":ZkListTemplete") == 0 then
|
|
|
|
vim.cmd([[command ZkListTemplete :Telescope zettelkasten_template]])
|
|
|
|
end
|
|
|
|
|
2022-10-18 22:55:34 +08:00
|
|
|
_G.zettelkasten = {
|
|
|
|
tagfunc = require("zettelkasten").tagfunc,
|
|
|
|
completefunc = require("zettelkasten").completefunc,
|
2022-10-25 18:35:51 +08:00
|
|
|
zknew = require("zettelkasten").zknew,
|
2022-10-18 22:55:34 +08:00
|
|
|
zkbrowse = function()
|
|
|
|
vim.cmd("edit zk://browser")
|
|
|
|
end,
|
|
|
|
}
|