我提供两个解决方案,第一个我检查自己,我可以保证它的工作。第二,我很快就要尝试。
第一个解决方案:通过创建文件夹〜/ .vim / plugin并将文件Tabmerge.vim下载到文件夹中来安装此插件 http://www.vim.org/scripts/script.php?script_id=1961。然后,当您有两个选项卡,并键入
第一个解决方案:通过创建文件夹〜/ .vim / plugin并将文件Tabmerge.vim下载到文件夹中来安装此插件 http://www.vim.org/scripts/script.php?script_id=1961。然后,当您有两个选项卡,并键入
- :Tabmerge
您将两个选项卡合并为一个,水平分割和顶部对齐。查看链接以查找完整的使用指南。
或者,检查这个页面http://vim.wikia.com/wiki/Move_current_window_between_tabs的两个功能的代码在标签之间移动当前窗口。这里的功能(我没有尝试):
- function MoveToPrevTab()
- "there is only one window
- if tabpagenr('$') == 1 && winnr('$') == 1
- return
- endif
- "preparing new window
- let l:tab_nr = tabpagenr('$')
- let l:cur_buf = bufnr('%')
- if tabpagenr() != 1
- close!
- if l:tab_nr == tabpagenr('$')
- tabprev
- endif
- sp
- else
- close!
- exe "0tabnew"
- endif
- "opening current buffer in new window
- exe "b".l:cur_buf
- endfunc
和
- function MoveToNextTab()
- "there is only one window
- if tabpagenr('$') == 1 && winnr('$') == 1
- return
- endif
- "preparing new window
- let l:tab_nr = tabpagenr('$')
- let l:cur_buf = bufnr('%')
- if tabpagenr() < tab_nr
- close!
- if l:tab_nr == tabpagenr('$')
- tabnext
- endif
- sp
- else
- close!
- tabnew
- endif
- "opening current buffer in new window
- exe "b".l:cur_buf
- endfunc