Emulate a small bit of readline behavior.

    Returns:
        (bool) True if current user enabled vi mode ("set editing-mode vi") in .inputrc

def _inputrc_enables_vi_mode():
    '''
    Emulate a small bit of readline behavior.

    Returns:
        (bool) True if current user enabled vi mode ("set editing-mode vi") in .inputrc
    '''
    for filepath in (os.path.expanduser('~/.inputrc'), '/etc/inputrc'):
        try:
            with open(filepath) as f:
                for line in f:
                    if _setre.fullmatch(line):
                        return True
        except IOError:
            continue
    return False