def set_generic_view_setting(view, name, value, opt, globally=False):
    if opt.scope == SCOPE_VI_VIEW:
        name = 'vintageous_' + name
    if not opt.parser:
        if not globally or (opt.scope not in (SCOPE_VI_VIEW, SCOPE_VI_WINDOW)):
            view.settings().set(name, value)
        else:
            prefs = sublime.load_settings('Preferences.sublime-settings')
            prefs.set(name, value)
            sublime.save_settings('Preferences.sublime-settings')
        return
    else:
        if not globally or (opt.scope not in (SCOPE_VI_VIEW, SCOPE_VI_WINDOW)):
            view.settings().set(name, opt.parser(value))
        else:
            name = 'vintageous_' + name
            prefs = sublime.load_settings('Preferences.sublime-settings')
            prefs.set(name, opt.parser(value))
            sublime.save_settings('Preferences.sublime-settings')
        return
    raise ValueError("Vintageous: bad option value")
dataset/ETHPy150Open guillermooo/Vintageous/vi/settings.py/set_generic_view_setting/original