/vim-color-forest-night

🌲 Comfortable & Pleasant Color Scheme for Vim, Zsh and Terminal Emulators

Primary LanguageVim scriptMIT LicenseMIT

Installation

Via Plugin Manager

Take vim-plug for example:

Plug 'sainnhe/vim-color-forest-night'

For better syntax highlighting support, please install sheerun/vim-polyglot.

Manually

  1. Clone this repository.
  2. Copy /path/to/vim-color-forest-night/colors/forest-night.vim to ~/.vim/colors/forest-night.vim
  3. To install airline theme, copy /path/to/vim-color-forest-night/autoload/airline/themes/forest_night.vim to ~/.vim/autoload/airline/themes/forest_night.vim
  4. To install lightline theme, copy /path/to/vim-color-forest-night/autoload/lightline/colorscheme/forest_night.vim to ~/.vim/autoload/lightline/colorscheme/forest_night.vim

AUR

There are some packages available for Arch Linux users in AUR:

Usage

I've developed another version of this color scheme -- forest-dusk

The only difference between forest-night and forest-dusk is that the color temperature of forest-dusk is lower.

forest-dusk is designed to use without redshift/f.lux, but you may not be satisfied with the temperature. I would recommend to use forest-night with redshift/f.lux, you can adjust the color temperature by yourself in this way.

To use forest-dusk instead of forest-night, replace night in the following steps with dusk.

Vim

Put this in your vimrc:

colorscheme forest-night

If you want to apply this color scheme temporarily, run this command in vim:

:colorscheme forest-night

Airline

To enable airline color scheme, put this in your vimrc:

let g:airline_theme = 'forest_night'

To apply it without reloading:

:AirlineTheme forest_night

Lightline

To enable lightline color scheme, put this in your vimrc:

let g:lightline = {}
let g:lightline.colorscheme = 'forest_night'

" or this line
let g:lightline = {'colorscheme' : 'forest_night'}

To apply it without reloading:

:let g:lightline.colorscheme = 'forest_night'
:call lightline#init()
:call lightline#colorscheme()

Tmux Status Line

Check this gist.

Zsh

Terminal Emulators

Xresources

README.md

Customization

Note: forest-night and forest-dusk share the same global variables, you don't need to replace night with dusk.

  • g:forest_night_use_italic: if 0, do not use italic; if 1, use italic. Default: 1
  • g:forest_night_transp_bg: if 1, use terminal background color; if 0, use original background color of forest-night. Default: 0

FAQ

Q: It doesn't work as expected.

A:

  1. Although this color scheme works very well without termguicolors, if you want to make it look the same as the screenshot, you need to enable it: :set termguicolors

  2. If the color still cannot displayed properly, check output of vim --version, maybe your vim doesn't support termguicolors

  3. Maybe your terminal emulator doesn't support true colors, you can test it using this script

  4. If you are running vim in tmux, you need to override default true colors of tmux, as tmux cannot display true color properly: #1246 How to use true colors in vim under tmux?

  5. There are many highlight group links in syntax files while a color scheme may change them, enabling one color scheme based on another color scheme enabled is very likely to cause color broken. If there is any color broken, you can enable the color scheme in your vimrc instead of after vim startup.

Q: What's your status line configuration?

A: check this gist.

Contribution

This color scheme is generated by lifepillar/vim-colortemplate. To hack it, install this plugin and edit templates/forest_night.colortemplate, then rebuild the color scheme.

I've optimized some common file types, but they may not be accurate enough, and some highlight groups may be illogical. Feel free to open a PR if you want to optimize a file type or a plugin :)

Thanks to

@ekomizer: simple terminal support

@JarrettAzar: iterm2 support

@termlimit: airline support

Inspirations

rhysd/vim-color-spring-night

KKPMW/sacredforest-vim

License

MIT && Anti-996