├── img ├── palette_dark.png ├── syntax_dark.png ├── syntax_light.png └── palette_light.png ├── LICENSE ├── README.md ├── autoload ├── lightline │ └── colorscheme │ │ └── mellow.vim └── mellow_palette.vim ├── CHANGELOG.md ├── doc └── mellow.txt └── colors └── mellow.vim /img/palette_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adigitoleo/vim-mellow/HEAD/img/palette_dark.png -------------------------------------------------------------------------------- /img/syntax_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adigitoleo/vim-mellow/HEAD/img/syntax_dark.png -------------------------------------------------------------------------------- /img/syntax_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adigitoleo/vim-mellow/HEAD/img/syntax_light.png -------------------------------------------------------------------------------- /img/palette_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adigitoleo/vim-mellow/HEAD/img/palette_light.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD Zero Clause License 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mellow 2 | 3 | 4 | ### A warm, minimalist colorscheme for (neo)vim 5 | 6 | This colorscheme uses only 16 distinct colors for the dark or light theme. 7 | It looks best with `termguicolors` enabled, but a fallback theme is also 8 | provided if this option is not enabled (e.g. in the Linux vconsole). 9 | It should work on Vim version 8 or later, 10 | and supports additional highlight groups introduced in NeoVim 0.10. 11 | 12 | This colorscheme is not affiliated with [mellow.nvim](https://github.com/mellow-theme/mellow.nvim). 13 | 14 | Screenshots taken on alacritty with LiberationMono font: 15 | 16 |

17 | 18 | 19 |

