put cursor on found text in less or vi?

Volker Wysk post at volker-wysk.de
Fri Sep 27 16:35:33 UTC 2024


Am Freitag, dem 27.09.2024 um 11:35 -0400 schrieb Paul Smith:
> On Fri, 2024-09-27 at 11:45 +0200, Volker Wysk wrote:
> > (define-key global-map "\e[1~"               'beginning-of-line)
> > (define-key global-map [home]                'beginning-of-line)
> > (define-key global-map "\e[4~"               'end-of-line)
> > (define-key global-map [end]                 'end-of-line)
> 
> This is the same as the default behavior, as far as I can tell, so you
> don't need this.  But, this won't do what was requested as it goes to
> the beginning of the logical line not the start of the visual line.
> 
> > (define-key global-map [C-prior]             'beginning-of-buffer)
> > (define-key global-map [C-next]              'end-of-buffer)
> 
> You can add extra keybindings, of course, but this isn't needed to
> achieve the behavior asked for.  Especially for new folks I think it's
> not a good idea to add extra unasked-for stuff, as they may not realize
> that it's extra rather than required.

I've been using Emacs for decades. I can't remember when I added those
bindings. But I wouldn't have done so when it had been the default behavior.
Maybe the default behavior changed in the meantime.

Volker



More information about the ubuntu-users mailing list