is it possible to create a line of text with vim which
do not contain any \n, \ra ?
Or in other words: The line should contain nothing
more than the visible chars.
I need this to generate test data for testing a VFD...
How can I accomplish this?
Thank you very much in advance for any help!
Best regards,
mcc
It is possible but definitely not recommended. You must
:setlocal binary noeol
in the file before writing it, and it must contain only the one line (it
is of course not possible to have any line other than the last one end
without an end-of-line mark).
See
:help 'binary'
:help 'eol'
Best regards,
Tony.
--
Behold the warranty ... the bold print giveth and the fine print taketh
away.
thank you very much. I intended to use this "hack" :) only for testing
purposes. I bought a wonderful rtro looking Flourescenz display (VFD)
and have to explore how to connect this to my embedded linux SOC.
I though "vim is useful for doing thing...one only has to know how..."
so asked how to create testdata to be fed into /dev/ttyS0. Only
the line break was not what I want.
Thanks to your help I now know how to avoid it.
And once again: One only needs vim...and a syste to run it. :)
Thank you very much!
Have a nice weekend!
Best regards,
mcc
head -c -1 </path/to/text/file >/dev/ttyS0
Personally, I'd prefer this approach over the 'binary' hack required to
make Vim do what you want, since 'binary' has other (probably undesired)
effects besides enabling you to omit the final newline.
> Hi,
>
> is it possible to create a line of text with vim which do not contain
> any \n, \ra ?
>
> Or in other words: The line should contain nothing more than the
> visible chars.
>
> I need this to generate test data for testing a VFD...
>
> How can I accomplish this?
You can use the 'binary' and (no)'eol' options.
'eol' tells Vim whether to include the final newline in the file. But,
'noeol' doesn't work unless 'binary' is also set.
vim -b +'se bin' filename.oneline
--
Best,
Ben
Whoops, braino:
vim -b +'se noeol' filename.oneline
--
Best,
Ben