[ubuntu-uk] SORTED: It's the simple things that baffle me...

Dave Walker DaveWalker at ubuntu.com
Tue Oct 2 15:52:40 BST 2007


Hi David,

Good to hear it's working, but the message you sent was as an attachment
"attachment.dat", i'm guessing that wasn't the intention?


Kind Regards,
Dave Walker

<Copied from attachment: attachment.dat>
Hi,

Thanks for the replies - I knew mutt and elm etc did the work - nail
does it too but it saves the messages as it receives them.  This means
that if I do :-

? s 5 message.txt

message.txt will be quoted-printable.  I was hoping that somebody would
already have experienced this problem and said "Oh yeah, in vim to clean
it up you need to do :!&(*^&**(<CR>.".

Alas no.  My kludge was to save the message, then do :-

sage% nail -f message.txt
? v
:wg message_clean.txt
? q

this created message_clean.txt which didn't have the quoted-printable
in it.

In the past I have used :%s/[=]20/ /g etc. to do the work.

Anyway, the answer is that it's not a built in feature of vim.  I ended
up adding a mapping to my .exrc file :-

map qd mn:%!perl -pe 's/\=([0-9A-Fa-f]{2})/chr(hex($1))/ge; s/\=\n//;''n

now if I simply type qd in command mode, it converts the whole file to
nice simple unquoted text.

This is what I have been after and unable to find.  The perl code was
found on one of the vim helper sites.  Once I had a better target to
punch into google, it was fairly straightforward.

Several years of irritation, gone in one afternoon :-)

Regards,



David
ubuntu/uk-2007-10-02.2.tx                                      ubuntu-uk
+----------------------------------------------------------------------------+
| Dave Restall, Computer Nerd, Cyclist, Radio Amateur G4FCU, Bodger
|
| Mob +44 (0) 7973 831245      Skype: dave.restall             Radio:
G4FCU  |
| email : dave at restall.net                     Web : Not Ready Yet :-(
|
+----------------------------------------------------------------------------+
| Sorry.  Nice try.
|
+----------------------------------------------------------------------------+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/ubuntu-uk/attachments/20071002/c04b0287/attachment.pgp 


More information about the ubuntu-uk mailing list