├── Makefile ├── README.rst ├── colors └── 256_noir.vim ├── gen.py └── screenshot.png /Makefile: -------------------------------------------------------------------------------- 1 | default: 2 | python gen.py >colors/256_noir.vim 3 | 4 | install: default 5 | cp colors/256_noir.vim ~/.vim/colors/ 6 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | vim-256noir 2 | =========== 3 | A dark 256-color color scheme for vim. 4 | 5 | Have you ever wondered why most syntax highlighting of source code is about as 6 | subtle and pretty as a candy shop explosion? A technical reason is the 7 | historical constraints imposed by 16 color terminals, but fortunately this 8 | limitation is easy to overcome. 9 | 10 | Features 11 | -------- 12 | * Minimal colors, to avoid distracting: 13 | 14 | - Shades of gray for most elements 15 | - Bright keywords to highlight structure. 16 | - Dark comments & strings to emphasize surrounding code. 17 | - Red for exceptional elements (constants & errors) 18 | 19 | * Works in ``vim`` and ``gvim``. Rudimentary support for 16-color terminals. 20 | 21 | Usage 22 | ----- 23 | - Enable `256 colors in vim `_. 24 | Note that when using ``ssh``, both client and server need to be properly configured. 25 | - Put ``256_noir.vim`` in ~/.vim/colors/ 26 | - Add the following to ``~/.vimrc``: 27 | 28 | .. code-block:: vim 29 | 30 | colorscheme 256_noir 31 | 32 | " Change highlighting of cursor line when entering/leaving Insert Mode 33 | set cursorline 34 | highlight CursorLine cterm=NONE ctermfg=NONE ctermbg=233 guifg=NONE guibg=#121212 35 | autocmd InsertEnter * highlight CursorLine cterm=NONE ctermfg=NONE ctermbg=234 guifg=NONE guibg=#1c1c1c 36 | autocmd InsertLeave * highlight CursorLine cterm=NONE ctermfg=NONE ctermbg=233 guifg=NONE guibg=#121212 37 | 38 | .. image:: screenshot.png 39 | :alt: screenshot of vim with noir colorscheme 40 | 41 | The font in the above screenshots is the default xterm bitmap font 42 | `fixed `_ at 6x13. 43 | 44 | Bonus 45 | ----- 46 | - `mc `_, add the following to e.g. ``~/.bashrc``: 47 | 48 | .. code-block:: bash 49 | 50 | export MC_SKIN=dark 51 | 52 | - `mutt `_, add the following to ``~/.muttrc``:: 53 | 54 | color normal white default 55 | color status black white 56 | color indicator white red 57 | color hdrdefault yellow default 58 | color signature yellow default 59 | color attachment brightyellow default 60 | color markers brightred default 61 | color quoted green default 62 | color tilde blue default 63 | color tree red default 64 | 65 | Other recommended terminal apps with dark colors by default: 66 | 67 | - https://ranger.github.io/ 68 | - http://hisham.hm/htop/ 69 | - https://github.com/andreasvc/cplay/ 70 | -------------------------------------------------------------------------------- /colors/256_noir.vim: -------------------------------------------------------------------------------- 1 | " Vim color file 2 | " Name: 256_noir.vim 3 | " Maintainer: Andreas van Cranenburgh 4 | " Homepage: https://github.com/andreasvc/vim-256noir/ 5 | 6 | " Basically: dark background, numerals & errors red, 7 | " rest different shades of gray. 8 | " 9 | " colors 232--250 are shades of gray, from dark to light; 10 | " 16=black, 255=white, 196=red, 88=darkred. 11 | 12 | highlight clear 13 | set background=dark 14 | if version > 580 15 | " no guarantees for version 5.8 and below, but this makes it stop 16 | " complaining 17 | if exists("syntax_on") 18 | syntax reset 19 | endif 20 | endif 21 | let g:colors_name = "256_noir" 22 | 23 | if has("gui_running") || &t_Co == 256 24 | hi Normal cterm=NONE ctermfg=250 ctermbg=16 gui=NONE guifg=#bcbcbc guibg=#000000 25 | hi Keyword cterm=NONE ctermfg=255 ctermbg=16 gui=NONE guifg=#eeeeee guibg=#000000 26 | hi Constant cterm=NONE ctermfg=252 ctermbg=16 gui=NONE guifg=#d0d0d0 guibg=#000000 27 | hi String cterm=NONE ctermfg=245 ctermbg=16 gui=NONE guifg=#8a8a8a guibg=#000000 28 | hi Comment cterm=NONE ctermfg=240 ctermbg=16 gui=NONE guifg=#585858 guibg=#000000 29 | hi Number cterm=NONE ctermfg=196 ctermbg=16 gui=NONE guifg=#ff0000 guibg=#000000 30 | hi Error cterm=NONE ctermfg=255 ctermbg=88 gui=NONE guifg=#eeeeee guibg=#870000 31 | hi ErrorMsg cterm=NONE ctermfg=255 ctermbg=124 gui=NONE guifg=#eeeeee guibg=#af0000 32 | hi Search cterm=NONE ctermfg=245 ctermbg=236 gui=NONE guifg=#8a8a8a guibg=#303030 33 | hi IncSearch cterm=reverse ctermfg=255 ctermbg=245 gui=reverse guifg=#eeeeee guibg=#8a8a8a 34 | hi DiffChange cterm=NONE ctermfg=160 ctermbg=255 gui=NONE guifg=#d70000 guibg=#eeeeee 35 | hi DiffText cterm=bold ctermfg=250 ctermbg=196 gui=bold guifg=#bcbcbc guibg=#ff0000 36 | hi SignColumn cterm=NONE ctermfg=124 ctermbg=240 gui=NONE guifg=#af0000 guibg=#585858 37 | hi SpellBad cterm=undercurl ctermfg=255 ctermbg=88 gui=undercurl guifg=#eeeeee guibg=#870000 38 | hi SpellCap cterm=NONE ctermfg=255 ctermbg=124 gui=NONE guifg=#eeeeee guibg=#af0000 39 | hi SpellRare cterm=NONE ctermfg=124 ctermbg=16 gui=NONE guifg=#af0000 guibg=#000000 40 | hi WildMenu cterm=NONE ctermfg=240 ctermbg=255 gui=NONE guifg=#585858 guibg=#eeeeee 41 | hi Pmenu cterm=NONE ctermfg=255 ctermbg=240 gui=NONE guifg=#eeeeee guibg=#585858 42 | hi PmenuThumb cterm=NONE ctermfg=232 ctermbg=240 gui=NONE guifg=#080808 guibg=#585858 43 | hi SpecialKey cterm=NONE ctermfg=16 ctermbg=255 gui=NONE guifg=#000000 guibg=#eeeeee 44 | hi MatchParen cterm=NONE ctermfg=16 ctermbg=240 gui=NONE guifg=#000000 guibg=#585858 45 | hi CursorLine cterm=NONE ctermfg=NONE ctermbg=233 gui=NONE guifg=NONE guibg=#121212 46 | hi StatusLine cterm=bold,reverse ctermfg=245 ctermbg=16 gui=bold,reverse guifg=#8a8a8a guibg=#000000 47 | hi StatusLineNC cterm=reverse ctermfg=236 ctermbg=16 gui=reverse guifg=#303030 guibg=#000000 48 | hi Visual cterm=reverse ctermfg=250 ctermbg=16 gui=reverse guifg=#bcbcbc guibg=#000000 49 | hi TermCursor cterm=reverse ctermfg=NONE ctermbg=NONE gui=reverse guifg=NONE guibg=NONE 50 | else 51 | hi Normal cterm=NONE ctermfg=Gray ctermbg=Black 52 | hi Keyword cterm=NONE ctermfg=White ctermbg=Black 53 | hi Constant cterm=NONE ctermfg=Gray ctermbg=Black 54 | hi String cterm=NONE ctermfg=Gray ctermbg=Black 55 | hi Comment cterm=NONE ctermfg=DarkGray ctermbg=Black 56 | hi Number cterm=NONE ctermfg=Red ctermbg=Black 57 | hi Error cterm=NONE ctermfg=White ctermbg=DarkRed 58 | hi ErrorMsg cterm=NONE ctermfg=White ctermbg=Red 59 | hi Search cterm=NONE ctermfg=Gray ctermbg=DarkGray 60 | hi IncSearch cterm=reverse ctermfg=White ctermbg=Gray 61 | hi DiffChange cterm=NONE ctermfg=Red ctermbg=White 62 | hi DiffText cterm=bold ctermfg=Gray ctermbg=Red 63 | hi SignColumn cterm=NONE ctermfg=Red ctermbg=DarkGray 64 | hi SpellBad cterm=undercurl ctermfg=White ctermbg=DarkRed 65 | hi SpellCap cterm=NONE ctermfg=White ctermbg=Red 66 | hi SpellRare cterm=NONE ctermfg=Red ctermbg=Black 67 | hi WildMenu cterm=NONE ctermfg=DarkGray ctermbg=White 68 | hi Pmenu cterm=NONE ctermfg=White ctermbg=DarkGray 69 | hi PmenuThumb cterm=NONE ctermfg=Black ctermbg=DarkGray 70 | hi SpecialKey cterm=NONE ctermfg=Black ctermbg=White 71 | hi MatchParen cterm=NONE ctermfg=Black ctermbg=DarkGray 72 | hi CursorLine cterm=NONE ctermfg=NONE ctermbg=Black 73 | hi StatusLine cterm=bold,reverse ctermfg=Gray ctermbg=Black 74 | hi StatusLineNC cterm=reverse ctermfg=DarkGray ctermbg=Black 75 | hi Visual cterm=reverse ctermfg=Gray ctermbg=Black 76 | hi TermCursor cterm=reverse ctermfg=NONE ctermbg=NONE 77 | endif 78 | highlight! link Boolean Normal 79 | highlight! link Delimiter Normal 80 | highlight! link Identifier Normal 81 | highlight! link Title Normal 82 | highlight! link Debug Normal 83 | highlight! link Exception Normal 84 | highlight! link FoldColumn Normal 85 | highlight! link Macro Normal 86 | highlight! link ModeMsg Normal 87 | highlight! link MoreMsg Normal 88 | highlight! link Question Normal 89 | highlight! link Conditional Keyword 90 | highlight! link Statement Keyword 91 | highlight! link Operator Keyword 92 | highlight! link Structure Keyword 93 | highlight! link Function Keyword 94 | highlight! link Include Keyword 95 | highlight! link Type Keyword 96 | highlight! link Typedef Keyword 97 | highlight! link Todo Keyword 98 | highlight! link Label Keyword 99 | highlight! link Define Keyword 100 | highlight! link DiffAdd Keyword 101 | highlight! link diffAdded Keyword 102 | highlight! link diffCommon Keyword 103 | highlight! link Directory Keyword 104 | highlight! link PreCondit Keyword 105 | highlight! link PreProc Keyword 106 | highlight! link Repeat Keyword 107 | highlight! link Special Keyword 108 | highlight! link SpecialChar Keyword 109 | highlight! link StorageClass Keyword 110 | highlight! link SpecialComment String 111 | highlight! link CursorLineNr String 112 | highlight! link Character Number 113 | highlight! link Float Number 114 | highlight! link Tag Number 115 | highlight! link Folded Number 116 | highlight! link WarningMsg Number 117 | highlight! link iCursor SpecialKey 118 | highlight! link SpellLocal SpellCap 119 | highlight! link LineNr Comment 120 | highlight! link NonText Comment 121 | highlight! link DiffDelete Comment 122 | highlight! link diffRemoved Comment 123 | highlight! link PmenuSbar Visual 124 | highlight! link PmenuSel Visual 125 | highlight! link VisualNOS Visual 126 | highlight! link VertSplit Visual 127 | highlight! link Cursor StatusLine 128 | highlight! link Underlined SpellRare 129 | highlight! link rstEmphasis SpellRare 130 | highlight! link diffChanged DiffChange 131 | -------------------------------------------------------------------------------- /gen.py: -------------------------------------------------------------------------------- 1 | """Script to generate vim color scheme. 2 | 3 | Generates a vim color scheme that works with 256 and 16 color terminals, 4 | as well as in gvim.""" 5 | 6 | PREAMBLE = """\ 7 | " Vim color file 8 | " Name: 256_noir.vim 9 | " Maintainer: Andreas van Cranenburgh 10 | " Homepage: https://github.com/andreasvc/vim-256noir/ 11 | 12 | " Basically: dark background, numerals & errors red, 13 | " rest different shades of gray. 14 | " 15 | " colors 232--250 are shades of gray, from dark to light; 16 | " 16=black, 255=white, 196=red, 88=darkred. 17 | 18 | highlight clear 19 | set background=dark 20 | if version > 580 21 | " no guarantees for version 5.8 and below, but this makes it stop 22 | " complaining 23 | if exists("syntax_on") 24 | syntax reset 25 | endif 26 | endif 27 | let g:colors_name = "256_noir" 28 | """ 29 | 30 | # Group ctermfg ctermbg cterm 31 | COLORS = """ 32 | Normal 250 16 NONE 33 | Keyword 255 16 NONE 34 | Constant 252 16 NONE 35 | String 245 16 NONE 36 | Comment 240 16 NONE 37 | Number 196 16 NONE 38 | Error 255 88 NONE 39 | ErrorMsg 255 124 NONE 40 | Search 245 236 NONE 41 | IncSearch 255 245 reverse 42 | DiffChange 160 255 NONE 43 | DiffText 250 196 bold 44 | SignColumn 124 240 NONE 45 | SpellBad 255 88 undercurl 46 | SpellCap 255 124 NONE 47 | SpellRare 124 16 NONE 48 | WildMenu 240 255 NONE 49 | Pmenu 255 240 NONE 50 | PmenuThumb 232 240 NONE 51 | SpecialKey 16 255 NONE 52 | MatchParen 16 240 NONE 53 | CursorLine NONE 233 NONE 54 | StatusLine 245 16 bold,reverse 55 | StatusLineNC 236 16 reverse 56 | Visual 250 16 reverse 57 | TermCursor NONE NONE reverse 58 | """ 59 | 60 | # First tuple element has highlight, rest is linked to it. 61 | LINKS = [ 62 | ('Normal', 'Boolean', 'Delimiter', 'Identifier', 'Title', 'Debug', 63 | 'Exception', 'FoldColumn', 'Macro', 'ModeMsg', 'MoreMsg', 64 | 'Question'), 65 | ('Keyword', 'Conditional', 'Statement', 'Operator', 'Structure', 66 | 'Function', 'Include', 'Type', 'Typedef', 'Todo', 'Label', 67 | 'Define', 'DiffAdd', 'diffAdded', 'diffCommon', 'Directory', 68 | 'PreCondit', 'PreProc', 'Repeat', 'Special', 'SpecialChar', 69 | 'StorageClass'), 70 | ('String', 'SpecialComment', 'CursorLineNr'), 71 | ('Number', 'Character', 'Float', 'Tag', 'Folded', 'WarningMsg'), 72 | ('SpecialKey', 'iCursor'), 73 | ('SpellCap', 'SpellLocal'), 74 | ('Comment', 'LineNr', 'NonText', 'DiffDelete', 'diffRemoved'), 75 | ('Visual', 'PmenuSbar', 'PmenuSel', 'VisualNOS', 'VertSplit'), 76 | ('StatusLine', 'Cursor'), 77 | ('SpellRare', 'Underlined', 'rstEmphasis'), 78 | ('DiffChange', 'diffChanged'), 79 | ] 80 | 81 | TORGB = { 82 | 16: '#000000', 83 | 88: '#870000', 84 | 124: '#af0000', 85 | 160: '#d70000', 86 | 196: '#ff0000', 87 | 232: '#080808', 88 | 233: '#121212', 89 | 234: '#1c1c1c', 90 | 236: '#303030', 91 | 240: '#585858', 92 | 245: '#8a8a8a', 93 | 250: '#bcbcbc', 94 | 252: '#d0d0d0', 95 | 255: '#eeeeee', 96 | 'NONE': 'NONE', 97 | } 98 | 99 | TO16 = { 100 | 16: 'Black', 101 | 88: 'DarkRed', 102 | 124: 'Red', 103 | 160: 'Red', 104 | 196: 'Red', 105 | 232: 'Black', 106 | 233: 'Black', 107 | 234: 'DarkGray', 108 | 236: 'DarkGray', 109 | 240: 'DarkGray', 110 | 245: 'Gray', 111 | 250: 'Gray', 112 | 252: 'Gray', 113 | 255: 'White', 114 | 'NONE': 'NONE', 115 | } 116 | 117 | if __name__ == '__main__': 118 | table = [(key, term, 119 | 'NONE' if fg == 'NONE' else int(fg), 120 | 'NONE' if bg == 'NONE' else int(bg)) 121 | for key, fg, bg, term 122 | in (line.strip().split() for line in COLORS.strip().splitlines())] 123 | print(PREAMBLE) 124 | print('if has("gui_running") || &t_Co == 256') 125 | for key, term, fg, bg in table: 126 | print(' hi %s cterm=%s ctermfg=%s ctermbg=%s' 127 | ' gui=%s guifg=%s guibg=%s' % ( 128 | key, term, fg, bg, 129 | term, TORGB[fg], TORGB[bg])) 130 | print('else') # terminal with less colors, e.g., 88, 16, or 8. 131 | for key, term, fg, bg in table: 132 | print(' hi %s cterm=%s ctermfg=%s ctermbg=%s' % ( 133 | key, term, TO16[fg], TO16[bg])) 134 | print('endif') 135 | for a in LINKS: 136 | for b in a[1:]: 137 | print('highlight! link %s %s' % (b, a[0])) 138 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/andreasvc/vim-256noir/e8668a18a4a90272c1cae87e655f8bddc5ac3665/screenshot.png --------------------------------------------------------------------------------