diff options
Diffstat (limited to '')
| -rw-r--r-- | .vim/after/ftplugin/markdown.lua | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/.vim/after/ftplugin/markdown.lua b/.vim/after/ftplugin/markdown.lua index 87fe69d..7e6b22e 100644 --- a/.vim/after/ftplugin/markdown.lua +++ b/.vim/after/ftplugin/markdown.lua @@ -1,4 +1,4 @@ -require('internal.spell') +-- require('internal.spell') vim.opt_local.foldenable = false vim.opt_local.foldlevel = 1 @@ -8,9 +8,7 @@ vim.fn.matchadd('Conceal', '- \\[ \\]\\&- \\zs\\[ ', 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', '<Plug>Markdown_OpenUrlUnderCursor', function() - require('internal.misc').open_under_cursor('url-launcher') -end) +vim.keymap.set('n', '<Plug>Markdown_OpenUrlUnderCursor', vim.ui.open) vim.keymap.set( 'n', @@ -45,31 +43,26 @@ end vim.keymap.set('n', '<space><space>', toggle_checkbox, { desc = 'toggle checkbox', buffer = true }) vim.keymap.set('i', '<c-space>', toggle_checkbox, { desc = 'toggle checkbox', buffer = true }) --- vim.keymap.set('n', '<leader>zn', function() require('zk').new() end, {buffer=true}) --- vim.keymap.set('n', '<leader>zi', function() require('zk').index() end, {buffer=true}) --- vim.cmd [[ command! -nargs=* ZettelkastenNew lua require('zk').new(nil, <f-args>) ]] - -vim.keymap.set('n', 'gt', function() - require('telescope._extensions.todo-comments').exports.todo({ cwd = vim.env.ZK_NOTEBOOK_DIR }) -end, { desc = 'show zk todos', buffer = true }) - -vim.keymap.set('n', 'o', function() - local cursor = vim.api.nvim_win_get_cursor(0) - -- need to decrement the row number here, to account for 0 indexing - local node = vim.treesitter.get_node_at_pos(0, cursor[1] - 1, cursor[2], {}) - while node do - if node:type() == 'list_item' then - local ln = vim.treesitter.get_node_text(node:child(0), 0, {}) - local ln_start = string.match(ln, '^(%d+)%.') - if ln_start ~= nil then - ln = ln:gsub(ln_start, tonumber(ln_start) + 1) - end - vim.api.nvim_buf_set_lines(0, cursor[1], cursor[1], false, { ln }) - vim.api.nvim_feedkeys('jA', 'n', false) - return - end - node = node:parent() - end - - vim.api.nvim_feedkeys('o', 'n', false) -end, { desc = 'smart-o', buffer = true }) +-- vim.keymap.set('n', 'o', function() +-- local cursor = vim.api.nvim_win_get_cursor(0) +-- -- need to decrement the row number here, to account for 0 indexing +-- local node = vim.treesitter.get_node({ +-- bufnr = 0, +-- pos = { cursor[1] - 1, cursor[2] }, +-- }) +-- while node do +-- if node:type() == 'list_item' then +-- local ln = vim.treesitter.get_node_text(node:child(0), 0, {}) +-- local ln_start = string.match(ln, '^(%d+)%.') +-- if ln_start ~= nil then +-- ln = ln:gsub(ln_start, tonumber(ln_start) + 1) +-- end +-- vim.api.nvim_buf_set_lines(0, cursor[1], cursor[1], false, { ln }) +-- vim.api.nvim_feedkeys('jA', 'n', false) +-- return +-- end +-- node = node:parent() +-- end +-- +-- vim.api.nvim_feedkeys('o', 'n', false) +-- end, { desc = 'smart-o', buffer = true }) |