vim-pandoc / vim-pandoc-legacy

[UNSUPPORTED/use vim-pandoc/vim-pandoc] vim bundle for pandoc users
143 stars 23 forks source link

auto word wrapping #47

Closed lukeorland closed 12 years ago

lukeorland commented 12 years ago

The vim-markdown plugin will automatically wrap at the column set with textwidth=80 (for example) during typing in insert mode. I can't figure out how to get vim-pandoc to work the same way. Am I doing something wrong, or should this be a feature request?

dsanson commented 12 years ago

Have you taken a look at :h pandoc-hard-wrapping and played around with g:pandoc_use_hard_wraps?

By default, the bundle assumes that you will be using soft wrapping, and applies

setlocal formatoptions=1

If you prefer hard wrapping, set g:pandoc_use_hard_wraps, i.e., put something like

let g:pandoc_use_hard_wraps = 1

in your vimrc. When that is set, the bundle instead sets

setlocal formatoptions=tn

If you also want autoformatting, set g:pandoc_auto_format:

let g:pandoc_auto_format = 1

in your vimrc. For more information, see |formatoptions|. (Note that autoformatting can slow things down.)

lukeorland commented 12 years ago

Yes setting those values as you recommend provides the functionality I was looking for, and it works really well. I should have RTFM'd first =) Thanks!