Sunday, September 28, 2014

Re: How to make a local option global?

On Sunday, September 28, 2014 10:53:48 AM UTC-5, andalou wrote:
> I'm using vim 7.4.461 on Windows.
>
> How can I make an option global for the current session?
>
> For example, I notices that comments is set as a local option. How can I
>
> make it global when editing a bunch of files?
>
>

You can't. Local options only apply to single buffers/windows.

But some local options have a "global" value that is used for any new buffers. If you use :set instead of :setlocal you will also set the global default value.

Some other options are global-local. Using :set instead of :setlocal on these means that unless you override the option with :setlocal, the buffer will use the global version.

Some options have their values set to sensible defaults in a filetype plugin.

If you have more details on what you're trying to do (what kinds of files, which options) maybe there is more help. Most likely you want to either set up an autocmd to set the option for a certain filetype, or you want to use :bufdo, :windo, or :argdo to set an option on every file you already have open, or you need to set some default value in your .vimrc to use for all new buffers.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment