summary refs log tree commit diff
path: root/.config/nvim/after/ftplugin/todotxt.lua
blob: d5091b37a0744cd8205e2a01de491a802d52db66 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
vim.opt_local.textwidth = 0

vim.keymap.set('n', '<m-x>', function()
  require('mod.utils').edit_current_line(function(lines)
    -- will only run for the current line
    return vim.tbl_map(function(ln)
      if string.sub(ln, 1, 2) == 'x ' then
        return string.sub(ln, 3, -1)
      else
        return 'x ' .. ln
      end
    end, lines)
  end)
end, { desc = 'Check todo', buffer = 0 })