vimb icon indicating copy to clipboard operation
vimb copied to clipboard

Different setting scopes for :set varname&

Open fanglingsu opened this issue 11 years ago • 1 comments

The idea is to have different setting scopes, for example 'init', 'runtime'. The 'init' settings are those setting values that are set as default during compilation time, during startup from config file or as --cmd option. All the settings done during runtime of the user or by :autocmd could get into runtime scope. This would allow to change settings during runtime, mainly from inputbox and to switch the vlaues back to the init value. This is a little bit like in vim :set varname&. But in vim this set the compiles in default value where vimb should switch the value to what was given on startup.

This would allow to write :autocmd that properly reset changes values without to know the somewher else set initial value.

:augroup github
# restore the previous set values
:aucmd LoadCommited * set scripts&|set cookie-accept&
:aucmd LoadCommited http{s,}://github.com/* set scripts=on|set cookie-accept=origin
:augroup end

There is another issues that should be solved. If the autocmd like aboth is used, the user can't change the scripts and cookie-accept settings, because the values are changed back on each page load. Maybe it's a good choice to allow to toggle settings back to it's previous value.

fanglingsu avatar Oct 21 '14 15:10 fanglingsu

Depends on #356, without autocommands this might be useless.

fanglingsu avatar Jun 14 '17 22:06 fanglingsu