【问题标题】:vim:how to set taglist and nerdtree at one vertical split screenvim:如何在一个垂直分屏上设置 taglist 和 nerdtree
【发布时间】:2015-11-29 14:35:30
【问题描述】:

如图,我想你能理解我。我尝试为 taglist 设置 .vimrc:

let Tlist_Use_Horiz_Window=1

let Tlist_Use_Right_Window = 1

当然可以。

我尝试 C+W + H|J|K|L,再次失败...

谁熟悉vim,请帮助我。

【问题讨论】:

    标签: vim nerdtree taglist


    【解决方案1】:

    有一个 vim 插件'winmanager'。它可以像您的描述一样设置布局。有很多博客介绍如何使用 NERDTree 和 taglist/tagbar 设置它。好吧,还有一些抱怨 winmanager 没有得到很好的维护。有时需要修改源代码才能使用 NERDTree。

    我建议你先试试 winmanager。如果它不起作用,您可以尝试我的愚蠢但有用的解决方法:

    function! ToggleNerdtreeTagbar()
    
        " check if NERDTree and Tagbar are opened
        let NERDTree_close = (bufwinnr('NERD_tree') == -1) 
        let Tagbar_close   = (bufwinnr('__Tagbar__') == -1) 
    
        TagbarToggle
        NERDTreeToggle
    
        if NERDTree_close && Tagbar_close
            wincmd K
            wincmd b
            wincmd L
            wincmd h
            exe 'vertical resize 30'
        endif
    
    endfunction
    nmap <C-e> :call ToggleNerdtreeTagbar()<CR>
    

    如果 1) taglist 或 tagbar 在左侧,2) 你一开始只打开一个窗口,然后按 CTRL-e,这将起作用。然后你可以打开其他窗口。

    【讨论】:

    • 谢谢你的回答,我知道有winmanage。我搜索了它,得到了很多有用的信息!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-14
    • 1970-01-01
    相关资源
    最近更新 更多