tags:

views:

53

answers:

2

I can get the vim title to display on my window by doing this:

let &titlestring = expand("%:t") . " @ " . hostname()
if &term == "screen"
  set t_ts=^[k
  set t_fs=^[\
endif
if &term == "screen" || &term == "xterm"
  set title
endif

But the tabs will say "Default".

From the commandline I can do this:

echo -ne "\e]1;hello world\a"

And that'll show "Hello World" in my tabs.

Is there a way to have vim write this stuff to my tab instead of title instead?

A: 

I don't have iTerm, so I can't test this, but try adding this to your .vimrc:

set t_ts=^[]1;
set t_fs=^G

Type CTRL-V Escape for ^[ and CTRL-V CTRL-G for ^G.

Laurence Gonsalves
works beautifully.
dd
A: 

Where do you drop this code?

Stirman
In your .vimrc file.
dd