|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 2 | +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 3 | + |
| 4 | +<html xmlns="http://www.w3.org/1999/xhtml" lang="zh" xml:lang="zh"> |
| 5 | +<head> |
| 6 | + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 7 | + <link rel="stylesheet" type="text/css" href="learn-vi.css" /> |
| 8 | + <title>VIM学习笔记 标签页面板(Tabpanel)</title> |
| 9 | +</head> |
| 10 | +<body> |
| 11 | + <h1>VIM学习笔记 标签页面板(Tabpanel)</h1> |
| 12 | + <p>在<a href="https://github.com/vim/vim/commit/be5bd4d6292fddcc103091407792730aaa48cc48">patch 9.1.1391</a>中,Vim引入了新的UI元素标签页面板(<a href="https://vimhelp.org/tabpage.txt.html#tabpanel">tabpanel</a>),是在窗口边上显示标签页标签的垂直侧边栏。</p> |
| 13 | + |
| 14 | + <h2 class="article"><a id="opt-showtabpanel">显示/隐藏标签页面板</a></h2> |
| 15 | + <p>通过设置showtabpanel选项,可以选择显示或隐藏标签页面板。默认情况下,showtabpanel缺省值为0,将不显示标签页面板。</p> |
| 16 | + <p>使用以下命令,将始终显示标签页面板:</p> |
| 17 | + <p style="text-indent:2em"><code class="inset">:set showtabpanel=2</code></p> |
| 18 | + <p>使用以下命令,将在至少有两个标签页时才会显示标签页面板:</p> |
| 19 | + <p style="text-indent:2em"><code class="inset">:set showtabpanel=1</code></p> |
| 20 | + <p>使用以下命令,将关闭标签页面板:</p> |
| 21 | + <p style="text-indent:2em"><code class="inset">:set showtabpanel=0</code></p> |
| 22 | + |
| 23 | + <h2 class="article"><a id="opt-tabpanelopt">标签页面板选项</a></h2> |
| 24 | + <p>通过设置tabpanelopt选项,可以定义标签页面板的其它选项:</p> |
| 25 | + <ul> |
| 26 | + <li>align,决定标签页面板显示在窗口的左侧或右侧;</li> |
| 27 | + <li>columns,指定标签页面板的宽度;</li> |
| 28 | + <li>vert,指定标签页面板和窗口显示部分间是否显示垂直分割符。</li> |
| 29 | + </ul> |
| 30 | + <p>使用以下命令,将在屏幕左侧显示宽度为15的标签页面板:</p> |
| 31 | + <p style="text-indent:2em"><code class="inset">:set tabpanelopt=vert,align:left,columns:15</code></p> |
| 32 | + <p>通过设置fillchars选项,可以定义标签页面板的垂直分隔符:</p> |
| 33 | + <p style="text-indent:2em"><code class="inset">:set fillchars+=tpl_vert:\|</code></p> |
| 34 | + |
| 35 | + <h2 class="article"><a id="tpl-highlight">标签面板配色方案</a></h2> |
| 36 | + <p>默认情况下,gVim使用GUI风格的配色方案:</p> |
| 37 | + <p><a href="https://yyq123.github.io/learn-vim/images/guioptions-e.png" title="guioptions+e"><img src="https://yyq123.github.io/learn-vim/images/guioptions-e.png" alt="guioptions+e" /></a></p> |
| 38 | + <p>使用以下命令,可以设置gVim的<a href="http://yyq123.github.io/learn-vim/learn-vi-15-Tabs.html" title="Tabs">标签页</a>(tabline)和标签面板(tabpanel)都使用现有的<a href="https://tinyurl.com/vim-ColorScheme" title="Color Scheme">配色方案</a>:</p> |
| 39 | + <p style="text-indent:2em"><code class="inset">:set guioptions-=e</code></p> |
| 40 | + <p><a href="https://yyq123.github.io/learn-vim/images/guioptions--e.png.png" title="guioptions-e"><img src="https://yyq123.github.io/learn-vim/images/guioptions--e.png" alt="guioptions-e" /></a></p> |
| 41 | + <p>将以下代码添加到vimrc启动文件中,可以进一步定制标签页和标签面板的配色:</p> |
| 42 | + <pre class="block">hi TabLine guifg=#c5c8c6 guibg=#303030 gui=none ctermfg=254 ctermbg=236 cterm=none |
| 43 | +hi TabLineSel guifg=#c5c8c6 guibg=#1d1f21 gui=bold ctermfg=254 ctermbg=236 cterm=bold |
| 44 | +hi TabLineFill guifg=#c5c8c6 guibg=#303030 gui=none ctermfg=254 ctermbg=236 cterm=none |
| 45 | +hi VertSplit guifg=#3a3a3a guibg=#1d1f21 gui=none ctermfg=254 ctermbg=236 cterm=none</pre> |
| 46 | + <p>由于Tabpanel相关高亮组已经默认链接至Tabline,所以只需要定义Tabline相关高亮组即可:</p> |
| 47 | + <p><a href="https://yyq123.github.io/learn-vim/images/tabpanel_highlight_group_link.png" title="tabpanel_highlight_group_link"><img src="https://yyq123.github.io/learn-vim/images/tabpanel_highlight_group_link.png" alt="tabpanel_highlight_group_link" /></a></p> |
| 48 | + <h2 class="article"><a id=""></a></h2> |
| 49 | + <p></p> |
| 50 | + <a href="#" title=""></a> |
| 51 | + |
| 52 | + <p></p> |
| 53 | + <p style="text-indent:2em"><code class="inset"></code></p> |
| 54 | + |
| 55 | + <p><a href="https://yyq123.github.io/learn-vim/images/.png" title=""><img src="https://yyq123.github.io/learn-vim/images/.png" alt="" width="500" height="" /></a></p> |
| 56 | + |
| 57 | + <p style="color:gray; font-size:0.6em"><a href="http://yyq123.github.io/learn-vim/images/.png" title=""><img src="http://yyq123.github.io/learn-vim/images/.png" alt="" /></a></br>Source: medium.com/free-code-camp</p> |
| 58 | + |
| 59 | + <pre class="block"> |
| 60 | + </pre> |
| 61 | + |
| 62 | + <ul> |
| 63 | + <li><p class="item"><br /></p></li> |
| 64 | + <li><p class="item"><a href="#" title=""></a><br /></p></li> |
| 65 | + </ul> |
| 66 | + |
| 67 | + <span style="font-weight:bold; color:#4169E1; margin-left:0.2em">?</span> |
| 68 | + |
| 69 | + <table summary="Commands" border="1" frame="border" rules="all" cellspacing="0" cellpadding="3"> |
| 70 | + <caption style="margin:0.5em; font-weight:bold">选项列表</caption> |
| 71 | + <thead> |
| 72 | + <tr><th style="white-space: nowrap">选项</th><th>描述</th><th>帮助信息</th></tr> |
| 73 | + </thead> |
| 74 | + <tbody> |
| 75 | + <tr><td><code class="inset">!</code></td><td>如果包含,表示。例如,。</td><td style="white-space: nowrap"><code class="inset">:help viminfo-!</code></td></tr> |
| 76 | + </tbody> |
| 77 | + </table> |
| 78 | + |
| 79 | + <table summary="Commands" border="2" frame="hsides" rules="all" cellspacing="0" cellpadding="3"> |
| 80 | + <caption>命令小结</caption> |
| 81 | + <tbody> |
| 82 | + <tr><td><code class="inset">:</code></td><td rowspan="2"></td></tr> |
| 83 | + <tr><td><code class="inset">:</code></td></tr> |
| 84 | + <tr><td><code class="inset">:</code></td><td></td></tr> |
| 85 | + <tr><td><code class="inset">:</code></td><td></td></tr> |
| 86 | + <tr><td><code class="inset">:</code></td><td></td></tr> |
| 87 | + </tbody> |
| 88 | + </table> |
| 89 | +“” |
| 90 | + |
| 91 | + <p style="border-top:1px solid lightgray"><span style="float:right">Ver: 2.0 | <a href="mailto:yyq123@gmail.com">YYQ</a></span><span><<a title="" href="http://yyq123.github.io/learn-vim/.html">上一篇</a> |<a title="笔记列表" href="http://yyq123.github.com/learn-vim/learn-vi-00-00-TOC.html"> 目录 </a>| <a title="" href="http://yyq123.github.io/learn-vim/.html">下一篇</a>></span></p> |
| 92 | + |
| 93 | +</body> |
| 94 | +</html> |
0 commit comments