Skip to content

Srcery is a dark color scheme with clearly defined contrasting colors and a slightly earthy tone.

License

Notifications You must be signed in to change notification settings

srcery-colors/srcery-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Srcery is a color scheme with clearly defined contrasting colors and a slightly earthy tone.

Table of content

Requirements

GUI

You don’t need to do anything for this colorscheme to work in gVim or MacVim.

TUI

To use Srcery in the terminal you need to change your terminal emulator’s so-called “ASCII” colors to the ones in the table below. There's a list of terminal configurations in the srcery-terminal repository.

IMG TERMCOL NR VAR HEX RGB HSL
black black 0 g:srcery_black #1C1B19 28, 27, 25 40, 6%, 10%
red red 1 g:srcery_red #EF2F27 239, 47, 39 2, 86%, 55%
green green 2 g:srcery_green #519F50 81, 159, 80 119, 33%, 47%
yellow yellow 3 g:srcery_yellow #FBB829 251, 184, 41 41, 96%, 57%
blue blue 4 g:srcery_blue #2C78BF 44, 120, 191 209, 63%, 46%
magenta magenta 5 g:srcery_magenta #E02C6D 224, 44, 109 338, 74%, 53%
cyan cyan 6 g:srcery_cyan #0AAEB3 10, 174, 179 182, 89%, 37%
white white 7 g:srcery_white #BAA67F 186, 166, 127 40, 30%, 61%
brightblack brightblack 8 g:srcery_bright_black #918175 145, 129, 117 26, 11%, 51%
brightred brightred 9 g:srcery_bright_red #F75341 247, 83, 65 6, 92%, 61%
brightgreen brightgreen 10 g:srcery_bright_green #98BC37 152, 188, 55 76, 55%, 48%
brightyellow brightyellow 11 g:srcery_bright_yellow #FED06E 254, 208, 110 41, 99%, 71%
brightblue brightblue 12 g:srcery_bright_blue #68A8E4 104, 168, 228 209, 70%, 65%
brightmagenta brightmagenta 13 g:srcery_bright_magenta #FF5C8F 255, 92, 143 341, 100%, 68%
brightcyan brightcyan 14 g:srcery_bright_cyan #2BE4D0 43, 228, 208 174, 77%, 53%
brightwhite brightwhite 15 g:srcery_bright_white #FCE8C3 252, 232, 195 39, 90%, 88%

Additionally Srcery uses some xterm 256 colors to pad out the color selection, no extra configuration needed.

IMG NAME NR VAR HEX RGB HSL
orange orange 202 g:srcery_orange, g:srcery_orange_cterm #FF5F00 255, 95, 0 22, 100%, 50%
bright_orange bright_orange 208 g:srcery_bright_orange, g:srcery_bright_orange_cterm #FF8700 255, 135, 0 32, 100%, 50%
hard_black hard_black 233 g:srcery_hard_black, g:srcery_hard_black_cterm #121212 18, 18, 18 0, 0%, 7%
xgray1 xgray1 235 g:srcery_xgray1, g:srcery_xgray1_cterm #262626 38, 38, 38 0, 0%, 15%
xgray2 xgray2 236 g:srcery_xgray2, g:srcery_xgray2_cterm #303030 48, 48, 48 0, 0%, 19%
xgray3 xgray3 237 g:srcery_xgray3, g:srcery_xgray3_cterm #3A3A3A 58, 58, 58 0, 0%, 23%
xgray4 xgray4 238 g:srcery_xgray4, g:srcery_xgray4_cterm #444444 68, 68, 68 0, 0%, 27%
xgray5 xgray5 239 g:srcery_xgray5, g:srcery_xgray5_cterm #4E4E4E 78, 78, 78 0, 0%, 31%
xgray6 xgray6 240 g:srcery_xgray6, g:srcery_xgray6_cterm #585858 88, 88, 88 0, 0%, 35%

Installation

Manually

Download or clone srcery's repository to a location of your choosing and set your runtimepath correctly, otherwise srcery will not work as it relies on the autoload functionality.

You can also install with your favourite plugin manager.

Vim 8

Vim 8 has native support for loading plugins by using packages. All you need to do to, is to clone this repository into ~/.vim/pack/themes/opt.

git clone https://github.com/srcery-colors/srcery-vim ~/.vim/pack/themes/opt/srcery-vim

And then set your .vimrc accordingly.

packadd! srcery-vim
colorscheme srcery

The same works for Neovim, but you have to clone it into a path where Neovim can find it.

