-- 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 -- -- 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", "", ":wq", { noremap = true, silent = true }) vim.api.nvim_buf_set_keymap(0, "i", "", ":wq", { noremap = true, silent = true }) end end, }) -- END TODO APP MAPPINGS