[TxMt] Re: Convert CRLF to LF

Carpii UK carpii.uk at gmail.com
Mon Sep 29 23:26:01 UTC 2014


Hi Steven, thanks for the reply

I do understand I can convert it interactively, I was just looking for a
one-shot key combo really.

I can also convert them all en-masse via a quick bash loop, but doing this
creates a few problems in git, since any historic branches suddenly
conflict when I later merge them (and because all the line endings have
changed, the whole file is different rather than just blocks of code)

For this reason I prefer to just deal with them on a case by case basis as
I encounter them

Cheers
Paul

On 30 September 2014 00:13, Steven Clukey <saclukey at live.com> wrote:

> Paul,
>
> You can just use find and replace on \r in regular expression mode. Or
> control+option+enter will create a CR so you can use that in the find and
> replace as well. You can run find and replace on the entire project folder
> to get rid of all of them.
>
> Steven
>
>
> On Sep 29, 2014, at 2:35 PM, Carpii UK <carpii.uk at gmail.com> wrote:
>
> Hi René,
>
> Awesome, thanks so much for taking the time to create this!
>
> I didn't realise you could add new menu items with a simple bash scripts
> like that (Ive looked at bundles in the past but they were hard to
> decipher).
>
> One question.. The bundle works from the saved file (and so any unsaved
> changes you've made since are not passed to tr).
> Likewise the bundle cannot run on a unsaved buffer.
>
> I wonder if there's a way around that?
> Its not an issue for your bundle as I can just save it, but would be
> useful to know for the future
>
> Thanks
> Paul
>
>
>
>
>
>
> On 29 September 2014 17:52, sanssecours <sanssecours at f-m.fm> wrote:
>
>> Carpii UK wrote
>> > Thanks, I was a paid up BBEdit user before I moved to TM2, but it fell
>> out
>> > of favour after a few bugs (one of them was due to mismatched line
>> endings
>> > funnily enough, it would often misreport line numbers)
>> >
>> > Im able to do it in TM by using Text -> Filter Through Command
>> >
>> > But a specific bundle item would be nice so I could assign a key combo
>> and
>> > bypass the dialog (which often has other commands Ive used in it)
>> >
>> >
>> >
>> > On 29 September 2014 16:37, Matt Neuburg <
>>
>> > matt@
>>
>> > > wrote:
>> >
>> >>
>> >> On Sep 29, 2014, at 5:26 AM, Carpii UK <
>>
>> > carpii.uk@
>>
>> > > wrote:
>> >>
>> >> > Is there an existing bundle item which will strip the
>> > <CR>
>> >  and make the
>> >> full file LF consistent?
>> >> >
>> >>
>> >> I use BBEdit (or its free little brother TextWrangler) for this. With
>> >> BBEdit you can just create a text engine that batch-processes your
>> files.
>> >> m.
>> >>
>> >> --
>> >> matt neuburg, phd = http://www.apeth.net/matt/
>> >> pantes anthropoi tou eidenai oregontai phusei
>> >> Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do
>> >> iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do
>> >> RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> textmate mailing list
>> >>
>>
>> > textmate at .macromates
>>
>> >> http://lists.macromates.com/listinfo/textmate
>> >>
>> >
>> >
>> > _______________________________________________
>> > textmate mailing list
>>
>> > textmate at .macromates
>>
>> > http://lists.macromates.com/listinfo/textmate
>>
>> Hi Carpii and Matt,
>>
>> I just quickly created a bundle item for the task you asked, Carpii. It
>> uses
>> `tr` to delete all carriage returns from your current document. Just press
>> `^⌥⌘-R` to use the command on the current file. I hope you like it. If
>> not,
>> just leave a reply with your suggestions to make the command better, and I
>> will try to incorporate them.
>>
>> Kind regards,
>>    René
>>
>> Carpii.zip <http://textmate.1073791.n5.nabble.com/file/n28290/Carpii.zip>
>>
>>
>>
>> --
>> View this message in context:
>> http://textmate.1073791.n5.nabble.com/Convert-CRLF-to-LF-tp28286p28290.html
>> Sent from the textmate users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> textmate mailing list
>> textmate at lists.macromates.com
>> http://lists.macromates.com/listinfo/textmate
>>
>
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>
>
>
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20140930/714deac6/attachment-0001.html>


More information about the textmate mailing list