'Map keys and create autocommands that should only be defined when a
snippet is active.'

def _setup_inner_state(self):

    if self._inner_state_up:
        return
    if (self.expand_trigger != self.forward_trigger):
        _vim.command((('inoremap    <buffer>    <silent>    ' + self.forward_trigger) + '    <C-R>=UltiSnips#JumpForwards()<cr>'))
        _vim.command((('snoremap    <buffer>    <silent>    ' + self.forward_trigger) + '    <Esc>:call    UltiSnips#JumpForwards()<cr>'))
    _vim.command((('inoremap    <buffer>    <silent>    ' + self.backward_trigger) + '    <C-R>=UltiSnips#JumpBackwards()<cr>'))
    _vim.command((('snoremap    <buffer>    <silent>    ' + self.backward_trigger) + '    <Esc>:call    UltiSnips#JumpBackwards()<cr>'))
    _vim.command('augroup    UltiSnips')
    _vim.command('autocmd!')
    _vim.command('autocmd    CursorMovedI    *    call    UltiSnips#CursorMoved()')
    _vim.command('autocmd    CursorMoved    *    call    UltiSnips#CursorMoved()')
    _vim.command('autocmd    InsertLeave    *    call    UltiSnips#LeavingInsertMode()')
    _vim.command('autocmd    BufLeave    *    call    UltiSnips#LeavingBuffer()')
    _vim.command('autocmd    CmdwinEnter    *    call    UltiSnips#LeavingBuffer()')
    _vim.command('autocmd    CmdwinLeave    *    call    UltiSnips#LeavingBuffer()')
    _vim.command('autocmd    Filetype    unite    call    UltiSnips#LeavingBuffer()')
    _vim.command('augroup    END')
    _vim.command('silent    doautocmd    <nomodeline>    User    UltiSnipsEnterFirstSnippet')
    self._inner_state_up = True
