Wow, that did the trick somehow. Using "h,c,cpp" as the file pattern works, but not "*.h,*.c,*.cpp" as per the examples in the docs, and as I've been using for years up till now.
Why? Is this only required for FileType and not BufRead? And won't "h,c,cpp" match ANY file containing a "c" or an "h"? Surely there's something wrong here. Rob. On Tue, 26 Mar 2019 at 00:35, Christian Brabandt <cbli...@256bit.org> wrote: > > On Di, 26 Mär 2019, Robert Webb wrote: > > > On Fri, 15 Mar 2019 at 02:44, Gary Johnson <garyj...@spocom.com> wrote: > > > > On 2019-03-14, Robert Webb wrote: > > > Ah, thanks Gary, > > > > > > Actually I already set 'fo' in my vimrc, but I set it with > "autocmd BufRead". > > > I suppose the file-type commands happen after that? > > > > Yes. The BufRead and BufNewFile events trigger the FileType event > > through the autocommands in $VIMRUNTIME/filetype.vim and the > > FileType event triggers the sourcing of the filetype plugin(s) via > > $VIMRUNTIME/ftplugin.vim. So, it's also important that the FileType > > autocommand in your vimrc follow the ":filetype on" (or equivalent) > > command so that your FileType autocommand command is executed after > > filetype plugins are sourced. > > > > > > Actually I have no idea what happened, but it's not working again. My > 'fo' is being set to 2croql again for C++ files, even though I am > overriding it in my _vimrc. > > > > It works if I use "autocmd FileType * set fo=2crq" > > But NOT if I use "autocmd FileType *.h set fo=2crq" > > > > Same if I use setlocal, or both set and setlocal. > > > > Why would it work for all files with "*" but not just for header files > with "*.h"? > > I suppose the filetype for header files does not match *.h? I guess you > rather want something along > > autocmd FileType c,cpp setl fo=2crq > > Best, > Christian > -- > Sprächen die Menschen nur von Dingen, von denen sie etwas verstehen, > die Stille wäre unerträglich. > -- Johannes B. Kerner > (Marc-Uwe Kling: Falsch zugeordnete Zitate; eigentlich Albert Einstein) > > -- > -- > 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 vim_dev+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- -- 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 vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.