[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: is there some copy / paste functionality readline thingy ?
From: |
#!microsuxx |
Subject: |
Re: is there some copy / paste functionality readline thingy ? |
Date: |
Mon, 11 Nov 2024 01:47:29 +0100 |
im slowly getting it .. just checking the url ..
rereading the email makes much more sense than some days ago
++ , greets ..
On Fri, Nov 8, 2024, 3:54 PM Chet Ramey <chet.ramey@case.edu> wrote:
> On 11/7/24 5:52 PM, #!microsuxx wrote:
> > like , copy cmdline , copy from cursor to back , copy from cursor to
> front
>
> Readline maintains what it calls a `kill ring' (the concept is decades
> old and the terminology originates with emacs), which commands can add to,
> and which can be `yanked' into the line at the current cursor position.
> This all basically corresponds to cut/copy/paste and a `clipboard'
> as you refer to it.
>
> Look at the readline user manual:
>
>
> https://tiswww.cwru.edu/php/chet/readline/rluserman.html#Commands-For-Killing
>
> So, for example, in emacs mode, ^K^Y is an easy way to `copy' the text
> between the cursor and the end of the line into the kill ring: you kill
> the text, which deletes it from the line and copies it to the kill ring,
> then immediately yank it back into the line. The cursor position does
> move. You can do the same thing for the text between the cursor and the
> beginning of the line with ^U^Y.
>
> You can use the concept of the region to copy arbitrary sections of the
> input line to the kill ring. Set the mark (saved cursor position) using
> ^@, move the cursor to where you want, and invoke the copy-region-as-kill
> readline command (unbound by default) to copy the text between the point
> and mark -- the region -- to the kill ring.
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
>