NOTE: This plugin is now archived/deprecated. Please see #41 for more information.
A lightweight neovim, lua-based wrapper around zk
.
The primary goals of this plugin are to provide handy maps, commands, and user-interface elements around the fantastic golang zettelkasten project, zk
.
For more information with how to fully use zk
, please visit zk's docs
LSP
support within zk
is new and still under development. It works quite well as-is, though. 😄
nvim-0.5.0
or higher- For fzf support: nvim-fzf
- For telescope.nvim support: telescope.nvim
paq { "megalithic/zk.nvim" }
use { "megalithic/zk.nvim" }
Plug "megalithic/zk.nvim"
-- with default config options:
require("zk").setup({
debug = false,
log = true,
default_keymaps = true,
default_notebook_path = vim.env.ZK_NOTEBOOK_DIR or "",
fuzzy_finder = "fzf", -- or "telescope"
link_format = "markdown" -- or "wiki"
})
For all usages of this plugin, the parlance of notebook
is common place, and refers to a sub-directory within your root ZK_NOTEBOOK_DIR
; or more specifically, a notebook
is any directory that contains a .zk
directory (think of it like a .git
-controlled directory).
These notebooks
also relate to your groups
setup within your config.toml
.
Install zk
Install the zk
binary (as long as go
is installed in your system's PATH
).
:ZkInstall
:lua require('zk.command').new({ title = "my note title" })
Default arguments:
{
title = "",
notebook = "",
content = "",
action = "vnew",
start_insert_mode = true
}
zk
offers such a wealth of power with searching, filtering and more for your notes, notebooks, etc.
Presently only supports interacting with fzf
, via a flexible and fast lua-based API plugin, nvim-fzf
. Searching via vim command, :ZkSearch
only supports query searches at the moment. Using the lua command, the option to pass tags, notebook, and query are supported.
Future support for telescope.nvim
integration, coming soon.
:lua require('zk.command').search({ query = "hiring NOT onboarding" })
" or
:ZkSearch "hiring NOT onboarding"
Default arguments:
{
query = "",
notebook = "",
tags = "",
}
Quickly change the word under cursor (or visually selected) to markdown or wiki syntax:
:lua require('zk.command').create_note_link({ title = "my note title", notebook = "wiki", action = "e" })
Default arguments:
{
title = "",
notebook = "",
action = "vnew",
open_note_on_creation = true
}
Default keymaps:
vim.api.nvim_set_keymap(
"x",
"<CR>",
"<cmd>lua require('zk.command').create_note_link({})<cr>",
{noremap = true, silent = false}
)
vim.api.nvim_set_keymap(
"n",
"<CR>",
"<cmd>lua require('zk.command').create_note_link({title = vim.fn.expand('<cword>')})<cr>",
{noremap = true, silent = false}
)
Load the zk
extension to enable zk
support in telescope
.
require('telescope').load_extension('zk')
Register a keymap to open the picker for the zk notes.
nnoremap <leader>n <cmd>lua require('telescope').extensions.zk.zk_notes()<cr>
nnoremap <leader>zg <cmd>lua require('telescope').extensions.zk.zk_grep()<cr>
nnoremap <leader>zb <cmd>lua require('telescope').extensions.zk.zk_backlinks()<cr>
- Mickael Menu (https://github.com/mickael-menu/zk)
- Evan Travers (http://evantravers.com/articles/tags/zettelkasten/)
- Zettelkasten Introduction (https://zettelkasten.de/introduction/#why-are-we-so-interested-in-luhmann-s-zettelkasten)