nvim: Add zk mappings

This commit is contained in:
Marty Oehme 2023-03-22 17:01:02 +01:00
parent d0e536b798
commit aa68137ff8
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 27 additions and 4 deletions

View file

@ -80,5 +80,5 @@
"wrapping.nvim": { "branch": "master", "commit": "a4013c377e2ffa3be00fb67791d3605ae3115acb" }, "wrapping.nvim": { "branch": "master", "commit": "a4013c377e2ffa3be00fb67791d3605ae3115acb" },
"zen-mode.nvim": { "branch": "main", "commit": "d907e638c879642d226d27469b53db6925f69d4c" }, "zen-mode.nvim": { "branch": "main", "commit": "d907e638c879642d226d27469b53db6925f69d4c" },
"zettelkasten.nvim": { "branch": "main", "commit": "0e77624689b470410f5355b613d45219c9350264" }, "zettelkasten.nvim": { "branch": "main", "commit": "0e77624689b470410f5355b613d45219c9350264" },
"zk-nvim": { "branch": "main", "commit": "0413c52500cd0133b0cd8e7e7d43084855ac1760" } "zk-nvim": { "branch": "main", "commit": "50fc25b88fb28829ec7f5e5a4d4b458fca21a550" }
} }

View file

@ -236,9 +236,32 @@ map("v", "g<C-x>", 'g<Plug>(dial-increment)')
-- PLUGIN: zettelkasten.nvim -- PLUGIN: zettelkasten.nvim
map('n', '<cr>', [[:silent lua require 'zettelkasten'.link_follow()<cr>]]) map('n', '<cr>', [[:silent lua require 'zettelkasten'.link_follow()<cr>]])
map('v', '<cr>', [[:lua require 'zettelkasten'.link_follow(true)<cr>]]) map('v', '<cr>', [[:lua require 'zettelkasten'.link_follow(true)<cr>]])
prefix({ ['<leader>w'] = { name = '+wiki' } }) prefix({ ['<leader>n'] = { name = '+notes' } })
map('n', '<leader>ww', [[:lua require 'zettelkasten'.index_open()<cr> ]], map('n', '<leader>ni', [[:lua require 'zettelkasten'.index_open()<cr> ]],
{ desc = "open wiki" }) { desc = "index page" })
-- PLUGIN: zk
map('n', '<leader>nn', "<cmd>ZkNotes { sort = { 'modified' } }<cr>",
{ desc = "note list" })
map("n", "<leader>nf", "<Cmd>ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }<CR>",
{ desc = "note search" })
map('n', '<leader>nt', "<cmd>ZkTags<cr>",
{ desc = "note tags" })
map('n', '<leader>nc', "<cmd>ZkCd<cr>",
{ desc = "notes directory" })
prefix({ ['<localleader>n'] = { name = '+note' } })
map('n', '<localleader>nl', "<cmd>ZkLinks<cr>",
{ desc = "note links" })
map('n', '<localleader>nb', "<cmd>ZkLinks<cr>",
{ desc = "note backlinks" })
map('n', '<localleader>nn', "<cmd>ZkNew { title = vim.fn.input('Title: ') }<cr>",
{ desc = "new note" })
prefix({ ['<localleader>n'] = { name = '+note', mode = "v" } })
map('v', '<localleader>nn', ":ZkNewFromTitleSelection<cr>",
{ desc = "title from selection" })
map('v', '<localleader>nN', ":ZkNewFromContentSelection<cr>",
{ desc = "content from selection" })
map('v', '<localleader>nf', ":ZkMatch<cr>",
{ desc = "find note from selection" })
-- PLUGIN: toggleterm.nvim -- PLUGIN: toggleterm.nvim
-- create a lazygit window, set up in toggleterm settings -- create a lazygit window, set up in toggleterm settings