cut and paste

Tim Chase blinux.list at thechases.com
Thu Feb 21 12:01:48 UTC 2008


While I don't have a brltty-specific answer, as I don't use it,
you may be interested in using "screen" which does offer copy &
paste functionality for the scrollback buffer.

> What exactly do I have to do to say copy one line of text or maybe 3 or 4 
> lines of text?

In screen, press control-A followed by "[" to start copy mode.
Move around using the Vi keys/motions--some work (most of the
basics: h/j/k/l/t/b/^/$ etc), some don't (annoyingly, the
F/f/T/t).  Press space to drop your first mark, move to the
end-point, and press space again.  You can then type control-A
followed by "]" to paste it into another screen window (or the
same one) as if you typed it.  This can do funky things with
indentation and line-breaks, but it's often good enough.  Adjust
the control-A if you've changed your metacharacter from the default.

> Also could I copy a whole document? Or does it have to be on the screen?

For using "screen", it has to be in the scrollback buffer.  For
programs like Emacs/Vim/Nano which take over the screen, that's
not too helpful.  However, to copy a whole document, or an
excerpt of a document, I find it easier to just have my editor
write that portion to a temp file so it can be read elsewhere.
It's something I'm _sure_ can be done in Emacs, something I
_know_ can be done in Vim (I'm a vimmer), and I _know_ can be
done in Nano (as I've done it).

In vim, you can either select the range visually and use

 :'<,'>w tempfile.txt
(in visual mode, typing ":" automatically adds the "'<,'>" range
for you)

or specifying the endpoints such as

  :13,27w tempfile.txt

to write lines 13-27 to the tempfile.txt.  Those ranges can be of
arbitrary complexity using relative positioning, searching,
absolute line numbers, and marked locations, so it's very powerful.

In Nano, if you've selected a range of lines using control+^ you
can use control-O to write those lines to a file.

To read that tempfile back in, in Vim you can use

  :r tempfile.txt

or in Nano, you can use control+R.

For reading and writing excerpts in Emacs, I can't be of much
help, but perhaps others can.


Hope this helps, even if it doesn't directly answer your question
about brltty, as screen/emacs/vim/nano/tempfiles should all work
fine under brltty.

-tim





More information about the Blinux-list mailing list