Skip to content

Commit

Permalink
Set terminal colors in Vim with termguicolors
Browse files Browse the repository at this point in the history
When the termguicolors setting is enabled, default ANSI colors are used
by default in Vim. Colors can be set similarly to neovim.
  • Loading branch information
rbong committed May 27, 2019
1 parent cb4e7a5 commit 5be6808
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions colors/gruvbox.vim
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,37 @@ if has('nvim')
let g:terminal_color_15 = s:fg1[0]
endif

" }}}
" Setup Terminal Colors For Vim with termguicolors: {{{

if exists('*term_setansicolors')
let g:terminal_ansi_colors = repeat([0], 16)

let g:terminal_ansi_colors[0] = s:bg0[0]
let g:terminal_ansi_colors[8] = s:gray[0]

let g:terminal_ansi_colors[1] = s:gb.neutral_red[0]
let g:terminal_ansi_colors[9] = s:red[0]

let g:terminal_ansi_colors[2] = s:gb.neutral_green[0]
let g:terminal_ansi_colors[10] = s:green[0]

let g:terminal_ansi_colors[3] = s:gb.neutral_yellow[0]
let g:terminal_ansi_colors[11] = s:yellow[0]

let g:terminal_ansi_colors[4] = s:gb.neutral_blue[0]
let g:terminal_ansi_colors[12] = s:blue[0]

let g:terminal_ansi_colors[5] = s:gb.neutral_purple[0]
let g:terminal_ansi_colors[13] = s:purple[0]

let g:terminal_ansi_colors[6] = s:gb.neutral_aqua[0]
let g:terminal_ansi_colors[14] = s:aqua[0]

let g:terminal_ansi_colors[7] = s:fg4[0]
let g:terminal_ansi_colors[15] = s:fg1[0]
endif

" }}}
" Overload Setting: {{{

Expand Down

0 comments on commit 5be6808

Please sign in to comment.