Skip to content

cterm or notermguicolors color consistency with base16-vim and base16colorspace condition #282

Open
@nlambert

Description

@nlambert

Hello, and thanks for all your work on this project.

Let me start with a light confession: between ANSI, OSC 4, GUI, termguicolors, 16-color, 256-color, and the ever-growing list of terminal emulators, I'm deep in shell shock.

That said, I've spent time digging into this, and while my experience is still fresh, I wanted to raise something that may be worth your attention.

According to the README:

Base16 is an extensive collection of colorschemes built on a common architecture by Chris Kempson. The base16_vim airline theme integrates with the base16-vim plugin (https://github.com/chriskempson/base16-vim) to match the currently selected colorscheme.

With that in mind, I noticed that the base16_nord.vim file under Airline does not seem to match the base16 architecture as implemented in base16-vim. Specifically, the ANSI cterm color assignments differ from what base16-vim uses for the same Nord theme.

Here's a snippet from the current Airline theme:

let s:cterm00 = 0
let s:cterm01 = 0
let s:cterm02 = 59
let s:cterm03 = 102
let s:cterm04 = 145
let s:cterm05 = 188
let s:cterm06 = 253
let s:cterm07 = 15
let s:cterm08 = 166
let s:cterm09 = 203
let s:cterm0A = 214
let s:cterm0B = 29
let s:cterm0C = 12
let s:cterm0D = 12
let s:cterm0E = 134
let s:cterm0F = 12

And here’s a corrected version based on the values used in the base16-vim Nord theme:

let s:cterm00 = 0
let s:cterm01 = 0
let s:cterm02 = 19
let s:cterm03 = 08
let s:cterm04 = 20
let s:cterm05 = 07
let s:cterm06 = 21
let s:cterm07 = 15
let s:cterm08 = 01
let s:cterm09 = 16
let s:cterm0A = 03
let s:cterm0B = 02
let s:cterm0C = 06
let s:cterm0D = 04
let s:cterm0E = 05
let s:cterm0F = 17

In addition to that mismatch, I also noticed that this theme does not check for the base16colorspace variable, which is part of the base16-vim plugin's strategy for supporting 16-color and 256-color terminals. Typically, the plugin uses:

if exists("base16colorspace") && base16colorspace == "256"
  " use extended ANSI values
endif

This logic is important for users who haven’t enabled termguicolors but are still using a 256-color terminal. Without it, the Airline theme may use hardcoded cterm values that don't match the base16-vim mappings, leading to inconsistent color schemes.

I realize many users rely on termguicolors (which makes this issue moot in practice), but given that this is a Base16 theme, it seems appropriate to support the full range of terminals—especially since the rest of the Base16 ecosystem does.

I also checked and noticed that monokai.vim under Airline might have the same issue, so other themes could be affected too.

Would a pull request that aligns the ANSI cterm values with the base16-vim theme and includes the base16colorspace conditional be appropriate?

Thanks again for your time and for maintaining the integration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions