Update: Modularizing some features and customizations.

This commit is contained in:
psychhim
2025-10-14 01:15:22 +05:30
parent 15c17dd028
commit 1152ff8229
5 changed files with 261 additions and 223 deletions

View File

@@ -0,0 +1,22 @@
-- Auto-clear command line messages on most user actions and on pressing ESC
local M = {}
function M.setup()
-- Create an augroup for auto-clearing messages
local clear_msg_grp = vim.api.nvim_create_augroup('AutoClearMessages', { clear = true })
-- Clear messages on common user actions
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI', 'InsertEnter', 'InsertLeave', 'TextChanged', 'TextChangedI' }, {
group = clear_msg_grp,
callback = function()
vim.cmd 'echo ""' -- Clear the message/command line
end,
})
-- Clear messages when pressing ESC in normal and visual modes
vim.keymap.set('n', '<Esc>', '<Esc><Cmd>echo ""<CR>', { noremap = true, silent = true })
vim.keymap.set('v', '<Esc>', '<Esc><Cmd>echo ""<CR>', { noremap = true, silent = true })
end
return M