autoload/splicelib/settings.py @ de5e5ed6c238 default tip

Phrasing
author Steve Losh <steve@stevelosh.com>
date Tue, 14 Jan 2020 19:44:43 -0500
parents 0013f7e01b6e
children (none)
import vim


def setting(name, default=None):
    full_name = 'g:splice_' + name

    if not int(vim.eval('exists("%s")' % full_name)):
        return default
    else:
        return vim.eval(full_name)

def boolsetting(name):
    if int(setting(name, 0)):
        return True
    else:
        False