On 2021-11-03 12:36, L A Walsh wrote:
> I wanted to write out an unclear character that my
> cursor was over, so I tried to go into character VISUAL
> selection mode by pressing Ctl-v, then ':w! /tmp/ch'.
> Instead of the single character at the cursor, I got
> the whole line. I also tried with a lower case 'v'.
The ex ":w" command is linewise, regardless of what visual-mode you
were in, so you'll get the whole line.
> How would I write out only the 1 character I had selected?
You might try yanking it and then using the writefile() command
:help writefile()
to write that register out to a file:
:call writefile(@", '/tmp/ch', 'b')
As a further alternative, you might investigate the "ga" &
"g8" commands
:help g8
:help ga
which will tell you further information about the particular
character under the cursor.
Hope this helps,
-tim