diff --git a/modules/home/default.nix b/modules/home/default.nix index caf9c10..cc01f83 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -23,6 +23,7 @@ ./ssh.nix ./starship.nix ./zellij.nix + ./zk.nix ./zoxide.nix ./zsh.nix ]; diff --git a/modules/home/neovim/mappings.nix b/modules/home/neovim/mappings.nix index 23bf9b5..0f06cdf 100644 --- a/modules/home/neovim/mappings.nix +++ b/modules/home/neovim/mappings.nix @@ -231,5 +231,66 @@ action = ":lua require('harpoon'):list():select(4)"; options.desc = "Go to harpoon 4"; } + # z - zk (notes) + { + mode = "n"; + key = "zn"; + action = ":ZkNew { title = vim.fn.input('Title: ') }"; + options.desc = "New note"; + } + { + mode = "n"; + key = "zo"; + action = ":ZkNotes { sort = { 'modified' } }"; + options.desc = "Open notes"; + } + { + mode = "n"; + key = "zt"; + action = ":ZkTags"; + options.desc = "Browse tags"; + } + { + mode = "n"; + key = "zf"; + action = ":ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }"; + options.desc = "Find notes"; + } + { + mode = "v"; + key = "zf"; + action = ":'<,'>ZkMatch"; + options.desc = "Find notes matching selection"; + } + { + mode = "n"; + key = "zb"; + action = ":ZkBacklinks"; + options.desc = "Backlinks"; + } + { + mode = "n"; + key = "zl"; + action = ":ZkLinks"; + options.desc = "Outbound links"; + } + { + mode = "n"; + key = "zi"; + action = ":ZkInsertLink"; + options.desc = "Insert link"; + } + { + mode = "v"; + key = "zi"; + action = ":'<,'>ZkInsertLinkAtSelection"; + options.desc = "Insert link at selection"; + } + { + mode = "v"; + key = "zc"; + action = ":'<,'>ZkNewFromTitleSelection"; + options.desc = "Create note from selection"; + } ]; } diff --git a/modules/home/neovim/plugins/lsp.nix b/modules/home/neovim/plugins/lsp.nix index 48ad0fc..6d543a2 100644 --- a/modules/home/neovim/plugins/lsp.nix +++ b/modules/home/neovim/plugins/lsp.nix @@ -9,6 +9,7 @@ dockerls.enable = true; yamlls.enable = true; vtsls.enable = true; + zk.enable = true; }; }; }; diff --git a/modules/home/neovim/plugins/treesitter.nix b/modules/home/neovim/plugins/treesitter.nix index 4ab907c..8465731 100644 --- a/modules/home/neovim/plugins/treesitter.nix +++ b/modules/home/neovim/plugins/treesitter.nix @@ -11,10 +11,11 @@ fish heex json + markdown nix toml + tsx typescript - vue yaml ]; }; diff --git a/modules/home/neovim/plugins/zk.nix b/modules/home/neovim/plugins/zk.nix new file mode 100644 index 0000000..783af8e --- /dev/null +++ b/modules/home/neovim/plugins/zk.nix @@ -0,0 +1,7 @@ +{ + programs.nixvim.plugins.zk = { + enable = true; + settings = { + }; + }; +} diff --git a/modules/home/zk.nix b/modules/home/zk.nix new file mode 100644 index 0000000..338337e --- /dev/null +++ b/modules/home/zk.nix @@ -0,0 +1,16 @@ +{ + programs.zk = { + enable = true; + settings = { + notebook = { + path = "~/Projects/Personal/Zettelkasten"; + }; + note = { + language = "en"; + }; + extra = { + author = "Christoph Schmatzler"; + }; + }; + }; +}