put cursor on found text in less or vi?

Volker Wysk post at volker-wysk.de
Fri Sep 27 09:45:11 UTC 2024


Hi

Am Donnerstag, dem 26.09.2024 um 11:59 -0400 schrieb Little Girl:
> My understanding is also that Emacs uses a two-key key-combination to
> get to the beginning and end of a line and it's still not clear to me
> whether Emacs takes wrapping into account in determining where that
> beginning or end is. I'm not sure whether it would accept my Home and
> End keys for that.
> 
> My understanding is that Emacs uses Home and End to get to the
> beginning and end of the document, which would conflict with my way
> of getting to the beginning and end of the current line. I haven't
> yet found out whether Emacs would accept my key-combinations for
> those.

Add this to your ~/.emacs file:

(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)
(define-key global-map [C-prior]             'beginning-of-buffer)
(define-key global-map [C-next]              'end-of-buffer)

The first and third lines are for text terminals (non-GUI mode).

Cheers,
Volker




More information about the ubuntu-users mailing list