I was looking for some vim command to automatically search with qgrep for the word under the cursor. This was a pain to do with normal! and execute, so I looked if it was possible to pass the command QgrepSearch some arguments. I'm still a noob in vimscript but didn't see a lot of use from the qgrep#open arguments, excepts from the first one which was the mode.
So I simply added a way to check if another second argument was provided, and if it is, consider it as the default first input.
With that change, it now because way easier to make vimscript command for qgrep. For example (tested on my side) :
:execute "QgrepSearch" expand("<cword>")
launches qgrep with, as default input, the current word under the cursor. And you can go way crazier with that :)
I'm also a noob in PR, so tell me if there's something I could do better.
I was looking for some vim command to automatically search with qgrep for the word under the cursor. This was a pain to do with normal! and execute, so I looked if it was possible to pass the command QgrepSearch some arguments. I'm still a noob in vimscript but didn't see a lot of use from the qgrep#open arguments, excepts from the first one which was the mode.
So I simply added a way to check if another second argument was provided, and if it is, consider it as the default first input.
With that change, it now because way easier to make vimscript command for qgrep. For example (tested on my side) :
:execute "QgrepSearch" expand("<cword>")
launches qgrep with, as default input, the current word under the cursor. And you can go way crazier with that :)
I'm also a noob in PR, so tell me if there's something I could do better.