Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grepper in Vimscript function does not execute subsequent cdo command #259

Open
gennaro-tedesco opened this issue Sep 11, 2022 · 0 comments

Comments

@gennaro-tedesco
Copy link

gennaro-tedesco commented Sep 11, 2022

I am writing a simple function to search the word under cursor and replace it automatically, something along the lines of

function! Replace() abort
    Grepper -cword -noprompt -noopen
    silent execute "cdo s/" . expand("<cword>") . "/<replace>/g"
endfunction

however, I noticed that when using vim-grepper and Grepper as grep wrapper, the subsequent cdo command is not executed, namely the quickfix windows opens up and no replacement is done. If instead I use the standard vimgrep <cword> % with the above function all works as intended.

I suppose it may have to do with having to use <Plug>(GrepperOperator) in a function rather than Grepper as command, or am I making some other trivial mistake (for instance there are flags to directly execute cdo commands after grepping)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant