Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rhysd/vim-color-spring-night

Low-contrast calm color scheme for Vim
https://github.com/rhysd/vim-color-spring-night

blue colorscheme dark-theme vim vim-plugin

Last synced: 5 days ago
JSON representation

Low-contrast calm color scheme for Vim

Awesome Lists containing this project

README

        

Spring Night: Calm Spring Color Scheme for Vim
==============================================
[![CI status][]][CI]

[Spring Night color theme][repo] is a low contrast calm color scheme for Vim and Neovim.
It's colored with deep blue background, shiny yellow foreground and *sakura*:cherry_blossom:
text selection.

- Both GUI/CUI 24bit colors and CUI 256 colors.
- Aware of running Vim on translucent window.
- Enable to tweak contrast.
- Enable to opt out italic/bold decoration.
- Optimized for loading time by generating optimized script.
- Optimized for many filetypes.
- Support [vim-gitgutter][] and other several plugins.
- Support Neovim/Vim (8.0.1685 or later) terminal ANSI colors.
- Support Neovim float window colors.

## On gVim (MacVim)

| Vim script | Go |
|----------------------------------|--------------------------|
| ![Vim script on gVim (MacVim)][] | ![Go on gVim (MacVim)][] |

## On Translucent Terminal (24bit colors)

| Vim script | Go |
|--------------------------------------|------------------------------|
| ![Vim script on Vim (24bit color)][] | ![Go on Vim (24bit color)][] |

## On Translucent Terminal (8bit colors)

| Vim script | Go |
|-------------------------------------|-----------------------------|
| ![Vim script on Vim (8bit color)][] | ![Go on Vim (8bit color)][] |

If you want to see more code, please visit the [demo page site][demo].

## Installation

Copy `colors` directory into your `~/.vim` (or `~/vimfiles` on Windows) or use `:packadd` (Vim8)
or use your favorite plugin manager.

## Usage

Write the below line in your `.vimrc`.

```vim
colorscheme spring-night
```

If you use [vim-airline][], this plugin provides a theme for it.

```vim
let g:airline_theme = 'spring_night'
```

