fanglingsu / vimb

Vimb - the vim like browser is a webkit based web browser that behaves like the vimperator plugin for the firefox and usage paradigms from the great editor vim. The goal of vimb is to build a completely keyboard-driven, efficient and pleasurable browsing-experience.
https://fanglingsu.github.io/vimb/
GNU General Public License v3.0
1.34k stars 100 forks source link

Different setting scopes for :set varname& #124

Open fanglingsu opened 9 years ago

fanglingsu commented 9 years ago

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 commented 7 years ago

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