Take vim-plug for example:
Plug 'sainnhe/vim-color-forest-night'
For better syntax highlighting support, please install sheerun/vim-polyglot.
- Clone this repository.
- Copy
/path/to/vim-color-forest-night/colors/forest-night.vim
to~/.vim/colors/forest-night.vim
- 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
- 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
There are some packages available for Arch Linux users in AUR:
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
.
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
To enable airline color scheme, put this in your vimrc:
let g:airline_theme = 'forest_night'
To apply it without reloading:
:AirlineTheme forest_night
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()
Check this gist.
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
: if0
, do not use italic; if1
, use italic. Default:1
g:forest_night_transp_bg
: if1
, use terminal background color; if0
, use original background color of forest-night. Default:0
Q: It doesn't work as expected.
A:
-
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
-
If the color still cannot displayed properly, check output of
vim --version
, maybe your vim doesn't supporttermguicolors
-
Maybe your terminal emulator doesn't support true colors, you can test it using this script
-
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?
-
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.
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 :)
@ekomizer: simple terminal support
@JarrettAzar: iterm2 support
@termlimit: airline support