• Stars
    star
    798
  • Rank 57,078 (Top 2 %)
  • Language
    Lua
  • License
    MIT License
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A dark charcoal theme for modern Neovim & classic Vim

moonfly

moonfly is a dark charcoal theme for modern Neovim and classic Vim.

Note, all moonfly highlights in Neovim are implemented in Lua, whilst highlights in Vim are implemented in legacy Vimscript.

πŸ‘‰ I maintain another dark theme named nightfly which may be of interest.

Screenshot

screenshot

Styled Features & Plugins

Neovim-only:

Neovim & Vim compatible:

Vim-only:

⚑ Requirements

moonfly is now a GUI-only colorscheme.

A GUI client or a modern terminal version of Vim or Neovim in a true-color terminal is required. Details about true-color terminals are listed here.

moonfly explicitly no longer supports the 256 color cterm version of Vim or Neovim except via the legacy cterm-compat branch.

Installation

Install the bluz71/vim-moonfly-colors colorscheme with your preferred plugin manager.

vim-plug:

Plug 'bluz71/vim-moonfly-colors', { 'as': 'moonfly' }

packer.nvim:

use { "bluz71/vim-moonfly-colors", as = "moonfly" }

lazy.nvim:

{ "bluz71/vim-moonfly-colors", name = "moonfly", lazy = false, priority = 1000 },

Usage

Enable the colorscheme after the plugin declaration.

" Vimscript initialization file
colorscheme moonfly
-- Lua initialization file
vim.cmd [[colorscheme moonfly]]

Statusline

  • The moonfly theme supports lightline. To enable the moonfly lightline theme please add the following to your initialization file:
let g:lightline = { 'colorscheme': 'moonfly' }
  • The moonfly theme supports vim-airline. The moonfly theme will load once vim-airline starts.

  • The moonfly theme supports lualine. The moonfly theme will load once Lualine starts.

  • My linefly statusline plugin supports the moonfly theme.

  • Lastly, my legacy mistfly-statusline plugin also supports the moonfly theme.

πŸ”§ Options

Option Default State
moonflyCursorColor Disabled
moonflyItalics Enabled
moonflyNormalFloat Disabled
moonflyTerminalColors Enabled
moonflyTransparent Disabled
moonflyUndercurls Enabled
moonflyUnderlineMatchParen Disabled
moonflyVirtualTextColor Disabled
moonflyWinSeparator 1

moonflyCursorColor

The 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 initialization file:

" Vimscript initialization file
let g:moonflyCursorColor = v:true
-- Lua initialization file
vim.g.moonflyCursorColor = true

moonflyItalics

The 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 initialization file:

" Vimscript initialization file
let g:moonflyItalics = v:false
-- Lua initialization file
vim.g.moonflyItalics = false

moonflyNormalFloat

The moonflyNormalFloat option specifies whether to use moonfly background and foreground colors in Neovim floating windows. By default this option is disabled, hence, Neovim floating windows will usually be styled with popup menu colors. If you would like to use moonfly colors instead then add the following to your configuration:

" Vimscript initialization file
let g:moonflyNormalFloat = v:true
-- Lua initialization file
vim.g.moonflyNormalFloat = true

πŸ’‘ If the above option is set then it is highly recommended to enable floating window borders to distinguish between the edit and floating windows in Neovim's LSP client, for example:

  vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
    vim.lsp.handlers.hover, {
      border = "single"
    }
  )
  vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(
    vim.lsp.handlers.signatureHelp, {
      border = "single"
    }
  )
  vim.diagnostic.config({ float = { border = "single" } })

πŸ’‘ Likewise, nvim-cmp may be configured as follows for nicer display when g:moonflyNormalFloat is enabled:

local winhighlight = {
  winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel",
}
require('cmp').setup({
  window = {
    completion = cmp.config.window.bordered(winhighlight),
    documentation = cmp.config.window.bordered(winhighlight),
  }
})

moonflyTerminalColors

The 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 initialization file:

" Vimscript initialization file
let g:moonflyTerminalColors = v:false
-- Lua initialization file
vim.g.moonflyTerminalColors = false

moonflyTransparent

The 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 initialization file:

" Vimscript initialization file
let g:moonflyTransparent = v:true
-- Lua initialization file
vim.g.moonflyTransparent = true

moonflyUndercurls

The 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 initialization file:

" Vimscript initialization file
let g:moonflyUndercurls = v:false
-- Lua initialization file
vim.g.moonflyUndercurls = false

moonflyUnderlineMatchParen

The 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 initialization file:

" Vimscript initialization file
let g:moonflyUnderlineMatchParen = v:true
-- Lua initialization file
vim.g.moonflyUnderlineMatchParen = true

moonflyVirtualTextColor

The moonflyVirtualTextColor option specifies whether to display diagnostic virtual text in color. By default this option is disabled. If you want to display diagnostic virtual text in color then add the following to your initialization file:

" Vimscript initialization file
let g:moonflyVirtualTextColor = v:true
-- Lua initialization file
vim.g.moonflyVirtualTextColor = true

moonflyWinSeparator

The moonflyWinSeparator option specifies the style of window separators:

  • 0 will display no window separators

  • 1 will display block separators; this is the default

  • 2 will diplay line separators

For example, if line separators are desired then add the following to your configuration:

" Vimscript initialization file
let g:moonflyWinSeparator = 2
-- Lua initialization file
vim.g.moonflyWinSeparator = 2

🎁 If using Neovim 0.7 (or later), the following configuration will improve the look of line separators (if option 2 has been chosen) by selecting thicker characters for the separators:

