this repo has no description
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

nvim: add zk

+41 -8
+41 -8
home/profiles/nvim/default.nix
··· 330 330 nnoremap <leader>gc :G commit -v -q %:p<CR> 331 331 332 332 " kitaab 333 - map <leader>cz :VimwikiIndex<CR>:ZettelNew 334 - map <leader>zs :ZettelSearch<CR> 335 - map <leader>zn :ZettelNew<CR> 336 - map <leader>zo :ZettelOpen<CR> 337 - map <leader>zf :Telescope oldfiles only_cwd=true<CR> 338 - map <leader>wt :VimwikiMakeTomorrowDiaryNote 339 - map <leader>wd :VimwikiMakeYesterdayDiaryNote 340 - map <leader>zm :ZenMode<CR>:setlocal nospell<CR> 333 + "map <leader>cz :VimwikiIndex<CR>:ZettelNew 334 + "map <leader>zs :ZettelSearch<CR> 335 + "map <leader>zn :ZettelNew<CR> 336 + "map <leader>zo :ZettelOpen<CR> 337 + "map <leader>zf :Telescope oldfiles only_cwd=true<CR> 338 + "map <leader>wt :VimwikiMakeTomorrowDiaryNote 339 + "map <leader>wd :VimwikiMakeYesterdayDiaryNote 340 + "map <leader>zm :ZenMode<CR>:setlocal nospell<CR> 341 341 let g:vimwiki_list = [{ 'path': '~/kitaab/vimwiki', 'auto_tags': 1, 'auto_diary_index': 1, 'auto_generate_links': 1 }] 342 342 let g:sync_taskwarrior = 0 343 343 let g:zettel_format = "%y%m%d-%H%M" ··· 802 802 803 803 -- zk 804 804 require("zk").setup() 805 + vim.api.nvim_set_keymap("n", "<leader>zn", "<Cmd>ZkNew { title = vim.fn.input('Title: ') }<CR>", opts) 806 + 807 + -- Open notes. 808 + vim.api.nvim_set_keymap("n", "<leader>zo", "<Cmd>ZkNotes { sort = { 'modified' } }<CR>", opts) 809 + -- Open notes associated with the selected tags. 810 + vim.api.nvim_set_keymap("n", "<leader>zt", "<Cmd>ZkTags<CR>", opts) 811 + 812 + local map = vim.api.nvim_set_keymap 813 + -- Search for the notes matching a given query. 814 + vim.api.nvim_set_keymap("n", "<leader>zf", "<Cmd>ZkNotes { sort = { 'modified' }, match = { vim.fn.input('Search: ') } }<CR>", opts) 815 + -- Search for the notes matching the current visual selection. 816 + vim.api.nvim_set_keymap("v", "<leader>zf", ":'<,'>ZkMatch<CR>", opts) 817 + map("n", "<CR>", "<Cmd>lua vim.lsp.buf.definition()<CR>", opts) 818 + 819 + -- Create a new note after asking for its title. 820 + -- This overrides the global `<leader>zn` mapping to create the note in the same directory as the current buffer. 821 + map("n", "<leader>zn", "<Cmd>ZkNew { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>", opts) 822 + -- Create a new note in the same directory as the current buffer, using the current selection for title. 823 + map("v", "<leader>znt", ":'<,'>ZkNewFromTitleSelection { dir = vim.fn.expand('%:p:h') }<CR>", opts) 824 + -- Create a new note in the same directory as the current buffer, using the current selection for note content and asking for its title. 825 + map("v", "<leader>znc", ":'<,'>ZkNewFromContentSelection { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>", opts) 826 + 827 + -- Open notes linking to the current buffer. 828 + map("n", "<leader>zb", "<Cmd>ZkBacklinks<CR>", opts) 829 + -- Alternative for backlinks using pure LSP and showing the source context. 830 + --map('n', '<leader>zb', '<Cmd>lua vim.lsp.buf.references()<CR>', opts) 831 + -- Open notes linked by the current buffer. 832 + map("n", "<leader>zl", "<Cmd>ZkLinks<CR>", opts) 833 + 834 + -- Preview a linked note. 835 + map("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", opts) 836 + -- Open the code actions for a visual selection. 837 + map("v", "<leader>za", ":'<,'>lua vim.lsp.buf.range_code_action()<CR>", opts) 805 838 806 839 -- zen mode 807 840 require('zen-mode').setup{