LoginSignup
18
19

More than 3 years have passed since last update.

Vimを彩る美しきcolorschemeちゃん

Last updated at Posted at 2019-09-04

共通の味付け

" テキスト背景色
au ColorScheme * hi Normal ctermbg=none
" 括弧対応
au ColorScheme * hi MatchParen cterm=bold ctermfg=214 ctermbg=black
" スペルチェック
au Colorscheme * hi SpellBad ctermfg=23 cterm=none ctermbg=none

set background=dark

ターミナルのテーマはNight-Owl

hybrid

GitHub

Tomorrow-Nightの落ち着いた基本色彩とjellybeansの煌びやかなsyntax highlightの融合。
ムーディーな夜の雰囲気とMonokaiのような見易さを両立させている。

スクリーンショット 2019-09-05 5.28.56.png

onedark

GitHub

ここから様々な派生が生まれることとなる言わずと知れたAtomテキストエディタのデフォルトカラースキーム。
ブルー、ピンク、緑の安定した配色は使用者の好みで3色どの方向にも傾けられる。

味付け(onedark)

au ColorScheme * hi LineNr       ctermbg=none ctermfg=240 cterm=italic " 行番号
au ColorScheme * hi StatusLine   ctermbg=none " アクティブなステータスライン
au ColorScheme * hi StatusLineNC ctermbg=none " 非アクティブなステータスライン
au ColorScheme * hi Comment      ctermfg=243 cterm=italic " コメントアウト
au ColorScheme * hi Statement    ctermfg=45
au ColorScheme * hi DiffAdd      ctermbg=24  " 追加行
au ColorScheme * hi Identifier   ctermfg=45 "cterm=bold

Haskell用(onedark)

括弧が見辛かったので

" Haskell
au ColorScheme * hi Haskell01 ctermfg=179 " 黄色
au ColorScheme * hi Haskell02 ctermfg=45  " 水色
au ColorScheme * hi Haskell03 ctermfg=255 " 白

colo onedark

augroup filetypedetect
  au BufRead,BufNewFile *.hs :call ColHaskell()
augroup END

" Haskell 用のシンタックスハイライト
function! ColHaskell()
  au BufWinEnter * let w:m3 = matchadd("Haskell02", '(')
  au WinEnter    * let w:m3 = matchadd("Haskell02", '(')
  au BufWinEnter * let w:m3 = matchadd("Haskell02", ')') 
  au WinEnter    * let w:m3 = matchadd("Haskell02", ')') 
  au BufWinEnter * let w:m3 = matchadd("Haskell02", '$')
  au WinEnter    * let w:m3 = matchadd("Haskell02", '$')
endfunction

スクリーンショット 2019-09-05 5.16.39.png

night-owl

VSCode発祥のカラースキーム。ネーミングセンスありすぎカラースキーム。

闇夜に出会いしオウルはコードの森を旅するあなたに"確かな道"を示してくれるだろう。

GitHub

スクリーンショット 2019-09-05 5.21.50.png

Tomorrow-Night

背景色以外の配色としてはnight-owlの彩度を落とした感じ。night-owlは夕方向けだとしたらtomorrow-Nightは深夜向けか

GitHub

スクリーンショット 2019-09-05 5.12.48.png

デフォルトが好きなもの

nord(oni)

GitHub

icebergと並び寒色を代表するカラースキームの一つ。何か高貴さを感じる

写真はoni

スクリーンショット 2019-09-05 8.37.57.png

iceberg

他のカラースキームに比べ色分けが極端に少ない。
そこから生まれる硬派な雰囲気が「そこにシビれる憧れる〜。」

スクリーンショット 2019-09-07 16.01.58.png

まとめ

カラースキームを色々試すのが大好きなので、今まで本当に好きになったカラースキームを
好きになった順にまとめてみました。

自分は変なカラースキーム使うと気持ち悪くなることがあるのですが、そのような症状が出る方がいらっしゃったら
もしかしたらおすすめかもです。

その他

僕のvimrcです。よかったら使ってください。

ReiwaVimConfiguration

追記: 2020/8/6

以下,2020/8/6現在の自分のinit.vimにおける色関連の設定です.
(付け足し,付け足しなので所々リファクタリングが適当なところがあります.)

