bluz71/vim-nightfly-guicolors

github github
treesitter-colorschemes plugin
star 316
stars
alert-circle 0
open issues
users 5
subscribers
git-branch 26
forks
CREATED

2020-01-23

UPDATED

2 days ago

packer

require('packer').startup(function()
  use 'bluz71/vim-nightfly-guicolors'
end)

paq

require "paq" { 
  'bluz71/vim-nightfly-guicolors'
}

nightfly

nightfly is a dark GUI colorscheme for Vim & Neovim inspired by:

  • Night Owl

  • moonfly (note, this is a dark Vim & Neovim colorscheme that I also maintain)

:zap: Prerequisites

nightfly is a GUI-only colorscheme.

A GUI client, such as Gvim, or a modern terminal version of Vim/Neovim with termguicolors enabled in a true-color terminal, will be required. Details about true-color terminals are listed below.

nightfly explicitly does not support the 256 color cterm version of Vim due to the number of custom colors required. 256 color terminals only allow 16 custom colors. I encourage terminal users to use a true-color terminal, such as: iTerm2, Alacritty, or kitty and enable the termguicolors option.

Screenshots

Ruby

JavaScript

The font in use is Iosevka.

Styled Features & Plugins

Installation

Install the bluz71/vim-nightfly-guicolors colorscheme with your preferred plugin manager.

vim-plug:

Plug 'bluz71/vim-nightfly-guicolors'

packer.nvim:

use 'bluz71/vim-nightfly-guicolors'

Usage

Enable the colorscheme after the plugin declaration.

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

Statusline

  • The nightfly colorscheme supports lightline. To enable the nightfly lightline colorscheme please add the following to your initialization file:
let g:lightline = { 'colorscheme': 'nightfly' }
  • The nightfly colorscheme supports vim-airline. For modern versions of vim-airline the nightfly theme will automatically be loaded.

  • The nightfly colorscheme supports Lualine. To enable the nightfly theme please add the following to your initialization file:

require('lualine').setup({options = {theme = 'nightfly'}})
  • Lastly, my own vim-moonfly-statusline is available for those that want a very simple yet informative status line. Please add the following to your initialization file to indicate to moonfly-statusline that statusline colors defined by the nightfly color scheme should be preferenced:
" Vimscript initialization file
let g:moonflyIgnoreDefaultColors = 1
-- Lua initialization file
vim.g.moonflyIgnoreDefaultColors = 1

:wrench: Options

The nightflyCursorColor 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:nightflyCursorColor = 1
-- Lua initialization file
vim.g.nightflyCursorColor = 1

The nightflyItalics 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:nightflyItalics = 0
-- Lua initialization file
vim.g.nightflyItalics = 0

The nightflyNormalFloat option specifies whether to use nightfly 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 nightfly colors instead then add the following to your configuration:

" Vimscript initialization file
let g:nightflyNormalFloat = 1
-- Lua initialization file
vim.g.nightflyNormalFloat = 1

:bulb: 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'
    }
  )
  local opts = {noremap = true, silent = true}
  vim.api.nvim_buf_set_keymap(0, 'n', ']d', '<cmd>lua vim.lsp.diagnostic.goto_next({severity_limit = "Warning", popup_opts = {border = "single"}})<CR>', opts)
  vim.api.nvim_buf_set_keymap(0, 'n', '[d', '<cmd>lua vim.lsp.diagnostic.goto_prev({severity_limit = "Warning", popup_opts = {border = "single"}})<CR>', opts)

The nightflyTerminalColors option specifies whether to use the nightfly color palette in :terminal windows when termguicolors is set. By default this option is enabled. If you prefer not to use the nightfly color palette for the first 16 terminal colors then add the following to your initialization file:

" Vimscript initialization file
let g:nightflyTerminalColors = 0
-- Lua initialization file
vim.g.nightflyTerminalColors = 0

The nightflyTransparent 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:nightflyTransparent = 1
-- Lua initialization file
vim.g.nightflyTransparent = 1

The nightflyUndercurls 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:nightflyUndercurls = 0
-- Lua initialization file
vim.g.nightflyUndercurls = 0

The nightflyUnderlineMatchParen 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:nightflyUnderlineMatchParen = 1
-- Lua initialization file
vim.g.nightflyUnderlineMatchParen = 1

The nightflyVertSplits option specifies whether to show vertical split columns. By default vertical split columns will be visible. If you would like vertical split columns to not be visible then add the following to your configuration:

" Vimscript initialization file
let g:nightflyVertSplits = 0
-- Lua initialization file
vim.g.nightflyVertSplits = 0

True Color Terminals

Many modern terminals support 24-bit true colors. Current versions of Vim & 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 nightfly colorscheme will emit the correct theme colors.

For the nightfly 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"

Terminal Themes

A collection of nightfly-flavoured terminal themes are provided:

  • iTerm2 users on macOS can import this colorscheme

  • Alacritty users can copy this theme into their alacritty.yml configuration.

  • kitty users can use this theme

  • GNOME Terminal users can run this script to create a Nightfly profile. Before executing the script, please install the dconf-cli command line utility for modern versions of Gnome (3.28 and later), for example sudo apt install dconf-cli. After executing the script, please set the cursor and selection colors by hand, with the appropriate color values listed below, in Preferences / Nightfly / Colors.

For other terminals please configure appropriately with the following colors:

Type Category Value Color
Background Background #011627 background
Foreground Foreground #acb4c2 background
Bold Bold #eeeeee background
Cursor Cursor #9ca1aa background
Cursor Text Cursor Text #080808 background
Selection Selection #b2ceee background
Selection Text Selection Text #080808 background
Color 1 Black (normal) #1d3b53 background
Color 2 Red (normal) #fc514e background
Color 3 Green (normal) #a1cd5e background
Color 4 Yellow (normal) #e3d18a background
Color 5 Blue (normal) #82aaff background
Color 6 Purple (normal) #c792ea background
Color 7 Cyan (normal) #7fdbca background
Color 8 White (normal) #a1aab8 background
Color 9 Black (bright) #7c8f8f background
Color 10 Red (bright) #ff5874 background
Color 11 Green (bright) #21c7a8 background
Color 12 Yellow (bright) #ecc48d background
Color 13 Blue (bright) #82aaff background
Color 14 Purple (bright) #ae81ff background
Color 15 Cyan (bright) #7fdbca background
Color 16 White (bright) #d6deeb background

License

License: MIT