If you use [lightline.vim](https://github.com/itchyny/lightline.vim), this plugin provides a theme
for it.

```vim
let g:lightline.colorscheme = 'spring_night'
```

If you want to enable 24bit colors on Vim in a terminal window, you would need to set `termguicolors`
option. Please note that it requires an ISO-8613-3 compatible terminal.

```vim
" For Vim 7.4.1799 or later
if has('termguicolors')
let &t_8f = "\[38;2;%lu;%lu;%lum"
let &t_8b = "\[48;2;%lu;%lu;%lum"
set termguicolors
endif

" For Neovim 0.1.5 or later
set termguicolors
```

## Customization

This colorscheme provides some customization points. Please note that these variables must be
defined before running `:colorscheme` command.

### `g:spring_night_kill_italic`

Type: boolean

If `1`, this colorscheme does not use italic attributes. The default value is `0`.

### `g:spring_night_kill_bold`

Type: boolean

If `1`, this colorscheme does not use bold attribute. The default value is `0`.

### `g:spring_night_high_contrast`

Type: boolean

If `1`, it uses a bit high contrast colors. The default value depends on `termguicolors` option and
whether on GUI or CUI Vim is running.

### `g:spring_night_highlight_terminal`

Type: boolean

If `1`, a terminal window opened by `:terminal` command is also highlighted with this colorscheme.
Otherwise the default ANSI colors are used. The default value is `1`.

### `g:spring_night_cterm_italic`

Type: boolean

If `1`, italic font is enabled even in a terminal. This variable is useful when your terminal supports
italic fonts. The default value is `0`.

## Optimized Filetypes and Plugins

Color layouts are optimized for following filetypes/plugins:

- `c`
- `cpp`
- `diff`
- `gitcommit`
- `go`
- `help`
- `html`
- `javascript`
- `markdown`
- `ocaml`
- `python`
- `rst`
- `ruby`
- `rust`
- `toml`
- `tmux`
- `typescript` ([yats.vim][])
- `vim`
- `wast`
- `zig`
- `zsh`
- [ctrlp][]
- [vim-gitgutter][]
- [vim-easymotion][]
- [clever-f.vim][]
- [vimfiler.vim][]
- [ale][]
- [vim-highlightedyank][]
- [vim-indent-guides][]
- ... and more

## Optimized Loading Time

The colorscheme file is generated by [the script](gen/src/main.rs) being optimized for loading time
at Vim startup. In my environment, Vim loading time got 10x faster than before generating
colorscheme file.

## iTerm2 theme

This repository provides [iTerm2](https://iterm2.com/) theme of this colorscheme.

![iTerm2 theme](https://github.com/rhysd/ss/blob/master/vim-color-spring-night/iterm2.png?raw=true)

How to apply this theme:

1. Download [spring-night.itermcolors](./iterm2/spring-night.itermcolors)
2. Open iTerm2
3. 'Preferences' → 'Profiles' → 'Colors'
4. Click 'Colors Presets...' dropdown and select 'Import...'
5. Select the downloaded file at 1.
6. Click 'Colors Presets...' again
7. Select 'spring-night'

## Alacritty theme

This repository provides [Alacritty](https://alacritty.org/) theme of this colorscheme.

![Alacritty theme](https://github.com/rhysd/ss/blob/master/vim-color-spring-night/alacritty.png?raw=true)

How to apply this theme:

1. Download [spring_night.toml](./alacritty/spring_night.toml) to `~/.config/alacritty/theme/spring_night.toml`
2. Add the following configuration to `~/.config/alacritty/alacritty.toml`

```toml
[general]
import = [
"~/.config/alacritty/theme/spring_night.toml"
]
```

## Contributing to This Project

If you find some odd highlight, I'll be happy if you report it to
[issues](https://github.com/rhysd/vim-color-spring-night/issues/new) with how to reproduce it.
And pull requests are of course welcome :smile:.

The colorscheme file is generated by [the script](gen/src/main.rs). Please do not modify
`spring_night.vim` directly. Modify the script instead. Please read [the README for the script](gen/README.md)
for more details.

To know the color palette, please read the `Palette::default` method in the script.

## Bonus: Slack Theme

```
#132132,#3a4b5c,#fedf81,#132132,#8090a0,#fffeeb,#a9dd9d,#a9667a
```

## License

Licensed under the [MIT license](https://opensource.org/license/mit).

```
MIT License

Copyright (c) 2016 rhysd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```

[demo]: https://rhysd.github.io/vim-color-spring-night
[repo]: https://github.com/rhysd/vim-color-spring-night
[vim-airline]: https://github.com/vim-airline/vim-airline
[vim-gitgutter]: https://github.com/airblade/vim-gitgutter
[ctrlp]: https://github.com/ctrlpvim/ctrlp.vim
[vim-easymotion]: https://github.com/easymotion/vim-easymotion
[Vim script on gVim (MacVim)]: https://github.com/rhysd/ss/blob/master/vim-color-spring-night/gui-vim.jpg?raw=true
[Go on gVim (MacVim)]: https://github.com/rhysd/ss/blob/master/vim-color-spring-night/gui-go.jpg?raw=true
[Vim script on Vim (24bit color)]: https://github.com/rhysd/ss/blob/master/vim-color-spring-night/terminal-64bit-vim.jpg?raw=true
[Go on Vim (24bit color)]: https://github.com/rhysd/ss/blob/master/vim-color-spring-night/terminal-64bit-go.jpg?raw=true
[Vim script on Vim (8bit color)]: https://github.com/rhysd/ss/blob/master/vim-color-spring-night/terminal-8bit-vim.jpg?raw=true
[Go on Vim (8bit color)]: https://github.com/rhysd/ss/blob/master/vim-color-spring-night/terminal-8bit-go.jpg?raw=true
[clever-f.vim]: https://github.com/rhysd/clever-f.vim
[vimfiler.vim]: https://github.com/Shougo/vimfiler.vim
[ale]: https://github.com/w0rp/ale
[vim-highlightedyank]: https://github.com/machakann/vim-highlightedyank
[yats.vim]: https://github.com/HerringtonDarkholme/yats.vim
[vim-indent-guides]: https://github.com/preservim/vim-indent-guides
[CI status]: https://github.com/rhysd/vim-color-spring-night/actions/workflows/ci.yml/badge.svg
[CI]: https://github.com/rhysd/vim-color-spring-night/actions/workflows/ci.yml