scriptencoding utf-8

syntax on

" Default color scheme {{{
    let g:my_color = 'mrkn256'
    "colo industry
    "colo Tomorrow              " 明るいところ、逆光で見やすい
    "colo goodwolf              " 明るいところでmardown見やすい
    "colo mrkn256               " 暗闇で見やすい
    "colo molokai
    "colo iceberg
    "colo nord
    "colo night-owl
    "colo onedark
    "colo Tomorrow-Night-Bright
    "colo gruvbox       
    "colo tomorrow
    "colo hybrid
" }}}

" color definition {{{
    " NOTE: color {{{
        " 179 : 黄色
        " 51  : 水色 (少し明るい)
        " 45  : 水色
        " 6   : 水色 (少し暗い)
        " 24  : 水色 (より暗い)
        " 255 : 白色
        " 240 : 灰色
        " 111 : 薄青 (暗)
        " 214 : オレンジ (暗)
    " }}}
    " Check {{{
        " スペルチェック
        au Colorscheme * hi SpellBad ctermfg=none ctermbg=none cterm=underline
    " }}}

    " Tab, Space, etc...{{{
        " NOTE:
        "   * NonText
        "     * eol, extends, precedes
        "   * SpecialKey
        "     * nbsp, tab, trail
        au Colorscheme * hi NonText    ctermbg=None ctermfg=13
        au Colorscheme * hi SpecialKey ctermbg=None ctermfg=13 cterm=italic

    " }}}

    " Visual mode {{{
        au Colorscheme * hi Visual cterm=reverse
    " }}}

    " mark {{{
        au ColorScheme * hi InterestingWord1 ctermfg=0 ctermbg=47  " みどり
        au ColorScheme * hi InterestingWord2 ctermfg=0 ctermbg=45  " 水色
        au ColorScheme * hi InterestingWord3 ctermfg=0 ctermbg=212 " ピンク
    " }}}

    " cursourline {{{
        au ColorScheme * hi CursorLine term=bold cterm=bold guibg=Grey40
    " }}}

    " Haskell {{{
        au ColorScheme * hi Haskell01 ctermfg=179  " 黄色
        au ColorScheme * hi Haskell02 ctermfg=45   " 水色
        au ColorScheme * hi Haskell03 ctermfg=255  " 白
        au ColorScheme * hi Haskell04 ctermfg=240  " 灰色
    " }}}

    " a note using floating window
    au ColorScheme * hi MMathGlossary ctermfg=255 ctermbg=0

    " Prefix for color scheme {{{
        " Color scheme extension  " molokai {{{
            function! s:molokai()
                " " コメントアウト
                " hi Comment ctermfg=244 cterm=italic

                " `(` と `)`
                hi Delimiter cterm=bold ctermfg=116

                " コメントアウト
                "hi Comment ctermfg=47 cterm=italic
                hi Comment ctermfg=179 cterm=italic

                " blacket
                hi MatchParen cterm=bold ctermfg=214 ctermbg=black

                " Check spells
                "hi SpellBad ctermfg=none ctermbg=none cterm=underline

                " Conceal {{{
                    " Note:
                    " vim2hsというHaskell用
                    " のプラグインにてlambda式(\)がλに変換されるがこのとき背景色と被り見にくいので
                    hi clear Conceal
                    hi Conceal ctermbg=1 ctermbg=darkblue
                " }}}
            endfunction
        " }}}

        " Color scheme extension  " one dark {{{
            function! s:onedark()
                hi Normal       ctermbg=none

                " 行番号
                hi LineNr       ctermbg=none ctermfg=240 cterm=italic

                " アクティブなステータスライン
                hi StatusLine   ctermbg=none

                 " 非アクティブなステータスライン
                hi StatusLineNC ctermbg=none

                " コメントアウト
                "hi Comment      ctermfg=243 cterm=italic
                hi Comment ctermfg=179 cterm=italic

                hi Statement    ctermfg=45

                " 追加行
                hi DiffAdd      ctermbg=24

                hi Identifier   ctermfg=45 "cterm=bold
            endfunction
        " }}}

        " Color scheme extension " night_owl {{{
            function! s:iceberg()
                " bracket
                hi MatchParen cterm=bold ctermfg=214 ctermbg=black
            endfunction
        " }}}

        " Color scheme extension " nord {{{
            function! s:nord()
                " bracket
                hi MatchParen cterm=bold ctermfg=214 ctermbg=black

                " Check spells
                hi SpellBad ctermfg=none ctermbg=none cterm=underline
            endfunction
        " }}}

        " Color scheme extension " purify {{{
            function! s:purify()
                let g:airline_theme='purify'
            endfunction
        " }}}

        " Color scheme extension " wolf {{{
            function! s:wolf()
                " コメントアウト
                hi Comment ctermfg=179 cterm=italic
                hi Normal ctermbg=0
                hi Folded ctermfg=208
            endfunction
        " }}}

        " Color scheme extension " mrkn256 {{{
            function! s:mrkn256()
                " blacket
                hi MatchParen cterm=bold ctermfg=214 ctermbg=black

                hi Normal ctermbg=black
            endfunction
        " }}}

        " Color scheme extension " default {{{
            function! s:default()
                " blacket
                hi MatchParen cterm=bold ctermfg=214 ctermbg=black
            endfunction
        " }}}

        " Prefix for color schemes
        au ColorScheme * :call s:set_each_color_settings()
        function! s:set_each_color_settings()
            if g:colors_name == "molokai"
                call s:molokai()
            elseif g:colors_name == "onedark"
                call s:onedark()
            elseif g:colors_name == "iceberg"
                call s:iceberg()
            elseif g:colors_name == "nord"
                call s:nord()
            elseif g:colors_name == "purify"
                call s:purify()
            elseif g:colors_name == "goodwolf"
                call s:wolf()
            elseif g:colors_name == "badwolf"
                call s:wolf()
            elseif g:colors_name == "mrkn256"
                call s:mrkn256()
            elseif g:colors_name == "default"
                call s:default()
            else
            endif
        endfunction
    " }}}
" }}}

" Language {{{
    augroup FlowWriteFile
        au!
        autocmd BufWrite *    :call s:w_set_default()
        autocmd BufWrite *.md :call s:w_set_markdown()
    augroup END

    augroup FolowFile
        au!
        au BufRead,BufNewFile *      :call s:w_set_default()
        au BufRead,BufNewFile *.md   :call s:w_set_markdown()
    augroup END

    function! s:w_set_default()
            if exists('s:my_color')
                exe("colo ". g:my_color)
                if exists('*s:set_each_color_settings()')
                    call s:set_each_color_settings()
                else
                    echom 's:wolf() is not exists (at color.init.vim)'
                endif
            else
                echom 'Err: s:my_color is not exists. [at color.init.vim]'
            endif
    endfunction

    function! s:w_set_markdown()
        if g:colors_name != 'goodwolf'
            colo goodwolf
            if exists('*s:wolf()')
                call s:wolf()
            else
                echom 's:wolf() is not exists (at color.init.vim)'
            endif
        endif
    endfunction
" }}}


" Set color scheme {{{
    set background=dark
    if exists('s:my_color')
        exe("colo ". s:my_color)
    else
        echom 'Err: s:my_color is not exists. [at color.init.vim]'
    endif
" }}}

" 行末スペース、行末タブの表示 {{{
    " highlight TrailingSpaces ctermbg=red guibg=#FF0000
    " highlight TrailingSpaces ctermbg=blue guibg=#FF0000
    "46 (緑), 240 (灰色), 50 (水色)
    highlight TrailingSpaces ctermbg=50 ctermfg=50 cterm=bold
    highlight Tabs ctermbg=black guibg=8 " guibg=#000000
    au BufNewFile,BufRead * call matchadd('TrailingSpaces', ' \{-1,}$')
    au BufNewFile,BufRead * call matchadd('Tabs', '\t')
" }}}

" 全角スペースの表示 {{{
    highlight ZenkakuSpace cterm=underline ctermbg=BLUE
    au BufWinEnter * let w:m3 = matchadd("ZenkakuSpace", ' ')
    au WinEnter    * let w:m3 = matchadd("ZenkakuSpace", ' ')
" }}}
18
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
19