20 | 21 | For more screenshots, check the [wiki], or [vimcolorschemes.com](https://vimcolorschemes.com/adigitoleo/vim-mellow). 22 | 23 | 24 | ## Installation 25 | 26 | Install the plugin using your preferred plugin manager. Alternatively, (Neo)Vim 27 | can load packages if they are added to your 'packpath' (see `:help packages`). 28 | Archives of tagged releases are available at 29 | . 30 | 31 | Otherwise, please add at least the `autoload`, `colors` and `doc` folders to 32 | your (Neo)Vim package/runtime path (see `:help 'runtimepath'`). 33 | 34 | After installing the colorscheme, please read `:help mellow` for information 35 | on usage and available options. This includes an option to switch the fallback 36 | color codes to ANSI mode instead of the default 256-color fallback palette. 37 | 38 | Apply the colorscheme with `:colorscheme mellow`. 39 | 40 | 41 | ### Statusline integration 42 | 43 | Two statusline plugins are currently supported: 44 | - [Lightline] : set the Lightline colorscheme to `'mellow'`, requires 45 | `termguicolors` (I don't use this statusline, so please contribute patches or 46 | at least report an issue if the integration needs to be fixed) 47 | - [mellow statusline] : my simple ASCII statusline, requires 48 | `let g:mellow_user_colors = 1` 49 | 50 | 51 | ## Miscellaneous 52 | 53 | This theme was first motivated by a lack of `bg=light` option in [vim-farout], 54 | which uses a similar minimalist set of warm red and yellow colors. I wanted a 55 | light theme with moderate contrast and warm colors, that didn't make me want to 56 | change every single syntax file. To me, Mellow lies mid-way between `:syntax 57 | off` and popular themes like [solarized] or [gruvbox]. 58 | 59 | And that's just the way I like it :) 60 | 61 | Since the theme uses only 16 colors, you can use the same colors in your 62 | terminal of choice. Check the [wiki] for an example Alacritty theme, as well as 63 | experimental Mellow colorschemes for some other Linux stuff. 64 | 65 | 66 | [NOTE]: # ( ------------ PUT ALL EXTERNAL LINKS BELOW THIS LINE ------------ ) 67 | 68 | [wiki]: https://github.com/adigitoleo/vim-mellow/wiki 69 | 70 | [vim-farout]: https://github.com/fcpg/vim-farout 71 | 72 | [solarized]: https://en.wikipedia.org/wiki/Solarized_(color_scheme) 73 | 74 | [gruvbox]: https://github.com/morhetz/gruvbox 75 | 76 | [mellow statusline]: https://github.com/adigitoleo/vim-mellow-statusline 77 | 78 | [Lightline]: https://github.com/itchyny/lightline.vim 79 | -------------------------------------------------------------------------------- /autoload/lightline/colorscheme/mellow.vim: -------------------------------------------------------------------------------- 1 | " Lightline themes for Mellow: 2 | " 3 | 4 | if lightline#colorscheme#background() ==# 'light' 5 | let s:colors = mellow_palette#Light() 6 | else 7 | let s:colors = mellow_palette#Dark() 8 | endif 9 | 10 | function! s:hi(fg, bg, ...) 11 | let l:fg = [s:colors[a:fg], a:fg] 12 | let l:bg = [s:colors[a:bg], a:bg] 13 | return a:0 ? [l:fg, l:bg, a:1] : [l:fg, l:bg] 14 | endfunction 15 | 16 | let s:p = { 17 | \ 'normal': {}, 18 | \ 'inactive': {}, 19 | \ 'insert': {}, 20 | \ 'replace': {}, 21 | \ 'visual': {}, 22 | \ 'tabline': {}, 23 | \ 'command': {}, 24 | \ } 25 | 26 | if lightline#colorscheme#background() ==# 'light' 27 | let s:p.normal.left = [s:hi(11, 13, 'bold'), s:hi(15, 3), s:hi(13, 11)] 28 | let s:p.normal.right = [s:hi(11, 13, 'bold'), s:hi(15, 3), s:hi(13, 11)] 29 | let s:p.normal.middle = [s:hi(13, 11)] 30 | let s:p.normal.error = [s:hi(11, 1)] 31 | let s:p.normal.warning = [s:hi(11, 3)] 32 | 33 | let s:p.insert.left = [s:hi(11, 2, 'bold'), s:hi(15, 3), s:hi(13, 11)] 34 | let s:p.insert.right = [s:hi(11, 2, 'bold'), s:hi(15, 3), s:hi(13, 11)] 35 | 36 | let s:p.visual.left = [s:hi(11, 14, 'bold'), s:hi(15, 3), s:hi(13, 11)] 37 | let s:p.visual.right = [s:hi(11, 14, 'bold'), s:hi(15, 3), s:hi(13, 11)] 38 | 39 | let s:p.inactive.left = [s:hi(13, 11, 'bold'), s:hi(13, 11)] 40 | let s:p.inactive.middle = [s:hi(13, 11), s:hi(13, 11)] 41 | let s:p.inactive.right = [s:hi(13, 11 , 'bold'), s:hi(13, 11)] 42 | 43 | let s:p.replace.left = [s:hi(11, 1, 'bold'), s:hi(15, 3), s:hi(13, 11)] 44 | let s:p.replace.right = [s:hi(11, 1, 'bold'), s:hi(15, 3), s:hi(13, 11)] 45 | 46 | let s:p.tabline.left = [s:hi(11, 13)] 47 | let s:p.tabline.right = [s:hi(11, 1)] 48 | let s:p.tabline.tabsel = [s:hi(15, 3, 'bold')] 49 | 50 | let s:p.command.left = [s:hi(11, 4, 'bold'), s:hi(15, 3), s:hi(13, 11)] 51 | let s:p.command.right = [s:hi(11, 4, 'bold'), s:hi(15, 3), s:hi(13, 11)] 52 | else 53 | let s:p.normal.left = [s:hi(8, 12, 'bold'), s:hi(15, 13), s:hi(11, 5)] 54 | let s:p.normal.right = [s:hi(8, 12, 'bold'), s:hi(15, 13), s:hi(11, 5)] 55 | let s:p.normal.middle = [s:hi(11, 5)] 56 | let s:p.normal.error = [s:hi(11, 1)] 57 | let s:p.normal.warning = [s:hi(11, 3)] 58 | 59 | let s:p.insert.left = [s:hi(8, 2, 'bold'), s:hi(15, 13), s:hi(11, 5)] 60 | let s:p.insert.right = [s:hi(8, 2, 'bold'), s:hi(15, 13), s:hi(11, 5)] 61 | 62 | let s:p.visual.left = [s:hi(8, 14, 'bold'), s:hi(15, 13), s:hi(11, 5)] 63 | let s:p.visual.right = [s:hi(8, 14, 'bold'),s:hi(15, 13), s:hi(11, 5)] 64 | 65 | let s:p.inactive.left = [s:hi(11, 5, 'bold'), s:hi(11, 5)] 66 | let s:p.inactive.middle = [s:hi(11, 5), s:hi(11, 5)] 67 | let s:p.inactive.right = [s:hi(11, 5 , 'bold'), s:hi(11, 5)] 68 | 69 | let s:p.replace.left = [s:hi(8, 1, 'bold'), s:hi(15, 13), s:hi(11, 5)] 70 | let s:p.replace.right = [s:hi(8, 1, 'bold'), s:hi(15, 13), s:hi(11, 5)] 71 | 72 | let s:p.tabline.left = [s:hi(8, 12)] 73 | let s:p.tabline.right = [s:hi(11, 1)] 74 | let s:p.tabline.tabsel = [s:hi(11, 13, 'bold')] 75 | 76 | let s:p.command.left = [s:hi(11, 4, 'bold'), s:hi(15, 3), s:hi(13, 11)] 77 | let s:p.command.right = [s:hi(11, 4, 'bold'), s:hi(15, 3), s:hi(13, 11)] 78 | endif 79 | 80 | let g:lightline#colorscheme#mellow#palette = lightline#colorscheme#flatten(s:p) 81 | 82 | " See https://github.com/itchyny/lightline.vim/issues/424#issuecomment-590058820 83 | augroup MellowLightlineAutocmd 84 | autocmd! 85 | autocmd OptionSet background 86 | \ runtime autoload/lightline/colorscheme/mellow.vim 87 | \ | call lightline#colorscheme() 88 | \ | call lightline#update() 89 | augroup END 90 | -------------------------------------------------------------------------------- /autoload/mellow_palette.vim: -------------------------------------------------------------------------------- 1 | " Color definitions for Mellow: 2 | " 3 | 4 | function mellow_palette#Light(...) 5 | if a:0 && a:1 ==# '256' 6 | " xterm-256 conversions: https://codegolf.stackexchange.com/a/156985 7 | return [ 8 | \ 232, 125, 58, 137, 240, 236, 130, 187, 9 | \ 235, 210, 107, 216, 102, 95, 173, 223 10 | \ ] 11 | else 12 | let l:codes = [ 13 | \ '#0F0908', 14 | \ '#AF0032', 15 | \ '#4C6E25', 16 | \ '#A67458', 17 | \ '#573E55', 18 | \ '#66292F', 19 | \ '#BF472C', 20 | \ '#E0CCAE', 21 | \ '#3D241F', 22 | \ '#FF7477', 23 | \ '#84BF40', 24 | \ '#F3AE72', 25 | \ '#8A7B85', 26 | \ '#8A4B53', 27 | \ '#D47D49', 28 | \ '#F2DDBC', 29 | \ ] 30 | let l:names = [ 31 | \ 'night_rider', 32 | \ 'shiraz', 33 | \ 'fern_frond', 34 | \ 'leather', 35 | \ 'eggplant', 36 | \ 'buccaneer', 37 | \ 'tuscany', 38 | \ 'grain_brown', 39 | \ 'jon', 40 | \ 'bittersweet', 41 | \ 'sushi', 42 | \ 'light_salmon', 43 | \ 'suva_grey', 44 | \ 'copper_rust', 45 | \ 'raw_sienna', 46 | \ 'sidecar', 47 | \ ] 48 | if a:0 && a:1 ==# 'named' 49 | let l:colors = {} 50 | for l:index in range(len(l:codes)) 51 | let l:colors[l:names[l:index]] = l:codes[l:index] 52 | endfor 53 | return l:colors 54 | else 55 | return l:codes 56 | endif 57 | endif 58 | endfunction 59 | 60 | function mellow_palette#Dark(...) 61 | if a:0 && a:1 ==# '256' 62 | " xterm-256 conversions: https://codegolf.stackexchange.com/a/156985 63 | return [ 64 | \ 232, 125, 64, 137, 96, 236, 130, 181, 65 | \ 235, 210, 107, 216, 247, 95, 173, 223 66 | \ ] 67 | else 68 | let l:codes = [ 69 | \ '#0F0908', 70 | \ '#AF0032', 71 | \ '#577E2A', 72 | \ '#BF9169', 73 | \ '#896186', 74 | \ '#66292F', 75 | \ '#BF472C', 76 | \ '#D3C1A6', 77 | \ '#3D241F', 78 | \ '#FF7477', 79 | \ '#84BF40', 80 | \ '#F3AE72', 81 | \ '#9F939B', 82 | \ '#8A4B53', 83 | \ '#D47D49', 84 | \ '#ECCD9D', 85 | \ ] 86 | let l:names = [ 87 | \ 'night_rider', 88 | \ 'pancho', 89 | \ 'shiraz', 90 | \ 'crete', 91 | \ 'muddy_waters', 92 | \ 'magenta', 93 | \ 'buccaneer', 94 | \ 'tuscany', 95 | \ 'akaroa', 96 | \ 'jon', 97 | \ 'bittersweet', 98 | \ 'sushi', 99 | \ 'light_salmon', 100 | \ 'venus', 101 | \ 'copper_rust', 102 | \ 'raw_sienna', 103 | \ ] 104 | if a:0 && a:1 ==# 'named' 105 | let l:colors = {} 106 | for l:index in range(len(l:codes)) 107 | let l:colors[l:names[l:index]] = l:codes[l:index] 108 | endfor 109 | return l:colors 110 | else 111 | return l:codes 112 | endif 113 | endif 114 | endfunction 115 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | For versions prior to v1.0.0, information can be found in the git tag messages. 6 | 7 | Versions after v1.3.0 use a new autoloaded palette function and are therefore 8 | backwards-incompatible (in hindsight, that should have been a v2 release...) 9 | 10 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 11 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 12 | 13 | ## [1.6.1] : 2024-07-11 14 | 15 | ### Added 16 | - Optional names for the color codes output by the palette API 17 | 18 | ## [1.6.0] : 2024-05-28 19 | 20 | ### Added 21 | - Defined or linked many new highlight groups required in NeoVim (diagnostics, 22 | LSP, tree-sitter), since default NeoVim links are not always sensible or 23 | reliable (see e.g. ) 24 | 25 | ## [1.5.9] : 2024-05-26 26 | 27 | ### Added 28 | - Manual highlight definition for `@variable`, which is unfortunately 29 | hard-coded to `NvimLightGrey2` in the new NeoVim 0.10 default themes 30 | 31 | ## [1.5.8] : 2024-05-26 32 | 33 | ### Changed 34 | - Streamline README documentation and disaffirm affiliation with mellow.nvim 35 | 36 | ## [1.5.7] : 2024-05-26 37 | 38 | ### Added 39 | - Highlight links to restore previous look for `Delimiter` and `Operator` 40 | groups, which were given their own colors in NeoVim 0.10 41 | - Highlight links for the new NeoVim 0.10 group names: `Added`, `Changed` and 42 | `Removed` (which are mostly used for diff buffers) 43 | 44 | ## [1.5.6] : 2024-02-11 45 | 46 | ### Added 47 | - Highlight links for the basic set of neovim's LSP diagnostics 48 | 49 | ### Changed 50 | - Softer color for underlines 51 | 52 | ## [1.5.5] : 2023-07-26 53 | 54 | ### Added 55 | - 'command' mode colors for the lightline theme 56 | - 'Whitespace' group colors (used for e.g. indent guides, "non-printed" chars) 57 | 58 | ## [1.5.4] : 2022-11-02 59 | 60 | ### Changed 61 | - Fixed vim8 errors due to unsupported string concatenation syntax 62 | 63 | ## [1.5.2] : 2022-04-11 64 | 65 | ### Changed 66 | - Update UserColors 3 and 4 ("subtle" colors on statusline background) 67 | to better accommodate v1.5 changes in vim-mellow-statusline 68 | 69 | ## [1.5.1] : 2022-03-15 70 | 71 | ### Fixed 72 | - Update screenshots in README and github wiki 73 | 74 | ## [1.5.0] : 2022-03-14 75 | 76 | ### Changed 77 | - Light yellow, to be easier to read on the light theme background 78 | 79 | ### Fixed 80 | - Lightline colorscheme, to be responsive to `background` changes, 81 | [@mvanderkamp](https://github.com/mvanderkamp). 82 | 83 | ## [1.4.3] : 2021-06-14 84 | 85 | ### Changed 86 | - Improve documentation 87 | 88 | ## [1.4.2] : 2021-03-05 89 | 90 | ### Changed 91 | - Update maintainer email 92 | 93 | ## [1.4.1] : 2021-02-22 94 | 95 | ### Changed 96 | - Link hl-Title to hl-ModeMsg instead of hl-Ignore (distinct title color) 97 | 98 | ## [1.4.0] : 2021-02-01 99 | 100 | ### Added 101 | - Vim helpfile. 102 | 103 | ### Changed 104 | - New ASCII logo. 105 | - Overhaul of lightline themes. 106 | 107 | ## [1.3.0] : 2021-01-23 108 | 109 | ### Changed 110 | - Standardise Lightline themes to use bold colors and three left sections, 111 | [@mvanderkamp](https://github.com/mvanderkamp). 112 | - Refactor to load color definitions from a central autoload function. 113 | 114 | ## [1.2.1] : 2020-11-06 115 | 116 | ### Changed 117 | - Fix dark Lightline theme to use blue color for percentage block background. 118 | 119 | 120 | ## [1.2.0] : 2020-11-04 121 | 122 | ### Added 123 | - Lightline themes by [@toniz4](https://github.com/toniz4). 124 | 125 | ## [1.1.0] : 2020-11-02 126 | 127 | ### Added 128 | - Option `g:mellow_cterm_ansi` to set the type of fallback codes. 129 | 130 | 131 | ## [1.0.0] : 2020-11-01 132 | 133 | ### Added 134 | - Fallback color codes (ANSI or 256) when `termguicolors` is unset. 135 | - Highlight setter function `s:hi` 136 | - README documentation for the `g:mellow_user_colors` option. 137 | 138 | ### Changed 139 | - Make DiffDelete and Error color groups consistent across dark and light 140 | themes. 141 | - Refactor to handle most highlight commands (excluding links) through the 142 | setter function. 143 | 144 | ### Removed 145 | - Check for (enabled) `termguicolors` setting. 146 | -------------------------------------------------------------------------------- /doc/mellow.txt: -------------------------------------------------------------------------------- 1 | *mellow* A warm, minimalist colorscheme for (neo)vim 2 | __ __ 3 | _ _ ___ / / /______ ___ 4 | / \/ \ / _ \/ / / _ \ \/\/ / 5 | / \/ ___/ / / /_/ /\ / 6 | /__/\/\__\___/__/__/\____/ \_/\_/ 7 | 8 | https://github.com/adigitoleo/vim-mellow 9 | 10 | ============================================================================== 11 | CONTENTS *mellow-contents* 12 | 13 | 1. Introduction ............................... |mellow-introduction| 14 | 2. Usage ...................................... |mellow-usage| 15 | 3. Configuration .............................. |mellow-configuration| 16 | 4. Customization .............................. |mellow-customization| 17 | 5. Integration ................................ |mellow-integration| 18 | 6. Palette .................................... |mellow-palette| 19 | 7. Bugs ....................................... |mellow-bugs| 20 | 21 | 22 | ============================================================================== 23 | INTRODUCTION *mellow-introduction* 24 | 25 | This plugin provides a colorscheme for vim (version 8+) and neovim (version 26 | 0.4+). The Mellow colorscheme is intentionally minimalist, using a palette of 27 | only 16 colors. The differentiation of sytnax groups is based on their 28 | |group-name|. Mellow supports both light and dark backgrounds via the native 29 | 'background' setting. An effort was made to minimize confusing changes in 30 | syntax highlighting between themes. To get the hex codes, see |mellow-palette|. 31 | 32 | NOTE: If you are running *vim in a terminal, Mellow should look a lot better 33 | when 'termguicolors' is set. 34 | 35 | 36 | ============================================================================== 37 | USAGE *mellow-usage* 38 | 39 | To apply the colorscheme, run `:colorscheme mellow` . For the colorscheme to 40 | persist across *vim sessions, you need to add the command to your |config| file. 41 | 42 | NOTE: The colorscheme uses 24-bit RGB colors if available, which may require 43 | enabling the 'termguicolors' setting. If you are running *vim in a terminal 44 | and there is no change when toggling this setting, then you are using a 45 | fallback "256-color" palette. Please verify that your terminal supports true 46 | colors (https://gist.github.com/XVilka/8346728). See also: 47 | |g:mellow_cterm_ansi|. 48 | 49 | NOTE: The colorscheme makes use of |bold| and |underline| attributes. Check 50 | |group-names|, specifically the Underlined, Error and Todo groups, to see if 51 | your terminal supports them. 52 | 53 | ============================================================================== 54 | CONFIGURATION *mellow-configuration* 55 | 56 | The following configuration options are supported for the Mellow colorscheme. 57 | 58 | ------------------------------------------------------------------------------ 59 | *g:mellow_terminal_colors* 60 | 61 | The Mellow palette can be used to define colors for the embedded 62 | |terminal-emulator|. This option should be enabled by default if your *vim 63 | supports embedded terminals. 64 | 65 | Enable (default): `let g:mellow_terminal_colors = 1` 66 | Disable: `let g:mellow_terminal_colors = 0` 67 | 68 | NOTE: Colors in existing terminal buffers are NOT re-drawn when changing the 69 | 'background'. You will need to kill and restart any terminal buffers to see 70 | the new colors. 71 | 72 | ------------------------------------------------------------------------------ 73 | *g:mellow_user_colors* 74 | 75 | The Mellow colorscheme contains definitions for the 9 additional highlight 76 | groups |hl-User1..9|. They are not set by default. 77 | 78 | Enable: `let g:mellow_user_colors = 1` 79 | Disable (default): `let g:mellow_user_colors = 0` 80 | 81 | ------------------------------------------------------------------------------ 82 | *g:mellow_cterm_ansi* 83 | 84 | This setting allows you to change the fallback mode to use base ANSI colors. 85 | The default fallback colors use the widely available 256-color palette. If 86 | that isn't working, or if your *vim does not support 'termguicolors' but your 87 | terminal has RGB color support, you may want to configure the mellow palette 88 | from your shell/emulator configuration files and inherit the colors from 89 | there. To get hex codes for your shell config, see |mellow-palette|. 90 | 91 | NOTE: this setting only takes effect if you turn off 'termguicolors'. 92 | 93 | Enable: `let g:mellow_cterm_ansi = 1` 94 | Disable (default): `let g:mellow_cterm_ansi = 0` 95 | 96 | 97 | ============================================================================== 98 | CUSTOMIZATION *mellow-customization* 99 | 100 | Making small changes to a colorscheme can easily be achieved using 101 | |autocommand|s. For example, to use the same background color for line numbers 102 | as for the document buffer: > 103 | 104 | augroup fix_colors 105 | autocomd! 106 | autocomd ColorScheme mellow hi LineNr guibg=None 107 | autocomd ColorScheme mellow hi CursorLineNr guibg=None 108 | augroup END 109 | 110 | If you use ALE (https://github.com/dense-analysis/ale), you might prefer 111 | stronger indicators for warnings/errors: > 112 | 113 | augroup ale_highlights 114 | autocmd! 115 | autocmd ColorScheme mellow hi link ALEWarning Visual 116 | autocmd ColorScheme mellow hi link ALEErrorLine DiffDelete 117 | augroup END 118 | 119 | 120 | ============================================================================== 121 | INTEGRATION *mellow-integration* 122 | 123 | The Mellow colorscheme does not work if your `$TERM` is `linux`, e.g. in a 124 | virtual console (tty). 125 | 126 | The default 'statusline' implementation supports using colors directly from 127 | the colorscheme or from |hl-User1..9| colors via `%#GroupName#...%` and 128 | `%N*...%*` syntax, respectively. See also |g:mellow_user_colors|. 129 | 130 | The Mellow colorscheme also supports the following statusline plugins: 131 | 132 | * mellow-statusline (https://github.com/adigitoleo/vim-mellow-statusline) 133 | 134 | * lightline (https://github.com/itchyny/lightline.vim): > 135 | let g:lightline = {"colorscheme": "mellow"} 136 | 137 | 138 | ============================================================================== 139 | PALETTE *mellow-palette* 140 | 141 | The hex codes are listed in the `./autoload/mellow_palette.vim` file, located 142 | in the plugin folder. To print hex codes in a vimscript list, run > 143 | echo mellow_palette#Light() 144 | for the light theme or > 145 | echo mellow_palette#Dark() 146 | for the dark theme. 147 | 148 | The 256-color fallbacks are available from the same functions, if the optional 149 | argument "256" is provided, e.g.: > 150 | echo mellow_palette#Light("256") 151 | 152 | A dictionary with suggested names for the colors is also available, if the 153 | optional argument "named" is provided instead, e.g.: > 154 | echo mellow_palette#Light("named") 155 | 156 | 157 | ============================================================================== 158 | BUGS *mellow-bugs* 159 | 160 | Bug fixes and feature requests are welcome at the github issue tracker: > 161 | 162 | https://github.com/adigitoleo/vim-mellow/issues 163 | 164 | Alternatively, patches can be sent to my public inbox: > 165 | 166 | https://lists.sr.ht/~adigitoleo/public-inbox 167 | 168 | vim:tw=78:ts=8:noet:ft=help:norl: 169 | -------------------------------------------------------------------------------- /colors/mellow.vim: -------------------------------------------------------------------------------- 1 | " __ __ 2 | " _ _ ___ / / /______ ___ 3 | " / \/ \ / _ \/ / / _ \ \/\/ / 4 | " / \/ ___/ / / /_/ /\ / 5 | " /__/\/\__\___/__/__/\____/ \_/\_/ 6 | " 7 | " Maintainer: adigitoleo 8 | " Description: A warm, minimalist colorscheme for (neo)vim 9 | " Homepage: https://github.com/adigitoleo/vim-mellow 10 | 11 | " Clear highlights and set options. {{{1 12 | 13 | if $TERM ==# 'linux' 14 | finish 15 | endif 16 | 17 | hi clear 18 | 19 | if v:version > 580 20 | if exists('g:syntax_on') 21 | syntax reset 22 | endif 23 | endif 24 | 25 | let g:colors_name = 'mellow' 26 | 27 | function! s:setopt(suffix, default) abort 28 | if has('nvim') 29 | return get(g:, g:colors_name . a:suffix, a:default) 30 | else 31 | return get(g:, g:colors_name . a:suffix, a:default) 32 | endif 33 | endfunction 34 | 35 | " By default, DO define colors for :terminal. 36 | let s:opt_terminal_colors = s:setopt('_terminal_colors', 1) 37 | 38 | " By default, DO NOT define User1-9 colors for statusline. 39 | let s:opt_user_colors = s:setopt('_user_colors', 0) 40 | 41 | " By default, DO NOT use ANSI colors as a fallback (uses 256 colors instead). 42 | let s:opt_cterm_ansi = s:setopt('_cterm_ansi', 0) 43 | 44 | " Load color palette. {{{1 45 | 46 | if &background ==# 'light' 47 | let s:colors = mellow_palette#Light() 48 | let s:colors_fallback = s:opt_cterm_ansi ? 49 | \ range(16) : mellow_palette#Light('256') 50 | else 51 | let s:colors = mellow_palette#Dark() 52 | let s:colors_fallback = s:opt_cterm_ansi ? 53 | \ range(16) : mellow_palette#Dark('256') 54 | endif 55 | 56 | " Define highlight setter function. {{{1 57 | 58 | function! s:hi(group, bg, fg, ...) abort 59 | " Parse bg and fg strings, e.g. 'NONE', or integers in the range [0,15]. 60 | let l:guibg = type(a:bg) == type('') ? a:bg : s:colors[a:bg] 61 | let l:guifg = type(a:fg) == type('') ? a:fg : s:colors[a:fg] 62 | " Set cterm fallback colors. 63 | let l:ctermbg = type(a:bg) == type('') ? a:bg : s:colors_fallback[a:bg] 64 | let l:ctermfg = type(a:fg) == type('') ? a:fg : s:colors_fallback[a:fg] 65 | 66 | let l:colors = printf( 67 | \ 'hi %s ctermbg=%s guibg=%s ctermfg=%s guifg=%s', 68 | \ a:group, l:ctermbg, l:guibg, l:ctermfg, l:guifg 69 | \) 70 | 71 | " By default, set special attributes to 'NONE'. 72 | let l:options = 'NONE' 73 | 74 | for l:opt in a:000 75 | if type(l:opt) == type('') 76 | " Parse special attribute string. 77 | let l:options = l:opt 78 | elseif type(l:opt) == type(0) 79 | " Parse guisp color integer in the range [0,15]. 80 | let l:colors .= printf(' guisp=%s', s:colors[l:opt]) 81 | endif 82 | endfor 83 | 84 | return printf('%s cterm=%s gui=%s', l:colors, l:options, l:options) 85 | endfunction 86 | 87 | " Set main colors. {{{1 88 | 89 | if &background ==# 'light' 90 | " -------- group ------------ bg--------- fg ------- special ------- 91 | exe s:hi('Comment', 'NONE', 14) 92 | exe s:hi('Constant', 'NONE', 0) 93 | exe s:hi('Cursor', 0, 15) 94 | exe s:hi('CursorLine', 7, 'NONE') 95 | exe s:hi('CursorLineNr', 7, 6, 'bold') 96 | exe s:hi('DiffAdd', 10, 'NONE') 97 | exe s:hi('DiffChange', 'NONE', 6) 98 | exe s:hi('DiffDelete', 'NONE', 9, 'bold') 99 | exe s:hi('EndOfBuffer', 7, 12) 100 | exe s:hi('ErrorMsg', 1, 15) 101 | exe s:hi('Function', 'NONE', 5) 102 | exe s:hi('Identifier', 'NONE', 13) 103 | exe s:hi('Ignore', 'NONE', 'NONE') 104 | exe s:hi('IncSearch', 11, 0) 105 | exe s:hi('LineNr', 7, 14) 106 | exe s:hi('ModeMsg', 'NONE', 6, 'bold') 107 | exe s:hi('MoreMsg', 'NONE', 3, 'bold') 108 | exe s:hi('NonText', 7, 9) 109 | exe s:hi('Normal', 15, 0) 110 | exe s:hi('Pmenu', 7, 3) 111 | exe s:hi('PmenuSel', 11, 6) 112 | exe s:hi('PmenuThumb', 13, 11) 113 | exe s:hi('Special', 'NONE', 12) 114 | exe s:hi('SpellBad', 15, 1, 'underline', 9) 115 | exe s:hi('SpellCap', 15, 4, 'underline', 12) 116 | exe s:hi('SpellLocal', 15, 6, 'underline', 14) 117 | exe s:hi('SpellRare', 15, 3, 'underline', 11) 118 | exe s:hi('Statement', 'NONE', 1) 119 | exe s:hi('StatusLine', 11, 13, 'bold') 120 | exe s:hi('StatusLineNC', 7, 3, 'bold,underline') 121 | exe s:hi('String', 'NONE', 4) 122 | exe s:hi('Todo', 'NONE', 12, 'bold') 123 | exe s:hi('Underlined', 'NONE', 'NONE', 'underline', 12) 124 | exe s:hi('VertSplit', 7, 3, 'bold') 125 | exe s:hi('Visual', 11, 'NONE') 126 | exe s:hi('WildMenu', 7, 6) 127 | exe s:hi('Whitespace', 'NONE', 7) 128 | 129 | else 130 | " -------- group ------------ bg--------- fg ------- special ------- 131 | exe s:hi('Comment', 'NONE', 13) 132 | exe s:hi('Constant', 'NONE', 15) 133 | exe s:hi('Cursor', 7, 0) 134 | exe s:hi('CursorLine', 8, 'NONE') 135 | exe s:hi('CursorLineNr', 8, 14, 'bold') 136 | exe s:hi('DiffAdd', 2, 'NONE') 137 | exe s:hi('DiffChange', 'NONE', 14) 138 | exe s:hi('DiffDelete', 'NONE', 9, 'bold') 139 | exe s:hi('EndOfBuffer', 8, 12) 140 | exe s:hi('ErrorMsg', 1, 15) 141 | exe s:hi('Function', 'NONE', 3) 142 | exe s:hi('Identifier', 'NONE', 11) 143 | exe s:hi('Ignore', 'NONE', 'NONE') 144 | exe s:hi('IncSearch', 5, 15) 145 | exe s:hi('LineNr', 8, 13) 146 | exe s:hi('ModeMsg', 'NONE', 14, 'bold') 147 | exe s:hi('MoreMsg', 'NONE', 3, 'bold') 148 | exe s:hi('NonText', 8, 9) 149 | exe s:hi('Normal', 0, 15) 150 | exe s:hi('Pmenu', 8, 13) 151 | exe s:hi('PmenuSel', 5, 9) 152 | exe s:hi('PmenuThumb', 13, 5) 153 | exe s:hi('Special', 'NONE', 12) 154 | exe s:hi('SpellBad', 0, 1, 'underline', 9) 155 | exe s:hi('SpellCap', 0, 7, 'underline', 12) 156 | exe s:hi('SpellLocal', 0, 14, 'underline', 14) 157 | exe s:hi('SpellRare', 0, 4, 'underline', 4) 158 | exe s:hi('Statement', 'NONE', 6) 159 | exe s:hi('StatusLine', 5, 11, 'bold') 160 | exe s:hi('StatusLineNC', 8, 13, 'bold,underline') 161 | exe s:hi('String', 'NONE', 7) 162 | exe s:hi('Todo', 'NONE', 12, 'bold') 163 | exe s:hi('Underlined', 'NONE', 'NONE', 'underline', 12) 164 | exe s:hi('VertSplit', 8, 13, 'bold') 165 | exe s:hi('Visual', 5, 'NONE') 166 | exe s:hi('WildMenu', 8, 14) 167 | exe s:hi('Whitespace', 'NONE', 8) 168 | endif 169 | 170 | if has('nvim') 171 | exe s:hi('DiagnosticUnderlineError', 'NONE', 'NONE', 'underline', 1) 172 | exe s:hi('DiagnosticUnderlineWarn', 'NONE', 'NONE', 'underline', 6) 173 | exe s:hi('DiagnosticUnderlineInfo', 'NONE', 'NONE', 'underline', 3) 174 | exe s:hi('DiagnosticUnderlineHint', 'NONE', 'NONE', 'underline', 4) 175 | exe s:hi('DiagnosticUnderlineOk', 'NONE', 'NONE', 'underline', 2) 176 | " NOTE: This treesitter stuff seem to be hardcoded to something sensible: 177 | " @markup.strong 178 | " @markup.italic 179 | " @markup.strikethrough 180 | " @markup.underline 181 | endif 182 | 183 | " Set linked groups. {{{1 184 | 185 | hi! link Added DiffAdd 186 | hi! link Changed DiffChanged 187 | hi! link ColorColumn CursorLine 188 | hi! link Conceal Special 189 | hi! link CursorColumn CursorLine 190 | hi! link CursorIM Cursor 191 | hi! link Delimiter Special 192 | hi! link DiffText Visual 193 | hi! link Directory DiffChange 194 | hi! link Error DiffDelete 195 | hi! link FoldColumn EndOfBuffer 196 | hi! link Folded EndOfBuffer 197 | hi! link MatchParen PmenuSel 198 | hi! link Number Constant 199 | hi! link Operator Statement 200 | hi! link PmenuSbar Pmenu 201 | hi! link PreProc Identifier 202 | hi! link Question ModeMsg 203 | hi! link QuickFixLine Underlined 204 | hi! link Removed DiffDelete 205 | hi! link Search IncSearch 206 | hi! link SignColumn CursorLine 207 | hi! link SpecialKey Special 208 | hi! link StatusLineTerm StatusLine 209 | hi! link StatusLineTermNC StatusLineNC 210 | hi! link TabLine StatusLineNC 211 | hi! link TabLineFill StatusLineNC 212 | hi! link TabLineSel StatusLine 213 | hi! link Terminal Normal 214 | hi! link Title ModeMsg 215 | hi! link Type Function 216 | hi! link VisualNOS Error 217 | hi! link WarningMsg Error 218 | hi! link helpLeadBlank StatusLineNC 219 | hi! link helpNormal StatusLineNC 220 | 221 | " In NeoVim, we need to additionally set highlight groups from: 222 | " :h diagnostic-highlights 223 | " :h lsp-highlight 224 | " :h treesitter-highlight-groups 225 | " As well as all (Normal)Float* and Win* groups from :h highlight-groups. 226 | if has('nvim') 227 | hi! link DiagnosticError ErrorMsg 228 | hi! link DiagnosticHint Special 229 | hi! link DiagnosticInfo MoreMsg 230 | hi! link DiagnosticOk DiffAdd 231 | hi! link DiagnosticWarn WarningMsg 232 | " The other Diagnostic* groups should link to the above by default, 233 | " except DiagnosticUnderline*, which are given explicit values earlier. 234 | hi! link NormalFloat Normal 235 | hi! link FloatBorder MoreMsg 236 | hi! link FloatTitle Title 237 | hi! link FloatFooter Title 238 | hi! link WinSeparator VertSplit 239 | hi! link WinBar StatusLine 240 | hi! link WinBarNC StatusLineNC 241 | 242 | hi! link LspReferenceText Visual 243 | hi! link LspReferenceRead WildMenu 244 | hi! link LspReferenceWrite PmenuSel 245 | hi! link LspInlayHint EndOfBuffer 246 | hi! link LspCodeLens NonText 247 | hi! link LspCodeLensSeparator NonText 248 | hi! link LspSignatureActiveParameter Visual 249 | " The @lsp.type.* and @lsp.mod.* groups from :h lsp-semantic-highlight 250 | " seem to be sensible links by default, and @lsp.typemod.* groups are 251 | " missing from the helpfile so I assume they are basically experimental. 252 | " Either way that stuff is arguably too exotic to be expected of a 253 | " colorscheme by default. 254 | hi! link @variable Identifier 255 | hi! link @variable.builtin Special 256 | hi! link @variable.parameter Identifier 257 | hi! link @variable.parameter.builtin Special 258 | hi! link @variable.member Identifier 259 | hi! link @constant Constant 260 | hi! link @constant.builtin Special 261 | hi! link @constant.macro Macro 262 | hi! link @module Structure 263 | hi! link @module.builtin Special 264 | hi! link @label Label 265 | hi! link @string String 266 | hi! link @string.documentation Comment 267 | hi! link @string.regexp Special 268 | hi! link @string.escape Special 269 | hi! link @string.special Special 270 | hi! link @string.special.symbol Special 271 | hi! link @string.special.path Special 272 | hi! link @string.special.url Underline 273 | hi! link @character Character 274 | hi! link @character.special SpecialChar 275 | hi! link @boolean Boolean 276 | hi! link @number Number 277 | hi! link @number.float Float 278 | hi! link @type Type 279 | hi! link @type.builtin Special 280 | hi! link @type.definition Typedef 281 | hi! link @attribute Macro 282 | hi! link @attribute.builtin Special 283 | hi! link @property Identifier 284 | hi! link @function Function 285 | hi! link @function.builtin Special 286 | hi! link @function.call Function 287 | hi! link @function.macro Macro 288 | hi! link @function.method Function 289 | hi! link @function.method.call Function 290 | hi! link @constructor Function 291 | hi! link @operator Operator 292 | hi! link @keyword Keyword 293 | hi! link @keyword.coroutine Keyword 294 | hi! link @keyword.function Keyword 295 | hi! link @keyword.operator Keyword 296 | hi! link @keyword.import Keyword 297 | hi! link @keyword.type Keyword 298 | hi! link @keyword.modifier Keyword 299 | hi! link @keyword.repeat Keyword 300 | hi! link @keyword.return Keyword 301 | hi! link @keyword.debug Keyword 302 | hi! link @keyword.exception Keyword 303 | hi! link @keyword.conditional Keyword 304 | hi! link @keyword.conditional.ternary Keyword 305 | hi! link @keyword.directive Keyword 306 | hi! link @keyword.directive.define Keyword 307 | hi! link @punctuation.delimiter Delimiter 308 | hi! link @punctuation.bracket Delimiter 309 | hi! link @punctuation.special Special 310 | hi! link @comment Comment 311 | hi! link @comment.documentation Comment 312 | hi! link @comment.error ErrorMsg 313 | hi! link @comment.warning WarningMsg 314 | hi! link @comment.todo Todo 315 | hi! link @comment.note MoreMsg 316 | hi! link @markup.heading Title 317 | hi! link @markup.heading.1 Title 318 | hi! link @markup.heading.2 Title 319 | hi! link @markup.heading.3 Title 320 | hi! link @markup.heading.4 Title 321 | hi! link @markup.heading.5 Title 322 | hi! link @markup.heading.6 Title 323 | hi! link @markup.quote Special 324 | hi! link @markup.math Special 325 | hi! link @markup.link Underlined 326 | hi! link @markup.link.label Underlined 327 | hi! link @markup.link.url Underlined 328 | hi! link @markup.raw Special 329 | hi! link @markup.raw.block Special 330 | hi! link @markup.list Operator 331 | hi! link @markup.list.checked Operator 332 | hi! link @markup.list.unchecked Operator 333 | hi! link @diff.plus DiffAdd 334 | hi! link @diff.minus DiffDelete 335 | hi! link @diff.delta DiffChange 336 | hi! link @tag Tag 337 | hi! link @tag.builtin Tag 338 | hi! link @tag.attribute Tag 339 | hi! link @tag.delimiter Tag 340 | endif 341 | 342 | " Set terminal colors. {{{1 343 | 344 | if s:opt_terminal_colors 345 | if has('nvim') 346 | for idx in range(16) 347 | call nvim_set_var('terminal_color_' . idx, s:colors[idx]) 348 | endfor 349 | elseif has('terminal') 350 | let g:terminal_ansi_colors = s:colors 351 | endif 352 | endif 353 | 354 | " Set optional statusline groups, see :h hl-User1 {{{1 355 | 356 | if s:opt_user_colors 357 | if &background ==# 'light' 358 | " Colors for statusline diagnostics: red (1) and green (2). 359 | exe s:hi('default User1', 11, 1, 'bold') 360 | exe s:hi('default User2', 11, 2, 'bold') 361 | " Subtle colors for miscellaneous indicators: sand (3) and gray (4). 362 | exe s:hi('default User3', 11, 3) 363 | exe s:hi('default User4', 11, 12) 364 | " Inverse colors for mode indicators: 365 | " cordovan (5), green (6), orange (7), red (8) and blue (9) 366 | exe s:hi('default User5', 13, 11, 'bold') 367 | exe s:hi('default User6', 2, 11, 'bold') 368 | exe s:hi('default User7', 14, 11, 'bold') 369 | exe s:hi('default User8', 1, 11, 'bold') 370 | exe s:hi('default User9', 4, 11, 'bold') 371 | 372 | else 373 | " Colors for statusline diagnostics: red (1) and green (2). 374 | exe s:hi('default User1', 5, 9, 'bold') 375 | exe s:hi('default User2', 5, 10, 'bold') 376 | " Subtle colors for miscellaneous indicators: sand (3) and gray (4). 377 | exe s:hi('default User3', 5, 3) 378 | exe s:hi('default User4', 5, 12) 379 | " Inverse colors for mode indicators: 380 | " cordovan (5), green (6), orange (7), red (8) and blue (9) 381 | exe s:hi('default User5', 13, 11, 'bold') 382 | exe s:hi('default User6', 2, 11, 'bold') 383 | exe s:hi('default User7', 6, 11, 'bold') 384 | exe s:hi('default User8', 1, 11, 'bold') 385 | exe s:hi('default User9', 4, 11, 'bold') 386 | endif 387 | endif 388 | 389 | " }}} 390 | --------------------------------------------------------------------------------