vimperator autohide statusline

前端 未结 1 1131
北海茫月
北海茫月 2021-02-10 07:17

Most of the time the Vimperator Statusline just sits there taking up space. Is there any way to autohide it so it only shows when I\'m using it?

  • main_coon and _lib
1条回答
  •  遥遥无期
    2021-02-10 07:42

    Based on http://blog.yjl.im/2011/07/toggling-vimperator-statusline.html

    "javascript to hide statusbar
    noremap   :js toggle_bottombar()
    noremap : :js toggle_bottombar('on'):
    noremap o :js toggle_bottombar('on')o
    noremap O :js toggle_bottombar('on')O
    noremap t :js toggle_bottombar('on')t
    noremap T :js toggle_bottombar('on')t
    noremap / :js toggle_bottombar('on')/
    cnoremap  :js toggle_bottombar('off')
    cnoremap  :js toggle_bottombar('off')
    
    :js << EOF
    function toggle_bottombar(p) {
        var bb = document.getElementById('liberator-bottombar');
        if (!bb)
            return;
        if (p == 'on'){
            bb.style.height = '';
            bb.style.overflow = '';
            return;
        }
        if (p == 'off'){
            bb.style.height = '0px';
            bb.style.overflow = 'hidden';
            return;
        }
        bb.style.height = (bb.style.height == '') ? '0px' : '';
        bb.style.overflow = (bb.style.height == '') ? '' : 'hidden';
    }
    toggle_bottombar();
    EOF
    

    0 讨论(0)
提交回复
热议问题