Hard wrapping not working for ft=mail
I don't know what I'm doing wrong here. Maybe I misunderstand the readme. I have the following in my .vimrc
augroup pencil
autocmd!
autocmd FileType text call pencil#init()
autocmd FileType mail call pencil#init({'wrap': 'hard', 'textwidth': '72'})
autocmd FileType markdown call pencil#init()
augroup END
Nonetheless, if I start writing an email with ft=mail textwidth remains 0. As I got it from the readme, even without enforcing both wrap and textwidth I should get textwidth set -- doesn't work either.
If I verbose set tw? it says that it got loaded from pencil but it 0. On the contrary, if I do :HardPencil everything works as expected.
Any help appreciated.
Sorry for the delay. Try the 'textwidth':'72' without the quotes around 72.
No problem! I tried it without the quotes but I still get tw=0. My workaround is to start vim with vim -c 'set tw=72' from mutt.
So I assume that vim-pencil should auto-detect hard wrapping automatically now. If you want to you can close this, but I'm also open for more suggestions/debugging. :-)
Well, I just realised that pencil isn't loaded at all. It only loads if I invoke it with :Pencil. Some ideas why that's the case?
It will work if I invoke vim the following way:
vim -c "set ft=mail tw=72"
If the filetype is 'mail', the autocmd statement should be firing, but isn't. I'm not sure why.
Is it initializing via the autocmd for markdown?
I realise this is an old issue, but I seem to be having the same problem (only for md, not for mail). @niklaas did you solve it?
@rvodden I'm sorry but I stopped using vim-pencil. I switched to vim-pandoc some months ago.