gerardbm / vim-atomic

Atomic color scheme for Vim, Neovim and Gvim
https://github.com/gerardbm/atomic
MIT License
16 stars 1 forks source link
colorscheme palette vim

Atomic for Vim/Neovim

Vim-atomic is a dark & light color scheme designed to use on vim, gvim and neovim. It consists of 16 colors selected procedurally (algorithms) and it's part of a bigger project: Atomic, which also includes themes and color schemes for terminals (URxvt, XTerm) and some terminal programs (tmux, zsh, irssi, cmus).

Atomic Space Screenshot

Atomic Night Screenshot

Atomic Light Screenshot

Testing dark modes in vim

Atomic has support for 8, 16 and 256 colors, and True Color (24 bits) on the last versions of vim, gvim, neovim and nvim-qt. It uses the setting termguicolors properly (some color schemes don't).

It also includes 7 modes of color (6 darks and 1 light):

Each mode has 3 contrasts:

Installation

Manual installation

  1. Copy the file atomic.vim to your ~/.vim/colors/ directory (for vim) or ~/.config/nvim/colors/ directory (for neovim).
$ cd vim-atomic
$ cp atomic.vim ~/.vim/colors/

Using a plugin manager (i.e., vim-plug)

  1. Paste this in your .vimrc file:
    Plug 'gerardbm/vim-atomic'
  2. Reload your settings and install it:
    :source $MYVIMRC
    :PlugInstall

Modify your .vimrc

  1. Set the colorscheme in your .vimrc configuration file:
    syntax enable
    colorscheme atomic

Configuration

Color support

If your terminal does not support True color, you can take a look at the main Atomic repository to see if Atomic colors are available for your terminal and how to install them.

If your terminal supports True color (1), you can enable it configuring your ~/.vimrc file with the setting set termguicolors (2) before the color scheme definition (colorscheme atomic).


  1. See https://gist.github.com/XVilka/8346728 for a list of terminals that support True color.

  2. Sometimes setting termguicolors is not enough and one has to set the t_8f and t_8b options explicitly, also before the color scheme definition:

if has("termguicolors")
    let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
    let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
    set termguicolors
endif

Use it when $TERM is not xterm, for example, running vim into tmux or using a terminal with different $TERM, like st case.

More info, see :h xterm-true-color.

Color palettes

If your terminal have True color support or if you are using a GUI (like gvim or nvim-qt), you have the following commands to switch between the different color palettes:

Use one of them after the color scheme definition in your ~/.vimrc or ~/.gvimrc.

Switch them automatically depending on the current time. For example, if you would like to use the AtomicLightHC between 8 am and 8 pm and switch to AtomicNightHC at night, simply paste this in your ~/.vimrc or ~/.gvimrc:

function! AtomicSwitcher()
    if (strftime('%H') > 8) && (strftime('%H') < 20)
        AtomicLightHC
    else
        AtomicNightHC
    endif
endfunction

Alternatively, you can cycle them (from 1 to 21) with a shortcut (for example: Shift+F9). Paste this in your ~/.vimrc or ~/.gvimrc:

nnoremap <S-F9> :call CycleModes()<CR>:colorscheme atomic<CR>

Emphasis

Some terminals don't handle italics correctly, so in case you need to disable italics set let g:atomic_italic=0 in your ~/.vimrc, before the color scheme definition.

Full list of options to disable italic text, bold, underline and undercurl:

let g:atomic_italic = 0
let g:atomic_bold = 0
let g:atomic_underline = 0
let g:atomic_undercurl = 0

If this options are not defined, default value is 1 for all of them.

MatchParen highlight

By default, Atomic will use an orange color to highlight the background for MatchParen. To use the orange color for the foreground instead, use the following option:

let g:atomic_matchparen = 0

As with emphasis cases, add this to your ~/.vimrc, before the color scheme definition.

Example configuration

if has("termguicolors")
    let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
    let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
    set termguicolors
endif

syntax enable

let g:atomic_italic = 0
colorscheme atomic
AtomicNightMC