Skip to content

Commit

Permalink
Update instructions for setting termguicolors
Browse files Browse the repository at this point in the history
  • Loading branch information
yous committed Feb 27, 2019
1 parent b06a240 commit 6eef190
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,25 @@ Conversion from original colors to 256 colors has done according to
## Usage

1. Check your terminal.
- If your terminal emulator supports 24-bit color, add the following lines
to your `.vimrc`.
- If your terminal emulator [supports true colors](https://gist.github.com/XVilka/8346728),
add the following lines to your `.vimrc`.

``` vim
" Use 24-bit (true-color) mode in Vim/Neovim when outside tmux or screen.
" If you're using tmux version 2.2 or later, you can remove the outermost $TMUX
" check and use tmux's 24-bit color support
" (<http://sunaku.github.io/tmux-24bit-color.html#usage> for more information.)
" (http://sunaku.github.io/tmux-24bit-color.html#usage for more information.)
if empty($TMUX) && empty($STY)
if has('nvim')
" For Neovim 0.1.3 and 0.1.4 <https://github.com/neovim/neovim/pull/2198>
let $NVIM_TUI_ENABLE_TRUE_COLOR = 1
endif
" For Neovim > 0.1.5 and Vim > patch 7.4.1799
" <https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162>
" Based on Vim patch 7.4.1770 (`guicolors` option)
" <https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd>
" <https://github.com/neovim/neovim/wiki/Following-HEAD#20160511>
if has('termguicolors')
set termguicolors
" See https://gist.github.com/XVilka/8346728.
if $COLORTERM =~# 'truecolor' || $COLORTERM =~# '24bit'
if has('termguicolors')
" See :help xterm-true-color
if $TERM =~# '^screen'
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
set termguicolors
endif
endif
endif
```
Expand Down

0 comments on commit 6eef190

Please sign in to comment.