We’re rewarding the question askers & reputations are being recalculated! Read more.
2

There are a couple of ways to approach this, however each one has its own drawbacks: There is no really good way to re-format a list of strings programmatically according to a different textwidth value. Your current best chances are basically to set the 'textwidth' option and reformat using gq (this can be done in another window to leave the current option ...


1

For the sake of completeness, I'd like to mention the plugin-based option. If you use something like ALE which supports running your buffers through a beautifier on save, you could let Prettier handle rewrapping your code. I accomplished that by putting this in ~/.vim/ftplugin/markdown.vim: let b:ale_fixers = ['prettier', 'remove_trailing_lines', '...


Only top voted, non community-wiki answers of a minimum length are eligible