切换vim中的空白屏幕,透过透明窗口查看 [英] Toggle a blank screen in vim, to see through transparent window

查看:245
本文介绍了切换vim中的空白屏幕,透过透明窗口查看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Vim(不是GVim或MacVim等),我使用了一个不透明的终端,所以我可以看到我的背景(这是 this movement cheat-sheet

I work in Vim(not GVim, or MacVim etc), and I've taken use a non-opaque terminal, so I can see my background behind it(which is this movement cheat-sheet)

我想要一种方法,使vim的实例是一个空白屏幕,然后能够重新绘制它像以前一样。也许我只是在网络搜索失败,但我找不到任何东西,这个问题。

I'd like a way, to make the instance of vim a blank screen, then be able to re-draw it as it was before. Maybe I'm just failing at my web-searching, but I can't find anything towards this issue.

我非常感谢任何东西,甚至只是一个链接到一些可以让我从兔子洞里开始的文档方法。

I'm more than grateful for anything, even just a link to some documentation method that can get me started down the rabbit hole.

推荐答案

片断,相关问题,以及来自@Ken和@Prince Goulash的帮助。下面是我的.vimrc中的vimscript的功能:

I've achieved my Desired effect through bits and pieces, a related question, and help from @Ken and @Prince Goulash. Here's the functioning piece of vimscript that is in my .vimrc:

function! TabIsEmpty()
    " From Stackoverflow: http://stackoverflow.com/a/5026456/212307
    " Remember which window we're in at the moment
    let initial_win_num = winnr()

    let win_count = 0
    " Add the length of the file name on to count:
    " this will be 0 if there is no file name
    windo let win_count += len(expand('%'))

    " Go back to the initial window
    exe initial_win_num . "wincmd w"

    " Check count
    if win_count == 0
        " Tab page is empty
        return 1
    else
        return 0
    endif

endfunction
function! ToggleBlankTab()
    if TabIsEmpty() == 1
        tabc
    else
        tabe
    endif
endfunction
nnoremap <leader>m :call ToggleBlankTab()<cr>

这篇关于切换vim中的空白屏幕,透过透明窗口查看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