git clone https://github.com/srcery-colors/srcery-vim $XDG_CONFIG_HOME/nvim/pack/themes/opt
call dein#add('srcery-colors/srcery-vim')
cd ~/.vim/bundle
git clone https://github.com/srcery-colors/srcery-vim
Plug 'srcery-colors/srcery-vim'
  use {'srcery-colors/srcery-vim', as = 'srcery'}

Usage

:color srcery

If you like what you see and decide to make srcery your default colorscheme, add the relevant line to your .vimrc:

colorscheme srcery

Configuration

Srcery includes a few toggles due to discrepancies in the various setups possible. To change any of these you'd put something like this in your .vimrc

let g:srcery_italic = 1

Make sure that you set these variables before assigning colorscheme.

Colors

You can customize each of Srcery's colors, to customize say the red color:

let g:srcery_red = '#FF0000'

Inside a 256-color terminal emulator, additional colors are configurable via setting the corresponding variable with the _cterm suffix, e.g.

let g:srcery_hard_black_cterm = 232

Refer to the table for a full list of color variables, hexes and more.

This will only work on set termguicolors and in gVim, to override terminal colors, do so in your terminal configuration.

Options

g:srcery_bold

Enables bold text.

Default: 1

g:srcery_italic

Enables italic text.

Default: gui 1, term 0

g:srcery_underline

Enables underlined text.

Default: 1

g:srcery_undercurl

Enables undercurled text.

Default: 1

g:srcery_strikethrough

Enables strikethrough text.

Default: 1

g:srcery_inverse

Enable or disable inverse highlighting (foreground becomes background, vice versa). This is used for visual selection, search highlights and some other things.

Srcery will fall back to other methods of highlighting if this is disabled.

Default: 1

g:srcery_inverse_matches

Highlight search matches using inverse colors.

Default: 0

g:srcery_inverse_match_paren

When enabled will highlight matching delimiters using inverse colors. (:DoMatchParen)

Works best with Rainbow parenthesis.

Default: 0

g:srcery_dim_lisp_paren

Dims lisp dialects delimiters to a fairly dark gray (xgray5 specifically).

Default: 0

g:srcery_guisp_fallback

Sets up alternate highlighting for colored underline/undercurl. Some environments are unable to color underline, so this setting will set either the background or foreground to whatever color the underline is supposed to be.

This comes in handy if colored underline doesn't work, or underline is disabled entirely.

Default: 'NONE'

Possible Values: 'fg', 'bg'

g:srcery_italic_types

Italicize types if italic is enabled.

Default: 0

g:srcery_bg

Let's you customize the background color. This var takes a list with two values, with a quoted HEX in the first position, and a terminal color index for the second position. This lets you set both a 24-bit color, and a 8bit terminal color index.

You can specify 'NONE' as one of the values to make it transparent, as such ['NONE', 'NONE'] would be the same as the previous option g:srcery_bg_passthrough = 1.

You can specify 'DEFAULT' as one of the values in order to use that position's default value.

Default: [g:srcery_black, 0]

g:srcery_hard_black_terminal_bg

If enabled, will set the terminal background in vim to hard black. Note that this currently only works in Vim, not Neovim.

Default: 1

Screenshots

viml, bash viml_bash

clojure, elisp lisp

c, rust c_rust

python, js py_js

git, terminal git_term

Typeface used in screenshots is Iosevka

Plugin support

Lightline

lightline

Lightline colorscheme. To use it, include 'srcery' value in lightline configuration, like so:

let g:lightline = {
      \ 'colorscheme': 'srcery',
      \ }

Lualine

Lualine colorscheme. It's the same as Lightline's. Enable it in your configuration:

require('lualine').setup {
  options = {
    theme = 'srcery',
  },
}

Airline

airline

Thanks to MindTooth, Srcery now includes an Airline theme.

Other

These don't require any additional configuration.

Plugin support is still a work in progress and more will come, if there is anything missing that you'd like to add please open an issue and let me know.

Attribution

This project started as essentially a palette swap of Gruvbox and all credit goes to the maintainers of that fantastic color scheme. I wanted something a bit sharper, but I loved the syntax color choices of Gruvbox. I also tried to make the theme as simple to use as possible, which was inspired by Flattened. Other themes that influenced Srcery:

Troubleshooting

Colors don't look right

Ensure that 256 colors are enabled in vim by setting this option before setting the colorscheme.

set t_Co=256

24-bit color, tmux and Neovim

If you want to use GUI colors in terminal make sure that tmux pass through 24-bit color codes. For example, if you use Termite add it to the terminal overrides setting:

set -ga terminal-overrides ",xterm-termite:Tc"

For other terminals, replace xterm-termite with the relevant terminal type. (stored in $TERM).

See Arch wiki and this issue.

Extra

Emacs

Check out srcery-emacs