Thomas wrote:
Hi,

I just realized that editing a directory removes t from &formatoptions. E.g.

set formatoptions+=rw
&fo = tcqrw
e Foo
&fo = tcqrw
e .
&fo = cqrw
e Bar
&fo = cqrw

This doesn't happen with the --noplugin switch so I'd assume that some standard vim plugin is causing this -- maybe netrw? Can somebody verify this?

Regards,
Thomas.



- AFAIK, "editibg a directory" requires the netrw plugin
- 'formatoptions' is local to buffer; if you specify neither ":setlocal fo?" not ":setglobal fo?", neither &l:fo nor &g:fo, what you get is the buffer-local copy, not the global default. - If the global default is modified too, then there could be a bug in netrw.vim (maybe changing via ":set" rather than ":setlocal" and later restoring only the local value, or not restoring at all).

Summary:
   :set fo?          " displays the local value
   :setl fo?         " displays the local value
   :setg fo?         " displays the global default
   :set fo-=t         " changes both local & global
   :setl fo-=t      " changes the local value only
   :setg fo-=t      "changes the global default only
   :let save_fo = &fo   " saves the local value only
   :let &fo = save_fo   " restores both local & global

See
   :h :set
   :h :setlocal
   :h :setglobal
   :h :let-option



Best regards,
Tony.

Reply via email to