Evil has a beautiful :s(ubstitute) implementation, which shows the regexp inline as you type:

Evil's Substitute command

However, the feature doesn't exist for the global command, :g (such that :%g/emacs/... will find the line as expected, but nothing will appear until the command is executed). Do there exist easy ways to include this feature, and bind to the Evil substitute command?


It's not an easy task.

The ex command interface (pressing :) is a mini-language itself. Ex uses an "argument handler" to provide completion and interactive feedback (as for :s)

Looking at the handler for :s you can get an idea of where to plug this now handler. However, you'll have to work out a "execute this code that can be undone" way to handle your input

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.