put cursor on found text in less or vi?
MR ZenWiz
mrzenwiz at gmail.com
Wed Sep 25 17:47:11 UTC 2024
On Wed, Sep 25, 2024 at 10:02 AM Karl Auer <kauer at biplane.com.au> wrote:
>
> On Wed, 2024-09-25 at 08:26 -0700, MR ZenWiz wrote:
> > I've been using vi for over 40 years. I've never seen that kind of
> > behavior on a standard / search. When I use that, the cursor always
> > lands on the first character of the search pattern.
>
> 30 years in my case. I am now doubting my own sanity. It does. But less
> doesn't. Did I somehow confuse less and vi? Some kind of termcap thing?
> Weird characters confusing the search?
I suspect confusion is the key.
However, on my machine, I have 'more' aliased to '/bin/less -mFX'.
When I do a search, the search pattern is highlighted on the top line
of the screen (and everywhere else it shows up). The problem you may
be seeing is that your "top line" is so long it covers multiple
screens, which indeed makes it harder to spot visually.
Vi doesn't do that, in my experience. However, I would not generally
try to edit or view files with lines longer than a single screen, and
my terminal windows are typically 110x59 on my 32" 2k monitor - they'd
be bigger (and finer print) if I could see better..
HTH,
MRZ
More information about the ubuntu-users
mailing list