├── README.md ├── autoload └── airline │ └── themes │ └── violet.vim └── colors └── violet.vim /README.md: -------------------------------------------------------------------------------- 1 | ## Violet Colorscheme 2 | 3 | Inspired by [Solarized](http://ethanschoonover.com/solarized). An attempt to a better-looking Vim. Neat and clean. 4 | 5 | ![palette](https://github.com/ashfinal/bindata/raw/master/screenshots/vim-colors-violet-palette.png) 6 | 7 | ## Features 8 | 9 | 1. ☯️ Dark & Light 10 | 11 | ![preview](https://github.com/ashfinal/bindata/raw/master/screenshots/vim-colors-violet-preview.png) 12 | 13 | Every colorscheme should have dark and light background modes. 14 | 15 | 2. 🚢 [Airline](https://github.com/vim-airline/vim-airline) Theme 16 | 17 | ![airline](https://github.com/ashfinal/bindata/raw/master/screenshots/vim-colors-violet-airline.png) 18 | 19 | While using `violet` colorscheme, the included airline theme should be loaded automatically. 20 | 21 | 3. 🚥 Straightaway Switch 22 | 23 | `:set background=dark/light` This should do the trick. 24 | 25 | **Tips:** *I recommended to throw those lines below into your `.vimrc` file, then use `leader` + b to quickly switch between dark & light colorschemes.* 26 | 27 | ``` vim 28 | nnoremap b :call ToggleBackground() 29 | function! ToggleBackground() 30 | if &background == "light" 31 | set background=dark 32 | else 33 | set background=light 34 | endif 35 | endfunction 36 | ``` 37 | 38 | 4. 📺 256 Color Palette Mode 39 | 40 | Violet colorscheme was primarily created for 24bit truecolor editor (gvim/macvim), and I try my best to make it work in terminal emulators too. 41 | 42 | If you confirm that your terminal emulator supports 24bit truecolor (https://gist.github.com/XVilka/8346728), use `set termguicolors` to activate it. 43 | 44 | **Attention:** There is noticeable difference between 24bit truecolor mode and 256 color palette mode, due to the absence of approximate colors. 45 | 46 | ## Installation 47 | 48 | If you are using [vim-plug](https://github.com/junegunn/vim-plug): 49 | 50 | Plug 'ashfinal/vim-colors-violet' 51 | 52 | Then add this into your `.vimrc` file: `colorscheme violet`. 53 | 54 | ## Welcome to 55 | 56 | Share your thoughts. :) Any question, file an issue. 57 | -------------------------------------------------------------------------------- /autoload/airline/themes/violet.vim: -------------------------------------------------------------------------------- 1 | let s:oranged = ['#D2691D', '166'] 2 | let s:orangel = ['#D8904C', '172'] 3 | let s:violetd = ['#7B50C6', '93'] 4 | let s:violetl = ['#8763D3', '99'] 5 | let s:greend = ['#67932E', '28'] 6 | let s:greenl = ['#6AA302', '34'] 7 | let s:white = ['#DADADA', '252'] 8 | let s:grey = ['#E5E0D2', '251'] " equal to base1 9 | let s:darkgreyd = ['#8E8E8E', '247'] 10 | let s:darkgreyl = ['#C5BFBB', '250'] 11 | let s:blackd = ['#45484B', '238'] " equal to base01 12 | let s:blackl = ['#6B6A6C', '242'] 13 | 14 | let g:airline#themes#violet#palette = {} 15 | 16 | function! airline#themes#violet#refresh() 17 | let s:background = get(g:, 'airline_violet_bg', &background) 18 | 19 | " [ guifg, guibg, ctermfg, ctermbg, opts ]. See "help attr-list" for valid 20 | " values for the "opt" value. 21 | 22 | " Normal Mode: 23 | if s:background == 'light' 24 | let s:N1 = [ s:white[0], s:darkgreyd[0], s:white[1], s:darkgreyd[1] ] 25 | let s:N2 = [ s:blackl[0], s:darkgreyl[0], s:blackl[1], s:darkgreyl[1] ] 26 | let s:N3 = [ s:blackl[0], s:grey[0], s:blackl[1], s:grey[1] ] 27 | else 28 | let s:N1 = [ s:blackd[0], s:darkgreyd[0], s:blackd[1], s:darkgreyd[1] ] 29 | let s:N2 = [ s:darkgreyl[0], s:blackl[0], s:darkgreyl[1], s:blackl[1] ] 30 | let s:N3 = [ s:darkgreyl[0], s:blackd[0], s:darkgreyl[1], s:blackd[1] ] 31 | endif 32 | 33 | let g:airline#themes#violet#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) 34 | 35 | " Insert Mode: 36 | let s:I1 = [ s:white[0], s:violetd[0], s:white[1], s:violetd[1] ] 37 | let s:I2 = [ s:white[0], s:violetl[0], s:white[1], s:violetl[1] ] 38 | if s:background == 'light' 39 | let s:I3 = [ s:darkgreyd[0], s:grey[0], s:darkgreyd[1], s:grey[1] ] 40 | else 41 | let s:I3 = [ s:darkgreyd[0], s:blackd[0], s:darkgreyd[1], s:blackd[1] ] 42 | endif 43 | 44 | let g:airline#themes#violet#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3) 45 | 46 | " Replace Mode: 47 | let s:R1 = [ s:white[0] , s:oranged[0], s:white[1] , s:oranged[1] ] 48 | let s:R2 = [ s:white[0], s:orangel[0], s:white[1], s:orangel[1] ] 49 | if s:background == 'light' 50 | let s:R3 = [ s:darkgreyd[0], s:grey[0], s:darkgreyd[1], s:grey[1] ] 51 | else 52 | let s:R3 = [ s:darkgreyd[0], s:blackd[0], s:darkgreyd[1], s:blackd[1] ] 53 | endif 54 | 55 | let g:airline#themes#violet#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3) 56 | 57 | " Visual Mode: 58 | let s:V1 = [ s:white[0] , s:greend[0], s:white[1] , s:greend[1] ] 59 | let s:V2 = [ s:white[0], s:greenl[0], s:white[1], s:greenl[1] ] 60 | if s:background == 'light' 61 | let s:V3 = [ s:darkgreyd[0], s:grey[0], s:darkgreyd[1], s:grey[1] ] 62 | else 63 | let s:V3 = [ s:darkgreyd[0], s:blackd[0], s:darkgreyd[1], s:blackd[1] ] 64 | endif 65 | 66 | let g:airline#themes#violet#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3) 67 | 68 | " Inactive: 69 | if s:background == 'light' 70 | let s:IA = [ s:white[0], s:darkgreyd[0], s:white[1], s:darkgreyd[1] ] 71 | else 72 | let s:IA = [ s:darkgreyd[0], s:blackd[0], s:darkgreyd[1], s:blackd[1] ] 73 | endif 74 | let g:airline#themes#violet#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA) 75 | 76 | let g:airline#themes#violet#palette.accents = { 77 | \ 'red': [ '#ff0000' , '' , 160 , '' ] 78 | \ } 79 | endfunction 80 | 81 | call airline#themes#violet#refresh() 82 | -------------------------------------------------------------------------------- /colors/violet.vim: -------------------------------------------------------------------------------- 1 | " Theme: violet 2 | " Author: ashfinal 3 | " License: MIT 4 | " Origin: http://github.com/ashfinal/vim-colors-violet.git 5 | 6 | hi clear 7 | 8 | if exists('syntax on') 9 | syntax reset 10 | endif 11 | 12 | let g:colors_name = "violet" 13 | 14 | " Sets the highlighting for the given group 15 | function! s:HL(group, fg, bg, attr) 16 | if !empty(a:fg) 17 | exec "hi " . a:group . " guifg=" . a:fg[0] . " ctermfg=" . a:fg[1] 18 | endif 19 | if !empty(a:bg) 20 | exec "hi " . a:group . " guibg=" . a:bg[0] . " ctermbg=" . a:bg[1] 21 | endif 22 | if a:attr != "" 23 | exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr 24 | endif 25 | endfunction 26 | 27 | " Color Palette: {{{ 28 | 29 | let s:is_dark=(&background == 'dark') 30 | 31 | let s:base03 = ['#25272a', '234'] 32 | let s:base02 = ['#292b2e', '235'] 33 | let s:base01 = ['#45484b', '238'] 34 | let s:base00 = ['#657b83', '66'] 35 | let s:base0 = ['#839496', '102'] 36 | let s:base1 = ['#e5e0d2', '251'] 37 | let s:base2 = ['#eee8d5', '253'] 38 | let s:base3 = ['#fdf6e3', '254'] 39 | let s:yellow = ['#b58900', '136'] 40 | let s:orange = ['#cb4b16', '166'] 41 | let s:red = ['#dc322f', '196'] 42 | let s:magenta = ['#d33682', '168'] 43 | let s:violet = ['#6c71c4', '62'] 44 | let s:blue = ['#268bd2', '32'] 45 | let s:cyan = ['#2aa198', '28'] 46 | let s:green = ['#859900', '30'] 47 | 48 | if s:is_dark == 0 " LIGHT VARIANT 49 | let s:temp03 = s:base03 50 | let s:temp02 = s:base02 51 | let s:temp01 = s:base01 52 | let s:temp00 = s:base00 53 | let s:base03 = s:base3 54 | let s:base02 = s:base2 55 | let s:base01 = s:base1 56 | let s:base00 = s:base0 57 | let s:base0 = s:temp00 58 | let s:base1 = s:temp01 59 | let s:base2 = s:temp02 60 | let s:base3 = s:temp03 61 | endif 62 | " }}} 63 | 64 | " Syntax Highlighting: {{{ 65 | 66 | call s:HL("Normal", s:base0, s:base03, "") 67 | 68 | " Switching between dark & light variant through `set background` 69 | " https://github.com/NLKNguyen/papercolor-theme/pull/20 70 | if s:is_dark " DARK VARIANT 71 | set background=dark 72 | else " LIGHT VARIANT 73 | set background=light 74 | endif 75 | 76 | " Basic highlighting 77 | call s:HL("Comment", s:base00, "", "") 78 | call s:HL("Constant", s:cyan, "", "") 79 | call s:HL("Identifier", s:blue, "", "") 80 | call s:HL("Statement", s:green, "", "") 81 | call s:HL("PreProc", s:orange, "", "") 82 | call s:HL("Type", s:yellow, "", "") 83 | call s:HL("Special", s:violet, "", "") 84 | call s:HL("Underlined", s:violet, "", "") 85 | call s:HL("Ignore", "", "", "") 86 | call s:HL("Error", s:red, s:base03, "bold") 87 | call s:HL("Todo", s:magenta, s:base03, "bold") 88 | 89 | " Extended highlighting 90 | call s:HL("SpecialKey", s:base00, s:base02, "bold") 91 | call s:HL("NonText", s:base00, "", "bold") 92 | call s:HL("StatusLine", s:base01, s:base0, "") 93 | call s:HL("StatusLineNC", s:base01, s:base00, "") 94 | call s:HL("Visual", s:base03, s:violet, "") 95 | call s:HL("Directory", s:blue, "", "") 96 | call s:HL("ErrorMsg", s:red, s:base03, "") 97 | call s:HL("IncSearch", s:orange, "", "") 98 | call s:HL("Search", s:base03, s:yellow, "") 99 | call s:HL("MoreMsg", s:blue, s:base03, "") 100 | call s:HL("ModeMsg", s:blue, s:base03, "") 101 | call s:HL("Question", s:cyan, "", "bold") 102 | call s:HL("VertSplit", s:base01, s:base01, "") 103 | call s:HL("Title", s:orange, "", "bold") 104 | call s:HL("VisualNOS", "", s:base02, "") 105 | call s:HL("WarningMsg", s:orange, s:base03, "bold") 106 | call s:HL("WildMenu", s:base01, s:base0, "") 107 | call s:HL("Folded", s:base00, ["NONE","NONE"], "bold") 108 | call s:HL("FoldColumn", s:base0, s:base03, "") 109 | call s:HL("LineNr", s:base01, "", "") 110 | call s:HL("DiffAdd", s:green, s:base01, "bold") 111 | call s:HL("DiffChange", s:yellow, s:base01, "bold") 112 | call s:HL("DiffDelete", s:red, s:base01, "bold") 113 | call s:HL("DiffText", s:blue, s:base01, "bold") 114 | call s:HL("SignColumn", s:base0, s:base03, "") 115 | call s:HL("Conceal", s:blue, "", "bold") 116 | call s:HL("Pmenu", s:base0, s:base01, "") 117 | call s:HL("PmenuSel", s:base01, s:base0, "") 118 | call s:HL("PmenuSbar", s:base01, s:base00, "") 119 | call s:HL("PmenuThumb", s:base0, s:base0, "") 120 | call s:HL("TabLine", s:base01, s:base0, "") 121 | call s:HL("TabLineFill", s:base01, s:base0, "") 122 | call s:HL("TabLineSel", s:base01, s:base00, "") 123 | call s:HL("CursorLine", "", s:base02, "NONE") 124 | call s:HL("ColorColumn", "", s:base02, "") 125 | call s:HL("Cursorcolumn", "", s:base02, "") 126 | call s:HL("Cursor", s:base03, s:base0, "") 127 | call s:HL("MatchParen", s:base03, s:base00, "") 128 | " }}} 129 | 130 | " vim:set et sw=4 ts=4 fdm=marker tw=78: 131 | --------------------------------------------------------------------------------