Skip to content

Commit

Permalink
add a bunch of syntaxes and neovim terminal mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cormacrelf committed Nov 14, 2018
1 parent da6b2b8 commit acb712c
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 17 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,27 @@ I wasn't happy with [endel/vim-github-colorscheme](https://github.com/endel/vim-

It degrades gracefully in non-gui mode (ie ctermbg/ctermfg/256colors).

It supports the following **plugins**:
It supports the following plugins:
[airline](https://github.com/vim-airline/vim-airline),
[lightline](https://github.com/vim-airline/lightline),
[fzf](https://github.com/junegunn/fzf),
[GitGutter](https://github.com/airblade/vim-gitgutter),
[NERDTree](https://github.com/scrooloose/nerdtree),
[Startify](https://github.com/mhinz/vim-startify),
[sneak](https://github.com/justinmk/vim-sneak).

Extra tuning has been done for the following **languages**:
VimL, Diff, C, Rust, Go (`fatih/vim-go`), Haskell
(`neovimhaskell/haskell-vim`),
Ruby, Python, Html, Xml, Toml, Yaml, Typescript. Though be aware, GitHub
doesn't use many colors, so tuning is minimal.
[sneak](https://github.com/justinmk/vim-sneak),
and `:terminal`.

Extra tuning has been done for the following languages:
VimL, Markdown, Pandoc Markdown
([vim-pandoc-syntax](https://github.com/vim-pandoc/vim-pandoc-syntax))
Diff, C, Rust,
Go ([fatih/vim-go](https://github.com/fatih/vim-go)),
Haskell
([neovimhaskell/haskell-vim](https://github.com/neovimhaskell/haskell-vim)),
Ruby, Python, HTML, XML, TOML, YAML, Clojure, Typescript,
([leafgarland/vim-typescript](https://github.com/leafgarland/vim-typescript)),
JSX/TSX
([MaxMEllon/vim-jsx-pretty](https://github.com/MaxMEllon/vim-jsx-pretty)),.


## Install
Expand Down
91 changes: 82 additions & 9 deletions colors/github.vim
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function! s:Attr(group, attr)
endfunction

function! s:Spell(group, attr)
let l:attrs = [a:group, 'guisp=' . a:attr]
let l:attrs = [a:group, 'guisp=' . s:colors[a:attr].gui ]
call s:Highlight(l:attrs)
endfunction

Expand Down Expand Up @@ -126,12 +126,13 @@ let s:colors.base3 = s:lib.numDarkest
" actual colorful colors {{{
let s:colors.red = { 'gui': '#d73a49', 'cterm': 167 } " github syntax
let s:colors.darkred = { 'gui': '#b31d28', 'cterm': 124 } " github syntax
let s:colors.orange = { 'gui': '#e36209', 'cterm': 166 } " github syntax
let s:colors.purple = { 'gui': '#6f42c1', 'cterm': 61 } " github syntax
let s:colors.darkpurple = { 'gui': '#352650', 'cterm': 237 } " ^- darkened
let s:colors.purple = { 'gui': '#6f42c1', 'cterm': 91 } " github syntax
let s:colors.darkpurple = { 'gui': '#45267d', 'cterm': 237 } " ^- darkened
let s:colors.yellow = { 'gui': '#ffffc5', 'cterm': 230 } " github search
let s:colors.green = { 'gui': '#22863a', 'cterm': 29 } " github syntax (html)
let s:colors.boldgreen = { 'gui': '#3ebc5c', 'cterm': 29 } " ^
let s:colors.orange = { 'gui': '#e36209', 'cterm': 166 } " github syntax
let s:colors.boldorange = { 'gui': '#f18338', 'cterm': 166 } " ^
let s:colors.lightgreen_nr = { 'gui': '#cdffd8', 'cterm': 85 } " github diff
let s:colors.lightgreen = { 'gui': '#e6ffed', 'cterm': 85 } " github diff
let s:colors.lightred_nr = { 'gui': '#ffdce0', 'cterm': 167 } " github diff
Expand Down Expand Up @@ -220,7 +221,8 @@ call s:Col('MatchParen', 'darkblue', 'blue3')
call s:Col('WarningMsg', 'orange')
call s:Col('ErrorMsg', 'darkred')
call s:Col('Error', 'gutter', 'darkred')
call s:Col('Title', 'blue')
call s:Col('Title', 'base1')
call s:Attr('Title', 'bold')

call s:Col('VertSplit', 'grey1', 'grey1')
call s:Col('LineNr', 'base4', 'gutter')
Expand Down Expand Up @@ -253,8 +255,8 @@ call s:Col('airlineReplace2', 'grey1', 'darkred')

call s:Col('Pmenu', 'base3', 'overlay')
call s:Col('PmenuSel', 'overlay', 'blue') | call s:Attr('PmenuSel', 'bold')
call s:Col('PmenuSbar', '', 'overlay')
call s:Col('PmenuThumb', '', 'blue')
call s:Col('PmenuSbar', '', 'grey2')
call s:Col('PmenuThumb', '', 'grey0')


" hit enter to continue
Expand All @@ -270,6 +272,38 @@ call s:Col('DiffDelete', 'base4', 'lightred') | call s:Attr('DiffDelete', 'none'
call s:Col('DiffChange', '', 'lightorange')
call s:Col('DiffText', '', 'difftext')

" nvim :terminal mode
if has('nvim')
let g:terminal_color_0 = s:colors.base4.gui
let g:terminal_color_8 = s:colors.base3.gui

let g:terminal_color_1 = s:colors.red.gui
let g:terminal_color_9 = s:colors.darkred.gui

let g:terminal_color_2 = s:colors.boldgreen.gui
let g:terminal_color_10 = s:colors.green.gui

let g:terminal_color_3 = s:colors.boldorange.gui
let g:terminal_color_11 = s:colors.orange.gui

let g:terminal_color_4 = s:colors.blue.gui
let g:terminal_color_12 = s:colors.darkblue.gui

let g:terminal_color_5 = s:colors.purple.gui
let g:terminal_color_13 = s:colors.darkpurple.gui

" should be "cyan", but this is good enough
let g:terminal_color_6 = s:colors.blue.gui
let g:terminal_color_14 = s:colors.darkblue.gui

let g:terminal_color_7 = s:colors.base1.gui
let g:terminal_color_15 = s:colors.base0.gui
endif

" Park this for later
" https://terminal.sexy/#9vj6JCkuKCousx0oL4tF7Y1LAy9iRSZ9XL32yNHbNztB1zpJPrxc8YM4AFzFb0LBMuD73eLn
" let @k = "\<c-w>l:so $VIM_INIT\<cr>:bd!\<cr>:vspl\<cr>:term\<cr>Afish\<cr>colortest.sh\<cr>ls\<cr>\<esc>\<c-w>h"

" }}}

" {{{ Syntax highlighting
Expand All @@ -287,11 +321,11 @@ call s:Col('Statement', 'red')
call s:Col('Type', 'red')
call s:Col('Todo', 'purple') | call s:Attr('Todo', 'underline')
call s:Col('Special', 'purple')
call s:Col('SpecialComment', 'base0')
call s:Col('Label', 'base0')
call s:Col('StorageClass', 'red')
call s:Col('Structure', 'red')


" Particular Languages {{{

hi link cDefine Define
Expand All @@ -310,6 +344,19 @@ hi link htmlTagName xmlTagName
hi link htmlArg xmlAttrib
hi link htmlLink Underlined

" vim-jsx-pretty
hi link jsxTag htmlTag
hi link jsxCloseTag jsxTag
hi link jsxCloseString jsxTag
hi link jsxAttrib xmlAttrib
hi link jsxEqual Operator
hi link jsxTagName htmlTagName
call s:Col('jsxComponentName', 'blue')
" TODO: maybe make extra italics an option
" call s:Attr('jsxComponentName', 'italic')
" call s:Col('jsxAttrib', 'purple')
" call s:Attr('jsxAttrib', 'italic')

" toml
hi link tomlTable ghPurple
hi link tomlKey ghBlack
Expand Down Expand Up @@ -342,7 +389,7 @@ hi link vimOption Identifier
hi link vimUserCommand Identifier
hi link vimAugroupKey Identifier

hi link Delimiter ghBlack
hi link Delimiter Normal
hi link SpecialComment Comment
hi link Character Number
hi link CursorIM Cursor
Expand Down Expand Up @@ -390,6 +437,32 @@ call s:Col('diffSubname', 'darkblue', 'lightblue')
call s:Col('diffAdded', 'green', 'lightgreen')
call s:Col('diffRemoved', 'red', 'lightred')

" vim-pandoc-syntax
call s:Col('pandocAtxStart', 'base4')
call s:Col('pandocOperator', 'red')
call s:Col('pandocDelimitedCodeBlock', 'darkpurple')
call s:Col('pandocNoFormatted', 'base0', 'gutter')
call s:Col('pandocPCite', 'purple')
call s:Col('pandocCitekey', 'purple')

" tex
call s:Col('texMath', 'blue')
call s:Col('texStatement', 'red')
call s:Col('texType', 'purple')
hi link texSection Title

" plain builtin markdown
hi link htmlH Title
hi link markdownListMarker pandocOperator
hi link markdownCode pandocDelimitedCodeBlock
hi link markdownRule Title
hi link markdownHeadingDelimiter pandocAtxStart

" clojure
hi link clojureDefine Type
hi link clojureKeyword Identifier
hi link clojureMacro ghPurple

" }}}

" Plugin Support {{{
Expand Down

0 comments on commit acb712c

Please sign in to comment.