28 lines
987 B
Lua
28 lines
987 B
Lua
-- Autocmds are automatically loaded on the VeryLazy event
|
|
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
|
-- Add any additional autocmds here
|
|
--
|
|
|
|
-- Set the keybind to choose the timer duration
|
|
vim.api.nvim_set_keymap("n", "<leader>T", "<cmd>lua choose_timer()<CR>", { noremap = true, silent = true })
|
|
-- TODO APP MAPPINGS
|
|
vim.api.nvim_create_autocmd("BufReadPost", {
|
|
pattern = "/tmp/task_edit.txt",
|
|
callback = function()
|
|
if vim.fn.line("$") == 1 and vim.fn.getline(1) == "" then
|
|
vim.cmd("startinsert")
|
|
end
|
|
end,
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd("FileType", {
|
|
pattern = "*",
|
|
callback = function()
|
|
if vim.fn.expand("%") == "/tmp/task_edit.txt" then
|
|
vim.api.nvim_buf_set_keymap(0, "n", "<C-S>", ":wq<CR>", { noremap = true, silent = true })
|
|
vim.api.nvim_buf_set_keymap(0, "i", "<C-S>", "<Esc>:wq<CR>", { noremap = true, silent = true })
|
|
end
|
|
end,
|
|
})
|
|
-- END TODO APP MAPPINGS
|