vimscript t_ts 标题,使用两个转义码?

vimscript t_ts for title, use two escape codes?

要在 vim 中设置 tmux 标题,您可以这样做:

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

但是,要更新 window 名称,您需要

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

有没有办法指定两个 t_ts,或者更确切地说,将两个 ANSI 代码链接在一起?我还没找到。

当然不能有2个t_ts,但是vimtmux配合可以达到你想要的效果。让 vimtmux 中设置标题,让 tmux 在 window 中设置标题。在 vim:

set t_ts=^[k
set t_fs=^G

https://whosebug.com/a/37127709/7976758

tmux中:

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

https://superuser.com/a/430840