1

To set a tmux title in vim, you can do something like:

if hastmux == 'true' || &term == "screen" || &term == "screen-256color"
  set t_ts=^[]0;
  set t_fs=^G
endif

However, to update the window name, you need

if hastmux == 'true' || &term == "screen" || &term == "screen-256color"
  set t_ts=^[k
  set t_fs=^G
endif

Is there a way to specify two t_ts, or rather, to chain two ANSI codes together? I haven't found one yet.

Mike Dacre
  • 677
  • 8
  • 26

1 Answers1

2

You cannot have 2 t_ts, of course, but you can achieve what you want making vim and tmux cooperate. Let vim set the title in tmux and let tmux set the title in window. In vim:

set t_ts=^[k
set t_fs=^G

See https://stackoverflow.com/a/37127709/7976758

In tmux:

set -g set-titles on
set -g set-titles-string '#S:#I.#P #T'
setw -g automatic-rename

See https://superuser.com/a/430840

phd
  • 69,888
  • 11
  • 97
  • 133