tag:blogger.com,1999:blog-6637736252081011583.post4010432299766017484..comments2023-10-23T11:13:47.199-07:00Comments on Daily Vim: Text Editor Tips, Tricks, Tutorials, and HOWTOs: Recursively Replace Ctrl-MTravis Whittonhttp://www.blogger.com/profile/14592647486468034166noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-6637736252081011583.post-39668071715431041962009-06-07T08:29:01.090-07:002009-06-07T08:29:01.090-07:00@casey
vimdiff?@casey<br /><br />vimdiff?Chrishttps://www.blogger.com/profile/08053614400760550597noreply@blogger.comtag:blogger.com,1999:blog-6637736252081011583.post-41745404542239260522009-06-05T08:00:48.444-07:002009-06-05T08:00:48.444-07:00To clarify what I'm trying to do, a script of ...To clarify what I'm trying to do, a script of mine needs to launch VIM and the vert diffs command.<br /><br />CaseyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6637736252081011583.post-55922789679184587052009-06-05T07:59:00.179-07:002009-06-05T07:59:00.179-07:00Off topic, but does anyone know how to pass an ex ...Off topic, but does anyone know how to pass an ex command to vim at startup?<br /><br />Thanks.<br /><br />CaseyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6637736252081011583.post-32275964988818652522009-06-05T02:47:07.297-07:002009-06-05T02:47:07.297-07:00Of course, the "-b" flag to diff may als...Of course, the "<b>-b</b>" flag to <b>diff</b> may also be of use. It'll ignore <i>all</i> differences in the amount of whitespace, so it'll typically only catch any significant differences (unless you're comparing Python code ;-)).Unknownhttps://www.blogger.com/profile/01913554727643078565noreply@blogger.comtag:blogger.com,1999:blog-6637736252081011583.post-64082415444376055762009-06-04T10:05:59.808-07:002009-06-04T10:05:59.808-07:00Oh yeah, and dos2unix is part of the 'tofrodos...Oh yeah, and dos2unix is part of the 'tofrodos' package, at least on debian/ubuntu.Bennoreply@blogger.comtag:blogger.com,1999:blog-6637736252081011583.post-90309797387109154992009-06-04T10:03:19.946-07:002009-06-04T10:03:19.946-07:00You could use find to do this, I think with
$ find...You could use find to do this, I think with<br />$ find /path/to/files -name "*.c" -exec dos2unix {} +<br /><br />See the manpage for find for complete details, but the -exec option here replaces {} with matched filenames and the '+' signifies that dos2unix can take multiple filenames. If it doesn't, replace '+' with '\;', backslash required so the semicolon is not interpreted by the shell.Bennoreply@blogger.comtag:blogger.com,1999:blog-6637736252081011583.post-90483436109384384182009-06-03T22:31:36.523-07:002009-06-03T22:31:36.523-07:00You can also get out some decent mileage out of do...You can also get out some decent mileage out of dos2unix -- no temp file needed, either. And the name is catchy. ;)Owen Raccugliahttps://www.blogger.com/profile/07496036807262777570noreply@blogger.comtag:blogger.com,1999:blog-6637736252081011583.post-33650235565481295852009-06-03T22:11:17.047-07:002009-06-03T22:11:17.047-07:00You can do this in place using gnu sed with the -i...You can do this in place using gnu sed with the -i option.<br /><br />for file in $(find /path -type f); do<br />sed -i 's/\r//g' $file; doneGabehttps://www.blogger.com/profile/06206599121628616871noreply@blogger.comtag:blogger.com,1999:blog-6637736252081011583.post-25053627092491914382009-06-03T19:33:27.098-07:002009-06-03T19:33:27.098-07:00In vi, you can strip out all \r's with :%s/^V^...In vi, you can strip out all \r's with :%s/^V^M//gBrian Masneyhttps://www.blogger.com/profile/08233923578049023466noreply@blogger.com