Hacker News new | ask | show | jobs
by boken 3918 days ago
Hard wrapping may be an elegant solution on the runtime configuration side, but it is frequently to blame for inelegance when editing. Hard-wrapped text must be manually reformatted for display when (1) changing terminal or window size, (2) vertically splitting panes, (3) opening a file on a different monitor. Hard-wrapped text must also be manually reformatted after many editing tasks: new lines, far shorter in length than the textwidth of the paragraph as a whole, sit in the middle of old ones that wrapped naturally, while some old lines teeter out into your wrap margin (and off of your display) after text was inserted into their middles.

This solution, meanwhile, is far from inelegant:

  nnoremap g gj
  nnoremap k gk
That's it, once and done. Aside from setting your wrap preferences—which you would have had to do anyway with hard wraps—there's no more to be taken care of. The text will always display fluently and in full, and you will have no need to manually reformat your paragraphs using gqap whenever you make a change to them. All that need concern you is the text, not its line-by-line arrangement.

(I do agree that vim-pencil is unnecessary, at least if you're only going to use one scheme for wrapping.)