|
|
|
@ -37,11 +37,13 @@ local function press_tab()
|
|
|
|
|
|
|
|
|
|
if string.match(current_line, openpattern) or string.match(current_line, closedpattern) then
|
|
|
|
|
print("tab pressed, allegedly")
|
|
|
|
|
vim.api.nvim_feedkeys(vim.api.nvim_eval('"\\<esc>"'), "n", true)
|
|
|
|
|
vim.api.nvim_feedkeys(">", "n", true)
|
|
|
|
|
vim.api.nvim_feedkeys(">", "n", true)
|
|
|
|
|
vim.api.nvim_feedkeys("A", "n", true)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
vim.keymap.set("n", "<TAB>", press_tab, { desc = "On tab", noremap = true, expr = true })
|
|
|
|
|
vim.keymap.set("i", "<TAB>", press_tab, { desc = "On tab", noremap = true, expr = true })
|
|
|
|
|
|
|
|
|
|
-- indent line if shift tab is pressed when line is a todo
|
|
|
|
|
local function press_shift_tab()
|
|
|
|
@ -53,11 +55,13 @@ local function press_shift_tab()
|
|
|
|
|
|
|
|
|
|
if string.match(current_line, openpattern) or string.match(current_line, closedpattern) then
|
|
|
|
|
print("shift tab pressed, allegedly")
|
|
|
|
|
vim.api.nvim_feedkeys(vim.api.nvim_eval('"\\<esc>"'), "n", true)
|
|
|
|
|
vim.api.nvim_feedkeys("<", "n", true)
|
|
|
|
|
vim.api.nvim_feedkeys("<", "n", true)
|
|
|
|
|
vim.api.nvim_feedkeys("A", "n", true)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
vim.keymap.set("n", "S-<TAB>", press_shift_tab, { desc = "On shift tab", noremap = true, expr = true })
|
|
|
|
|
vim.keymap.set("i", "S-Tab", press_shift_tab, { desc = "On shift tab", noremap = true, expr = true })
|
|
|
|
|
-- function that checks if the current line starts with the string "- [ ]" or "- [x]" and toggles the x
|
|
|
|
|
|
|
|
|
|
local function toggle_todo()
|
|
|
|
|