I am writing a comment plugin that supports commenting in visual line mode. I tried using vim.cmd "stopinsert" for returning back to normal mode, but it doesn't work. How can I return back to normal mode?


I find out that I can do that with vim.api.nvim_input("<esc>"), but I am not sure if there is a better alternative

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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