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
|
2022-10-25 18:35:51 +08:00
|
|
|
vim.api.nvim_create_user_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
|
|
|
|
|
|
|
|
_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,
|
|
|
|
}
|