Sometimes setting 'termguicolors' is not enough and one has to set the t_8f and t_8b options explicitly. Default values of these options are "^[[38;2;%lu;%lu;%lum" and "^[[48;2;%lu;%lu;%lum" respectively, but it is only set when $TERM is xterm. Some terminals accept the same sequences, but with all semicolons replaced by colons (this is actually more compatible, but less widely supported): let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum" let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum" (出典:VIM REFERENCE MANUAL)
init.vimに以下を設定します。
set termguicolors
let &t_8f = "\<Esc>[38:2:%lu:%lu:%lum"
let &t_8b = "\<Esc>[48:2:%lu:%lu:%lum"
~/.tmux.confに以下を設定します。
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
これで綺麗に表示されました。