neovim refactor
This commit is contained in:
1 parent
b12c211a69
commit
883f9d26c2
25 files changed
+1154
-880
No files matched your search
@@ -0,0 +1,53 @@
|
||||
require("lz.n").load({
|
||||
{
|
||||
"zk-nvim",
|
||||
cmd = { "ZkNew", "ZkNotes", "ZkTags", "ZkInsertLink", "ZkBacklinks", "ZkLinks" },
|
||||
ft = "markdown",
|
||||
keys = {
|
||||
{
|
||||
"<leader>nn",
|
||||
function()
|
||||
local title = vim.trim(vim.fn.input("Title: "))
|
||||
if title ~= "" then
|
||||
require("zk").new({ notebook_path = vim.env.ZK_NOTEBOOK_DIR, title = title })
|
||||
end
|
||||
end,
|
||||
desc = "Create note",
|
||||
},
|
||||
{
|
||||
"<leader>nf",
|
||||
function()
|
||||
require("zk").edit({ notebook_path = vim.env.ZK_NOTEBOOK_DIR }, { picker = "telescope" })
|
||||
end,
|
||||
desc = "Find notes",
|
||||
},
|
||||
{
|
||||
"<leader>nt",
|
||||
function()
|
||||
require("zk.commands").get("ZkTags")({ notebook_path = vim.env.ZK_NOTEBOOK_DIR })
|
||||
end,
|
||||
desc = "Find note tags",
|
||||
},
|
||||
},
|
||||
after = function()
|
||||
require("zk").setup({
|
||||
picker = "telescope",
|
||||
lsp = { config = { root_dir = vim.env.ZK_NOTEBOOK_DIR } },
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = vim.api.nvim_create_augroup("lux-notes-maps", { clear = true }),
|
||||
pattern = "markdown",
|
||||
callback = function(args)
|
||||
local path = vim.api.nvim_buf_get_name(args.buf)
|
||||
if require("zk.util").notebook_root(path) then
|
||||
vim.keymap.set("n", "<leader>ni", "<cmd>ZkInsertLink<cr>", {
|
||||
buffer = args.buf,
|
||||
desc = "Insert note link",
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
Reference in new issue
Block a user