'Returns the snippets that could be expanded to Vim as a global
variable.'

@err_to_scratch_buffer.wrap
def snippets_in_current_scope(self, searchAll):

    before = ('' if searchAll else _vim.buf.line_till_cursor)
    snippets = self._snips(before, True)
    snippets.sort(key=(lambda x: x.trigger))
    for snip in snippets:
        description = snip.description[((snip.description.find(snip.trigger) + len(snip.trigger)) + 2):]
        location = (snip.location if snip.location else '')
        key = as_unicode(snip.trigger)
        description = as_unicode(description)
        if (len(description) > 2):
            if ((description[0] == description[(-1)]) and (description[0] in '\'"')):
                description = description[1:(-1)]
        _vim.command(as_unicode("let    g:current_ulti_dict['{key}']    =    '{val}'").format(key=key.replace("'", "''"), val=description.replace("'", "''")))
        if searchAll:
            _vim.command(as_unicode("let    g:current_ulti_dict_info['{key}']    =    {{'description':    '{description}','location':    '{location}',}}").format(key=key.replace("'", "''"), location=location.replace("'", "''"), description=description.replace("'", "''")))
