From acb712c76bb73c20eb3d7e625a48b5ff59f150d0 Mon Sep 17 00:00:00 2001 From: Cormac Relf Date: Wed, 14 Nov 2018 20:08:31 +1100 Subject: [PATCH] add a bunch of syntaxes and neovim terminal mode --- README.md | 23 +++++++----- colors/github.vim | 91 ++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 97 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index b105049..c14fb6f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/colors/github.vim b/colors/github.vim index 87bd4e2..904fc80 100644 --- a/colors/github.vim +++ b/colors/github.vim @@ -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 @@ -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 @@ -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') @@ -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 @@ -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 = "\l:so $VIM_INIT\:bd!\:vspl\:term\Afish\colortest.sh\ls\\\h" + " }}} " {{{ Syntax highlighting @@ -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 @@ -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 @@ -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 @@ -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 {{{