configs/nvim/lua/config/autocmds.lua
Kacper Marzecki 60b2622659 safety commit
2025-10-19 19:14:39 +02:00

35 lines
1.1 KiB
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
--
-- vim.api.nvim_create_autocmd("User", {
-- pattern = "BlinkCmpMenuOpen",
-- callback = function()
-- vim.b.copilot_suggestion_hidden = false
-- end,
-- })