" Vimscript initialization file
set fillchars=horiz:━,horizup:β”»,horizdown:β”³,vert:┃,vertleft:┨,vertright:┣,verthoriz:β•‹
-- Lua initialization file
vim.opt.fillchars = { horiz = '━', horizup = 'β”»', horizdown = 'β”³', vert = '┃', vertleft = 'β”«', vertright = '┣', verthoriz = 'β•‹', }

Overriding Highlights

If a certain highlight of this theme does not suit then it is recommended to use an autocmd to override that desired highlight.

For example, if one wishes to highlight functions in bold then simply add the following to your initialization file prior to setting the colorscheme:

" Vimscript initialization file
augroup CustomHighlight
    autocmd!
    autocmd ColorScheme moonfly highlight Function guifg=#74b2ff gui=bold
augroup END
-- Lua initialization file
local custom_highlight = vim.api.nvim_create_augroup("CustomHighlight", {})
vim.api.nvim_create_autocmd("ColorScheme", {
  pattern = "moonfly",
  callback = function()
    vim.api.nvim_set_hl(0, "Function", { fg = "#74b2ff", bold = true })
  end,
  group = custom_highlight,
})

True Color Terminals

Many modern terminals support 24-bit true colors. Current versions of Vim & Neovim, on such terminals, support true colors when the termguicolors option is enabled.

A list of popular terminals that support true colors:

On terminals that support true colors, and when termguicolors is set, the moonfly colorscheme will not require any terminal configuration to emit the correct theme colors.

For the true color moonfly colorscheme 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 settings be added to the ~/.vimrc file:

let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"

Extra Themes

A collection of moonfly-flavoured themes are provided:

For other terminals please configure appropriately with the following colors:

Type Category Value Color
Background Background #080808 background
Foreground Foreground #bdbdbd background
Bold Bold #eeeeee background
Cursor Cursor #9e9e9e background
Cursor Text Cursor Text #080808 background
Selection Selection #b2ceee background
Selection Text Selection Text #080808 background
Color 1 Black (normal) #323437 background
Color 2 Red (normal) #ff5454 background
Color 3 Green (normal) #8cc85f background
Color 4 Yellow (normal) #e3c78a background
Color 5 Blue (normal) #80a0ff background
Color 6 Purple (normal) #cf87e8 background
Color 7 Cyan (normal) #79dac8 background
Color 8 White (normal) #c6c6c6 background
Color 9 Black (bright) #949494 background
Color 10 Red (bright) #ff5189 background
Color 11 Green (bright) #36c692 background
Color 12 Yellow (bright) #c2c292 background
Color 13 Blue (bright) #74b2ff background
Color 14 Purple (bright) #ae81ff background
Color 15 Cyan (bright) #85dc85 background
Color 16 White (bright) #e4e4e4 background

Sponsor

Ko-fi

License

License: MIT

More Repositories

1

vim-nightfly-colors

A dark midnight theme for modern Neovim & classic Vim
Lua
788
star
2

dotfiles

My dotfiles for Neovim, Fish, Bash, Vim, tmux, Git and other stuff
Shell
149
star
3

nvim-linefly

A simple Lua statusline for Neovim
Lua
83
star
4

vim-mistfly-statusline

A simple Vimscript statusline for Vim
Vim Script
79
star
5

bash-seafly-prompt

A clean and fast Bash prompt
Shell
46
star
6

fly16-bat

A moonfly & nightfly compatible bat theme
9
star
7

platters

An example Ruby on Rails application hosted at: https://platters.cc
Ruby
5
star
8

git-status-fly

A fast git status utility for custom prompts
Rust
5
star
9

bluz71.github.io

My blog
CSS
2
star
10

redux_udemy_booklist

"Modern Redux with React" simple Redux book list example
JavaScript
1
star
11

elixir_udemy_identicon

"The Complete Elixir and Phoenix Bootcamp" Identicon example
Elixir
1
star
12

react_scratchpad

Scratchpad app made via 'create-react-app'
JavaScript
1
star
13

dicee_flutter

Dart
1
star
14

ticketee

Rails 4 in Action ticket logging application
Ruby
1
star
15

step-by-step-bootstrap

Example web pages using Bootstrap
HTML
1
star
16

misc-binaries

Miscellaneous files & binaries
1
star
17

platters_lab

A laboratory for the Platters application
HTML
1
star
18

es6_udemy_webpack

"Essentials in JavaScript ES6" webpack example
JavaScript
1
star
19

prog_language_snippets

Throw away programming language snippets
Go
1
star
20

simple_microblog

Ruby on Rails Tutorial simple microblog application
Ruby
1
star
21

platters_app

An example React application hosted at: https://platters.surge.sh
JavaScript
1
star
22

recordz

An example SvelteKit application
TypeScript
1
star
23

things_with_js

Simple Rails Javascript example.
Ruby
1
star
24

mi_card_flutter

Dart
1
star
25

jumpstart_tuts_ruby

Jumpstart Lab Ruby tutorials
Ruby
1
star
26

bulma_sampler

Demo Bulma + Rails application
HTML
1
star
27

magic-8-ball_flutter

Dart
1
star
28

udemy_react_router_redux_form

"Modern Redux with React" React Router and Redux Form example
JavaScript
1
star
29

ruby_koans

Ruby Koans
Ruby
1
star
30

phoenix_udemy_discuss

"The Complete Elixir and Phoenix Bootcamp" Discuss example
Elixir
1
star
31

react_udemy_videoplayer

"Modern Redux with React" simple React video player example
JavaScript
1
star
32

gatherer

Rails 4 Test Prescriptions project tracking application
JavaScript
1
star
33

redux_udemy_weather

"Modern Redux with React" Redux weather example
JavaScript
1
star