[ale] vim set list not showing special characters seen with cat -vt
Ed Cashin
ecashin at noserose.net
Fri Jun 2 15:26:30 EDT 2017
Lately vim seems too smart for its own good.
I installed ed to work with special characters lately, and it shows them as
a sequence of bytes. I thought that "-C" would cause vim to show a
sequence of bytes in compatibility mode, but it still shows a spade in the
example below.
Often, "sed -l filename" is handy. It uses the same "l" command for
"listing" that ed supports. Note the "1l" command below, which means, "Go
to line one and print a listing."
bash$ python3 -c "print('\u2660')" > spade.txt
bash$ vi !$
vi spade.txt
bash$ vi -C spade.txt
bash$ ed !$
ed spade.txt
4
1l
\342\231\240$
q
bash$
On Fri, Jun 2, 2017 at 3:01 PM, Lightner, Jeffrey <JLightner at dsservices.com>
wrote:
> The internet has a thousand posts saying “:set list” will show hidden
> characters.
>
>
>
> However that is NOT showing characters I know to be in the file:
>
>
>
> If I do a “cat” with no flags on a file it contains a line (obfuscated to
> protect the guilty) like this:
>
> ORDER_HEADER|OBFUSCATE|###########|##########|USD|OBFUSCATE|AA||OBFUSCATE|####
> OBFUSCATE PARKWAY|OFUSCATE ### SUITE ###||ATLANTA|GA|#####|###|######|
> USER at ADDRESS.COM|FIRST LAST |### OBFUSCATE PLACE ||CITY||ST|US||#####|###
> #######|USER at ANOTHERADDRESS.COM
>
>
>
> The key field being:
> |### OBFUSCATE PLACE |
>
>
>
> If I run “cat –vt” on the file to show special characters and tabs I can
> see that field actually has extra hidden characters in it:
> |### OBFUSCATE PLACEM-BM- |
>
>
>
> If I do vim of the file the field appears as it did in cat without the
> “-vt” flags.
>
>
>
> If I do “:set list” it shows me other characters (e.g. $ for each end of
> line) but does NOT show the extra characters seen for the above field that
> I see with “cat –vt”).
>
>
>
> How do I get vim to show the same characters in the field that I see with
> “cat –vt”?
>
>
>
> When I ran “file” on this file it says it is “UTF-8 Unicode text” whereas
> usually files of this type (without the special characters) simply show
> they are “ASCII text”. Presumably it is the special characters in this
> one that make it appear as UTF-8. Doing :set options to change encoding
> to utf8 does NOT show the characters either.
>
>
>
>
>
> CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential
> information and is for the sole use of the intended recipient(s). If you
> are not the intended recipient, any disclosure, copying, distribution, or
> use of the contents of this information is prohibited and may be unlawful.
> If you have received this electronic transmission in error, please reply
> immediately to the sender that you have received the message in error, and
> delete it. Thank you
>
>
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>
--
Ed Cashin <ecashin at noserose.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20170602/2918f81b/attachment.html>
More information about the Ale
mailing list