vim-pencil icon indicating copy to clipboard operation
vim-pencil copied to clipboard

Hard wrapping not working for ft=mail

Open niklaas opened this issue 9 years ago • 7 comments

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.

niklaas avatar May 07 '16 05:05 niklaas

Sorry for the delay. Try the 'textwidth':'72' without the quotes around 72.

reedes avatar May 22 '16 00:05 reedes

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. :-)

niklaas avatar May 23 '16 03:05 niklaas

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?

niklaas avatar May 23 '16 05:05 niklaas

It will work if I invoke vim the following way:

vim -c "set ft=mail tw=72"

niklaas avatar May 25 '16 09:05 niklaas

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?

reedes avatar Jun 08 '16 01:06 reedes

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 avatar Dec 14 '17 22:12 rvodden

@rvodden I'm sorry but I stopped using vim-pencil. I switched to vim-pandoc some months ago.

niklaas avatar Dec 17 '17 20:12 niklaas