Smart Wrap in Vim

This feature has been implemented on June 25, 2014 as patch 7.4.338. There followed a few patches refining the feature, last one being 7.4.354, so that’s the version you’ll want. :help breakindent :help breakindentopt Excerpts from vim help below: ‘breakindent’ ‘bri’ boolean (default off) local to window {not in Vi} {not available when compiled without … Read more

How can I wrap text in a label using WPF?

The Label control doesn’t directly support text wrapping in WPF. You should use a TextBlock instead. (Of course, you can place the TextBlock inside of a Label control, if you wish.) Sample code: <TextBlock TextWrapping=”WrapWithOverflow”> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec adipiscing nulla quis libero egestas lobortis. Duis blandit imperdiet ornare. Nulla … Read more

Wrap Text In JavaScript

Although this question is quite old, many solutions provided so far are more complicated and expensive than necessary, as user2257198 pointed out – This is completely solvable with a short one-line regular expression. However I found some issues with his solution including: wrapping after the max width rather than before, breaking on chars not explicitly … Read more

UILabel: wrap and/or break inside word(s) with hyphen(s)

Elaborating on Matt’s answer here: https://stackoverflow.com/a/16502598/196358 it can be done using NSAttributedString and NSParagraphStyle. See below: NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle.hyphenationFactor = 1.0f; NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:titleString attributes:@{ NSParagraphStyleAttributeName : paragraphStyle }]; self.titleLabel.attributedText = attributedString; This will cause the label to break at logical places mid-word using hyphens. It looks great, … Read more