I use / for search. Once I press enter I use n and N to navigate. If I press / again though the old pattern is lost. 90% of the times I want to append the pattern and I have to retype, which I naturally hate it. Is there an option to append the current pattern in less?
1 Answer
less remembers previous searches (even from previous executions, if you have a history file — ~/.lesshst by default). To access them, press / and the arrow keys. For your specific use-case, you’d press / ↑, less will show the previous pattern with the cursor at the end of the pattern, and you can type the additional pattern.
- 1So simple and yet, it didn't cross my mind... Thanks. (8 minutes to go)Stelios Adamantidis– Stelios Adamantidis2018-01-26 14:29:25 +00:00Commented Jan 26, 2018 at 14:29