There are several extensions available to integrate zk
in your favorite editor:
zk.nvim
for Neovim 0.5+, maintained by Seth Messerzk-vscode
for Visual Studio Code
zk
ships with a Language Server to provide basic support for any LSP-compatible editor. The currently supported features are:
- Auto-complete Markdown links with
[[
(setup wiki-links in the note formats configuration) - Auto-complete hashtags and colon-separated tags.
- Preview the content of a note when hovering a link.
- Navigate in your notes by following internal links.
- And more to come...
To start the Language Server, use the zk lsp
command. Refer to the following sections for editor-specific examples. Feel free to share the configuration for your editor.
With coc.nvim
, run :CocConfig
and add the following in the settings file:
{
// Important, otherwise link completion containing spaces and other special characters won't work.
"suggest.invalidInsertCharacters": [],
"languageserver": {
"zk": {
"command": "zk",
"args": ["lsp"],
"trace.server": "messages",
"filetypes": ["markdown"]
},
}
}
Using nvim-lspconfig
:
local lspconfig = require('lspconfig')
local configs = require('lspconfig/configs')
configs.zk = {
default_config = {
cmd = {'zk', 'lsp'},
filetypes = {'markdown'},
root_dir = function()
return vim.loop.cwd()
end,
settings = {}
};
}
lspconfig.zk.setup({ on_attach = function(client, buffer)
-- Add keybindings here, see https://github.com/neovim/nvim-lspconfig#keybindings-and-completion
end })
Install the Sublime LSP package, then run the Preferences: LSP Settings command. Add the following to the settings file:
{
"clients": {
"zk": {
"enabled": true,
"command": ["zk", "lsp"],
"languageId": "markdown",
"scopes": [ "source.markdown" ],
"syntaxes": [ "Packages/MarkdownEditing/Markdown.sublime-syntax" ]
}
}
}
Install the zk-vscode
extension from the Marketplace.