require('spell') vim.opt.foldlevel = 1 vim.fn.matchadd('Conceal', '- \\[ \\]\\&- \\zs\\[ ', 0, -1, { conceal = '☐ ' }) -- vim.fn.matchadd('Conceal', '\\[x\\]', 0, -1, { conceal = '☑ ' }) -- vim.fn.matchadd('Conceal', '\\[-\\]', 0, -1, { conceal = '☒ ' }) vim.fn.matchadd('Conceal', '- \\[x\\]\\&- \\zs\\[x', 0, -1, { conceal = '🞕 ' }) vim.fn.matchadd('Conceal', '- \\[[ x]\\zs\\]', 0, -1, { conceal = ' ' }) vim.keymap.set('n', 'Markdown_OpenUrlUnderCursor', function() require('misc').open_under_cursor('url-launcher') end) vim.keymap.set('n', 'l', require('misc').link_preview, {desc='link preview'}) local function toggle_checkbox() local ln, n = vim.api.nvim_get_current_line(), 0 ln, n = string.gsub(ln, '%[ %]', '[x]', 1) if n > 0 then goto set_line end ln, n = string.gsub(ln, '%[x%]', '[ ]', 1) if n > 0 then goto set_line end ln, n = string.gsub(ln, 'TODO', 'DONE', 1) if n > 0 then goto set_line end ln, n = string.gsub(ln, 'DONE', 'TODO', 1) if n > 0 then goto set_line end ::set_line:: vim.api.nvim_set_current_line(ln) end vim.keymap.set('n', '', toggle_checkbox, {desc='toggle checkbox'}) vim.keymap.set('n', '', toggle_checkbox, {desc='toggle checkbox'}) vim.keymap.set('i', '', toggle_checkbox, {desc='toggle checkbox'}) -- vim.keymap.set('n', 'zn', function() require('zk').new() end) -- vim.keymap.set('n', 'zi', function() require('zk').index() end) -- vim.cmd [[ command! -nargs=* ZettelkastenNew lua require('zk').new(nil, ) ]] vim.keymap.set('n', 'gt', function() require('telescope._extensions.todo-comments').exports.todo {cwd=vim.env.ZK_NOTEBOOK_DIR} end, {desc='show zk todos'})