diff options
| author | nsfisis <nsfisis@gmail.com> | 2021-06-03 23:39:32 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2021-06-03 23:48:27 +0900 |
| commit | 4090b92ac461448c28cb903f685226fc9e0266d9 (patch) | |
| tree | 2205070d740dfb727efac084bf87ee744466fd7f | |
| parent | ae085f4db41fa36744f1776c2a4b7c5870fe4c6a (diff) | |
| download | dotfiles-4090b92ac461448c28cb903f685226fc9e0266d9.tar.gz dotfiles-4090b92ac461448c28cb903f685226fc9e0266d9.tar.zst dotfiles-4090b92ac461448c28cb903f685226fc9e0266d9.zip | |
Enable truecolor (24-bit color) in terminal
| -rw-r--r-- | .tmux.conf | 8 | ||||
| -rw-r--r-- | .vimrc | 6 | ||||
| -rw-r--r-- | .zshrc | 17 |
3 files changed, 27 insertions, 4 deletions
@@ -12,7 +12,13 @@ # BASICS {{{2 set-option -g base-index 1 set-option -g pane-base-index 1 -set-option -g default-shell /bin/zsh +set-option -g default-shell /usr/local/bin/zsh + +# TERMINAL FEATURES {{{2 +set-option -g default-terminal screen-256color +set-option -ga terminal-overrides ',xterm-256color:Tc' +set-option -ga terminal-overrides ',*:Smulx=\e[4::%p1%dm' +set-option -ga terminal-overrides ',*:Setulc=\e[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # APPEARANCE {{{2 set-option -g status-justify centre @@ -148,9 +148,9 @@ set hlsearch " .vimrc. nohlsearch if exists('+termguicolors') - if g:MY_ENV.os ==# 'mac' - set termguicolors - endif + let &t_8f="\<Esc>[38;2;%lu;%lu;%lum" + let &t_8b="\<Esc>[48;2;%lu;%lu;%lum" + set termguicolors endif set t_Co=256 set nocursorline @@ -313,6 +313,23 @@ function 256colors() { done } +function truecolors() { + awk 'BEGIN{ + s="/\\/\\/\\/\\/\\"; s=s s s s s s s s; + for (colnum = 0; colnum < 77; colnum++) { + r = 255 - (colnum * 255 / 76); + g = (colnum * 510 / 76); + b = (colnum * 255 / 76); + if (g > 255) + g = 510 - g; + printf "\033[48;2;%d;%d;%dm", r, g, b; + printf "\033[38;2;%d;%d;%dm", 255 - r, 255 - g, 255 - b; + printf "%s\033[0m", substr(s, colnum + 1, 1); + } + printf "\n"; + }' +} + # noxxx on => xxx off |
