bat icon indicating copy to clipboard operation
bat copied to clipboard

Feature request to have pattern search option like VIM

Open ciscohack opened this issue 4 years ago • 6 comments

Hi Team,

Can we have pattern search feature in Bat like we have in vim where we use :g/pattern to match the keyword and it list the all lines match to search pattern then we use vim jump feature to jump on the matched line.

ciscohack avatar Oct 02 '21 05:10 ciscohack

bat uses less by default. To search for pattern, type /pattern<RET>. Then n and N to navigate down and up among the search results.

Enselic avatar Oct 02 '21 11:10 Enselic

bat uses less by default. To search for pattern, type /pattern<RET>. Then n and N to navigate down and up.

First thanks for prompt response. yes i am aware but i am looking something like :g/pattern where it list all the matched line of searched keyword. thought to check if this possible with bat tool

ciscohack avatar Oct 02 '21 16:10 ciscohack

It doesn't seem like less supports that, unfortunately.

eth-p avatar Oct 02 '21 21:10 eth-p

It doesn't seem like less supports that, unfortunately.

Okay got it. So means not possible

ciscohack avatar Oct 03 '21 05:10 ciscohack

@ciscohack If you can find a pager that allows you to search with that syntax, you can make it work. I did a quick search and stumbled upon this, didn't get to try it though: https://github.com/rkitover/vimpager

mdibaiee avatar Dec 24 '21 19:12 mdibaiee

@ciscohack If you can find a pager that allows you to search with that syntax, you can make it work. I did a quick search and stumbled upon this, didn't get to try it though: https://github.com/rkitover/vimpager

Thanks my friend for time and link. But this only work under vim.. will see anyway

ciscohack avatar Dec 24 '21 19:12 ciscohack