Consider, for instance, the colorcolumn
option.
(Interestingly, the manual linked above refers to colorcolumn as a window-local option, but :setg colorcolumn=80
works as you would expect of a global-local option; does it mean that the man is wrong or am I misunderstanding the mechanics of global-local options?)
I'm trying to write some code that (intelligently) sets up a default colorcolumn
for each new or resized window. However, I'd like to disable this automatic handling if colorcolumn is set manually, for example in a FileType autocommand.
Is it possible to somehow detect if colorcolumn
was ever set locally for a given window, even if to the same value as the global one?
E.g. given this vimrc:
augroup filetypesettings
au!
au FileType help setlocal colorcolumn=
augroup END
I want to be able to distinguish a ft=help
buffer/window where this autocommand has executed from any other buffer/window where the default is used (even if the default is also empty). Is it possible?