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.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
Mike D
  • 727
  • 2
  • 10
  • 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
  • 82,685
  • 13
  • 120
  • 165
  • Thanks, that works. I ended up doing essentially this in the end, with a few hacky modifications. – Mike D Mar 16 '18 at 18:14