ZK

Links:

Install

Install the zk cli

yay -S zk

and the nvim plugin

Setup

1return {
2	"zk-org/zk-nvim",
3	config = function()
4		require("zk").setup({
5			-- See Setup section below
6		})
7	end,
8}
export ZK_NOTEBOOK_DIR=~/.notes # add this to zshrc
zk init ${ZK_NOTEBOOK_DIR}

To see the title instead of the filename in wikilinks edit the ${ZK_NOTEBOOK_DIR}/.notes/.zk/config.toml and uncomment

1[lsp.diagnostics]
2# Report titles of wiki-links as hints.
3wiki-title = "hint" # uncomment this line

To add syntax highlighting support for wikilinks

create a new file ~/.config/nvim/after/syntax/markdown.vim

1" markdownWikiLink is a new region
2syn region markdownWikiLink matchgroup=markdownLinkDelimiter start="\[\[" end="\]\]" contains=markdownUrl keepend oneline concealends
3" markdownLinkText is copied from runtime files with 'concealends' appended
4syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\%(\_[^][]\|\[\_[^][]*\]\)*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart concealends
5" markdownLink is copied from runtime files with 'conceal' appended
6syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained conceal

and update nvim-treesitter

1require("nvim-treesitter.configs").setup({
2  -- ...
3  highlight = {
4    -- ...
5    additional_vim_regex_highlighting = { "markdown" }
6  },
7})

Usage

From vim :ZKNew creates a new note

To import from somewhere you can pipe to the zk cli

wl-paste | zk new --interactive

← Incoming Links (1)

Index
wiki • Line 57
"- ZK (2025-04-20)"

→ Outgoing Links

No outgoing links