I have case where I would like to trigger the TextChanged event manually without actually changing the text. Would that be possible? How?

I know it's hacky, but it would make my life easier right now. :)

  • 4
    Are you aware of :doautocmd?
    – Heptite
    Commented Dec 6, 2021 at 17:16
  • No. Do I understand the help page correctly? If I do :doautocmd TextChanged, then all autocmds triggered by TextChanged will run?
    – cmosig
    Commented Dec 6, 2021 at 18:30
  • 1
    Yes, or you can get specific on which group and/or events to trigger.
    – Heptite
    Commented Dec 6, 2021 at 18:49

1 Answer 1


What you are looking for is :doautocmd. With this you can trigger all the autocmds in an event, or just those that match a specific pattern. Or you can scope based on autocmd group. For example, to trigger all the TextChanged events:

:doautocmd TextChanged

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.