I understand that VIM makes a difference between set
and setl
in that the first one sets an option for all buffers while the latter one sets the option fur the current buffer only. This is evident if I have do a :set tw=80
as opposed to a :setl tw=80
.
Now, when I do a :set ft=plsql
, it only opperates on the current buffer although I did not do a setl
. This, of course, makes sense. Yet, I fail to see if this is documented somewhere. So, the question probably boils down to: are there options that by default operate on the current buffer while others operate "everywhere" and where is that documented?
There are indeed options that operate on the current buffer (and indeed the current window in some cases). The documentation is with the documentation for the option. If you go to any option in :help option-list
, it will have one of the following three strings as the third-ish line:
global
local to window
local to buffer
(or some combination of them). For example, :help 'ft'
gives:
*'filetype'* *'ft'*
'filetype' 'ft' string (default: "")
local to buffer
{not in Vi}
{not available when compiled without the |+autocmd|
feature}
When this option is set, the FileType autocommand event is triggered.
All autocommands that match with the value of this option will be
executed. Thus the value of 'filetype' is used in place of the file
name.
So this option is local to the buffer. For more discussion, see:
:help option-summary
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With