diff --git a/modules/editor/vim/lua/plugins/zk.lua b/modules/editor/vim/lua/plugins/zk.lua new file mode 100644 index 0000000..f8111ac --- /dev/null +++ b/modules/editor/vim/lua/plugins/zk.lua @@ -0,0 +1,52 @@ +return { + "zk-org/zk-nvim", + keys = { + { + "zn", + "ZkNew { title = vim.fn.input('Title: ') }", + desc = "Create a new note after asking for its title" + }, + { + "zo", + "ZkNotes { sort = { 'modified' } }", + desc = "Open Notes" + }, + { + "zt", + "ZkTags", + desc = "Open notes associated with the selected tags" + }, + { + "zf", + "ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }", + desc = "Search for the notes matching a given query" + }, + { + "zf", + ":'<,'>ZkMatch", + mode = { "v" }, + desc = "Search for the notes matching the current visual selection" + }, + }, + config = function() + require("zk").setup({ + picker = "fzf_lua", + + lsp = { + -- `config` is passed to `vim.lsp.start(config)` + config = { + name = "zk", + cmd = { "zk", "lsp" }, + filetypes = { "markdown" }, + -- on_attach = ... + -- etc, see `:h vim.lsp.start()` + }, + + -- automatically attach buffers in a zk notebook that match the given filetypes + auto_attach = { + enabled = true, + }, + }, + }) + end, +} diff --git a/modules/editor/vim/vim.nix b/modules/editor/vim/vim.nix index a502675..9b113cb 100644 --- a/modules/editor/vim/vim.nix +++ b/modules/editor/vim/vim.nix @@ -131,6 +131,7 @@ in lazydev-nvim vim-startuptime yazi-nvim + zk-nvim ]; extraPackages = with pkgs; [ @@ -290,6 +291,7 @@ in bash-language-server angular-language-server vtsls + zk ]; }; };