def uninstall_janus():
    '''Remove all janus files and dirs and (try to) restore previous vim config.
    '''
    if exists('~/.vim/janus'):
        run('rm -rf ~/.vim', msg='delete janus repo dir')
        with warn_only():
            run('rm -rf ~/.janus', msg='delete ~/.janus dir')
            run('bash -c "rm ~/.{,g}vimrc{,.before,.after}"',
                msg='delete ~/.vimrc, ~/.vimrc.before, ~/.vimrc.after, '
                    '~/.gvimrc, ~/.gvimrc.before and ~/.gvimrc.after')
            if exists('~/.vim.old'):
                run('mv ~/.vim.old  ~/.vim', msg='restore ~/.vim dir')
            for fname in ['~/.vimrc', '~/.gvimrc']:
                if exists(flo('{fname}.old')):
                    run(flo('mv {fname}.old  {fname}'),
                        msg=flo('restore {fname}'))
        run('ls -hal ~/.*vim*', msg='\nvim config restored:')
    else:
        print_msg('janus is not installed; nothing to do (abort)')
        exit(1)
def uninstall_janus ( ) : if exists ( '~/.vim/janus' ) : run ( 'rm -rf ~/.vim' , msg = 'delete janus repo dir' ) with warn_only ( ) : run ( 'rm -rf ~/.janus' , msg = 'delete ~/.janus dir' ) run ( 'bash -c "rm ~/.{,g}vimrc{,.before,.after}"' , msg = 'delete ~/.vimrc, ~/.vimrc.before, ~/.vimrc.after, ' '~/.gvimrc, ~/.gvimrc.before and ~/.gvimrc.after' ) if exists ( '~/.vim.old' ) : run ( 'mv ~/.vim.old  ~/.vim' , msg = 'restore ~/.vim dir' ) for fname in [ '~/.vimrc' , '~/.gvimrc' ] : if exists ( flo ( '{fname}.old' ) ) : run ( flo ( 'mv {fname}.old  {fname}' ) , msg = flo ( 'restore {fname}' ) ) run ( 'ls -hal ~/.*vim*' , msg = '\nvim config restored:' ) else : print_msg ( 'janus is not installed; nothing to do (abort)' ) exit ( 1 )
Remove all janus files and dirs and (try to) restore previous vim config.