I'm learning ipython for data analysis and I'd like to use Sublime text, my favorite text editor. However, I'm having a problem with "CR", carriage return, being output instead of the original "stuff" I want to display. This makes copying/pasting to another location a hassle because I'll have to manually delete those characters. It's also frustrating to look at.
Here's an example from the textbook I'm using:
Running the same command in terminal and it works fine
Although it displays properly in terminal, I really would like to use a REPL in sublime because of the helpful plugins such as autocomplete and code intelligence. I've tried changing the user settings default_line_ending but nothing helped. If someone knows how to get rid of those carriage returns or at least hide them from the output, I'd be very happy.
Thank you
If your terminal supports it, you can try the following command to remove the existing CRs:
sed -i 's/\r//g' FileWithCarriageReturns.foo
sed is a stream editing command which when executed as above, will search through the specified 'FileWithCarriageReturns.sh' and remove all carriage returns (seen as \r ) from the file
Once you've done that, go into your Sublime Text settings and override the default line ending property to be 'unix' :
{ "default_line_ending" : "unix" }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With