Wednesday, May 9, 2012

Re: Does "set guitablabel" require scripting? (Virtually all examples seem to imply that it does…)

On Tuesday, May 8, 2012 6:32:27 PM UTC-5, sfosparky wrote:
> I've been trying to figure out how to change how Vim labels tabs. Everywhere I turn for information contains Vim script examples. This has led me to believe that "set guitablabel" can only be used via scripts(?)
>
> At present, Vim labels tabs with a file name prefaced with a "path code" of the form "\P\M\M\F\R\F\R\T", where each character is the first character of a folder name on the path. Ugh!
>
> In an effort to get rid of the path info, I tried using (without the quotation marks) ":set guitabel=%t" This has no effect.
>

I assume you mean 'guitablabel' instead of 'guitabel'. Are you using GUI Vim with GUI tabs enabled? See :help 'guitablabel' for the requirements, and also for details in setting it.

You don't NEED to write any script to use guitablabel or tabline options, it is just more powerful if you do. Nevertheless, you can achieve a simple tab label using only format strings like %N, %t, etc. See:

http://vim.wikia.com/wiki/Show_tab_number_in_your_tab_line

The comments section at the bottom contains a simple example without any scripting, even though the tip itself contains a lot of script. Also see :help setting-guitablabel, which includes this:


A simple example that puts the tab page number and the buffer name in the
label:
:set guitablabel=%N\ %f

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: