Manuel Ortega <[email protected]> wrote: > On Sun, Jul 24, 2016 at 9:02 AM, Bram Moolenaar <[email protected]> wrote: > > " For all text files set 'textwidth' to 78 characters. > > autocmd FileType text setlocal textwidth=78 > Please don't "setlocal" a &textwidth value for text files. Don't mess > with this at all, but if you do, don't make it "setlocal". It is > extremely annoying to have Vim sometimes hard-wrap lines and sometimes > not, depending on which kind of file you're in---unless one specifically > authorized this by purposely turning filetype plugins on or having a > plugin/package that does this for certain &filetype.
Using :autocmd FileType sets a bad precedent: this doesn't scale (one autocmd per filetype and setting is too much and bloats the .vimrc), and Vim has a much better mechanism for filetype-specific settings: ftplugins (with :filetype plugin on). This way, the change is also undone (through b:undo_ftplugin), if the user manually changes the filetype. With regards to the 'textwidth' setting: I would recommend to leave this out, as there's no generally accepted notion of a "text" file; hard-wrapping may be desired or not, so it's best to leave this up to the user. -- regards, ingo -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature
