moonfly is a dark color scheme for Vim and Neovim that has taken inspiration from:
Be aware, the moonfly color scheme does incrementally change from time to time, primarily with regard to language and plugin theming.
๐ I maintain another dark Vim theme named nightfly which may be of interest.
The font in use is Iosevka.
- All Neovim Treesitter highlighted-languages
- C/C++
- Clojure
- CoffeeScript
- Crystal
- Elixir
- Elm
- Dart
- Go
- Haskell
- Java
- JavaScript
- Lua
- Markdown
- PHP
- PureScript
- Python
- Ruby
- Rust
- Scala
- Shell
- TypeScript
- ALE
- barbar.nvim
- BufExplorer
- clever-f
- CtrlP
- fern.vim
- fzf.vim
- GitGutter
- indentLine (please set
let g:indentLine_setColors = 0
in your vimrc) - Neomake
- NERDTree
- Signify
- Tagbar
- vimfiler
Use your favoured plugin manager to install bluz71/vim-moonfly-colors then set the colorscheme in your vimrc file.
If using vim-plug do the following:
- Add
Plug 'bluz71/vim-moonfly-colors'
to your vimrc - Run
:PlugInstall
- Add
colorscheme moonfly
to your vimrc, make sure this line appears after the Plug declaration.
The moonfly color scheme supports lightline.vim. To enable the moonfly lightline colorscheme, after the lightline.vim plugin has been installed, please add the following to your vimrc:
let g:lightline = { 'colorscheme': 'moonfly' }
The moonfly color scheme also supports vim-airline. With modern versions of vim-airline the moonfly theme will be automatically loaded.
Alternatively, vim-moonfly-statusline, is available for those that just want a simple yet informative moonfly themed status line.
The g:moonflyCursorColor
option specifies whether to color the cursor or not.
By default the cursor will NOT be colored. If you prefer a colored cursor
then add the following to your vimrc:
let g:moonflyCursorColor = 1
The g:moonflyTerminalColors
option specifies whether to use the moonfly color
palette in :terminal
windows when termguicolors
is set. By default this
option is enabled. If you prefer not to use the moonfly color palette for
the first 16 terminal colors then add the following to your vimrc:
let g:moonflyTerminalColors = 0
The g:moonflyUnderlineMatchParen
option specifies whether to underline
matching parentheses. By default this option is disabled. If you want to
underline matching parentheses then add the following to your vimrc:
let g:moonflyUnderlineMatchParen = 1
The g:moonflyUndercurls
option specifies whether to use undercurls for
spelling and linting errors in GUI versions of Vim, including terminal Vim with
termguicolors
set. By default this option is enabled. If you do not like
the appearance of undercurls then add the following to your vimrc:
let g:moonflyUndercurls = 0
The g:moonflyItalics
option specifies whether to use italics for comments and
certain HTML elements in GUI versions of Vim. By default this option is
enabled. If you do not like the appearance of italics then add the following
to your vimrc:
let g:moonflyItalics = 0
The g:moonflyTransparent
option specifies whether to use an opaque or
transparent background in GUI versions of Vim. By default this option is
disabled. If you would like a transparent background then add the following
to your vimrc:
let g:moonflyTransparent = 1
Many modern terminals support 24-bit true
colors. Current versions of Vim and
Neovim, on such terminals, support true colors when set termguicolors
is
enabled.
A list of popular terminals that support true colors:
On terminals that support true colors, and when termguicolors
is set, the
moonfly color scheme will not require any terminal configuration to emit the
correct theme colors.
For the true color moonfly color scheme to display correctly inside tmux the following setting will usually be required in ~/.tmux.conf:
set -ga terminal-overrides ',xterm-256color:Tc'
Vim, as against Neovim, inside tmux, will also require the following setting be added to vimrc:
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
A collection of moonfly-flavoured terminal themes are provided for those using
moonfly with termguicolors
(cterm
users should refer to the next section
and not use these terminal themes):
-
iTerm2 users on macOS can import this color scheme.
-
Gnome Terminal users can run this script to create a Moonfly profile. Before executing the script, please install the
dconf-cli
command line utility for modern versions of Gnome (3.28 and later), for examplesudo apt install dconf-cli
. After executing the script, please set the cursor and selection colors by hand, with the appropriate color values listed above, inPreferences
/Moonfly
/Colors
. -
Alacritty users can copy this theme into their
alacritty.yml
configuration.
The moonfly color scheme, when used absent termguicolors
, requires the
host terminal be configured with a specific color palette. In that case the
legacy moonfly cterm
256 color terminal theme will be used.
๐ Nowadays it is strongly recommened to use a true color terminal with a
modern version of Vim or Neovim with termguicolors
set.
If that is not possible, then the terminal emulator must be configured for 256 colors, which usually means setting the terminal's type to xterm-256color, or screen-256color when used inside tmux.
The terminal should then be configured with the following moonfly colors: