Less command with grep command highlight under linux

the search string is highlighted when using the grep command. But sometimes there are too many search results, so if you need to page them, you should use less

.
grep "find string"  file |less

the search string is not highlighted in the less results at this time. I wonder if there is any way to highlight the search string

May.14,2022

grep "find string"  file |less -R

grep 'find string' file-- color=auto
generally I like to use grep-A 20' find string' file-- color=auto

  • Vim set Shortcut Keys

    I use NERDTree, in vim and there is a very useful shortcut Ctrl+w+w is used to switch horizontally, but I think it s too troublesome. I want to set another shortcut for this key combination, such as . Ctrl+Alt+Left I don t know how to configure it...

    Sep.06,2021
Menu