0

How does

autocmd FocusLost * call feedkeys("\<esc>") (back to normal mode, if focus is lost)

translate to lua in init.lua?

1 Answer 1

0

I believe you should do:

vim.api.nvim_create_autocmd("FocusLost", { pattern = "*", command = [[call feedkeys("\<esc>")]] })

More information with: :help nvim_create_autocmd()

2
  • Indeed, thank you :-) ! Commented Apr 26, 2023 at 19:13
  • Thanks for the feedback! If the solution fit your need maybe could you validate it using the v button next to the arrow voting buttons. It allow the question to rest :-) Commented Apr 26, 2023 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.