dotfiles

config files for my linux setup
git clone git://edryd.org/dotfiles
Log | Files | Refs | README

hybrid.vim (16935B)


      1 " File:       hybrid.vim
      2 " Maintainer: Andrew Wong (w0ng)
      3 " URL:        https://github.com/w0ng/vim-hybrid
      4 " Modified:   27 Jan 2013 07:33 AM AEST
      5 " License:    MIT
      6 
      7 " Description:"{{{
      8 " ----------------------------------------------------------------------------
      9 " The RGB colour palette is taken from Tomorrow-Night.vim:
     10 " https://github.com/chriskempson/vim-tomorrow-theme
     11 "
     12 " The syntax highlighting scheme is taken from jellybeans.vim:
     13 " https://github.com/nanotech/jellybeans.vim
     14 "
     15 " The code taken from solarized.vim
     16 " https://github.com/altercation/vim-colors-solarized
     17 
     18 "}}}
     19 " Requirements And Recommendations:"{{{
     20 " ----------------------------------------------------------------------------
     21 " This colourscheme is intended for use on:
     22 "   - gVim 7.3 for Linux, Mac and Windows.
     23 "   - Vim 7.3 for Linux, using a 256 colour enabled terminal.
     24 "
     25 " By default, Vim will use the closest matching cterm equivalent of the RGB
     26 " colours.
     27 "
     28 " However, Due to the limited 256 palette, colours in Vim and gVim will still
     29 " be noticeably different. In order to get a uniform appearance and the way
     30 " that this colourscheme was intended, it is HIGHLY recommended that you:
     31 "
     32 " 1.  Add these colours to ~/.Xresources:
     33 "
     34 "       https://gist.github.com/3278077
     35 "
     36 " 2.  Use Xresources colours by setting in ~/.vimrc:
     37 "
     38 "       let g:hybrid_use_Xresources = 1
     39 "       colorscheme hybrid
     40 "
     41 " For iTerm2 users:
     42 " 1.  Install this color preset on your iTerm2:
     43 "
     44 "       https://gist.github.com/luan/6362811
     45 "
     46 " 2. Use iTerm colours by setting in ~/.vimrc:
     47 "
     48 "       let g:hybrid_use_iTerm_colors = 1
     49 "       colorscheme hybrid
     50 "
     51 
     52 "}}}
     53 " Initialisation:"{{{
     54 " ----------------------------------------------------------------------------
     55 if !has("gui_running") && &t_Co < 256
     56   finish
     57 endif
     58 
     59 if !exists("g:hybrid_use_Xresources")
     60   let g:hybrid_use_Xresources = 0
     61 endif
     62 
     63 if !exists("g:hybrid_use_iTerm_colors")
     64   let g:hybrid_use_iTerm_colors = 0
     65 endif
     66 
     67 set background=dark
     68 hi clear
     69 
     70 if exists("syntax_on")
     71   syntax reset
     72 endif
     73 
     74 let colors_name = "hybrid"
     75 
     76 "}}}
     77 " GUI And Cterm Palettes:"{{{
     78 " ----------------------------------------------------------------------------
     79 if has("gui_running")
     80   let s:vmode      = "gui"
     81   let s:background = "#1d1f21"
     82   let s:foreground = "#c5c8c6"
     83   let s:selection  = "#373b41"
     84   let s:line       = "#282a2e"
     85   let s:comment    = "#707880"
     86   let s:red        = "#cc6666"
     87   let s:orange     = "#de935f"
     88   let s:yellow     = "#f0c674"
     89   let s:green      = "#b5bd68"
     90   let s:aqua       = "#8abeb7"
     91   let s:blue       = "#81a2be"
     92   let s:purple     = "#b294bb"
     93   let s:window     = "#303030"
     94   let s:darkcolumn = "#1c1c1c"
     95   let s:addbg      = "#5F875F"
     96   let s:addfg      = "#d7ffaf"
     97   let s:changebg   = "#5F5F87"
     98   let s:changefg   = "#d7d7ff"
     99   let s:darkblue   = "#00005f"
    100   let s:darkcyan   = "#005f5f"
    101   let s:darkred    = "#5f0000"
    102   let s:darkpurple = "#5f005f"
    103 else
    104   let s:vmode      = "cterm"
    105   let s:background = "234"
    106   let s:window     = "236"
    107   let s:darkcolumn = "234"
    108   let s:addbg      = "65"
    109   let s:addfg      = "193"
    110   let s:changebg   = "60"
    111   let s:changefg   = "189"
    112   let s:darkblue   = "17"
    113   let s:darkcyan   = "24"
    114   let s:darkred    = "52"
    115   let s:darkpurple = "53"
    116   if g:hybrid_use_Xresources == 1
    117     let s:foreground = "15"   " White
    118     let s:selection  = "8"    " DarkGrey
    119     let s:line       = "0"    " Black
    120     let s:comment    = "7"    " LightGrey
    121     let s:red        = "9"    " LightRed
    122     let s:orange     = "3"    " DarkYellow
    123     let s:yellow     = "11"   " LightYellow
    124     let s:green      = "10"   " LightGreen
    125     let s:aqua       = "14"   " LightCyan
    126     let s:blue       = "12"   " LightBlue
    127     let s:purple     = "13"   " LightMagenta
    128   elseif g:hybrid_use_iTerm_colors == 1
    129     let s:background = "8"
    130     let s:foreground = "15"
    131     let s:selection  = "13"
    132     let s:line       = "0"
    133     let s:comment    = "7"
    134     let s:red        = "1"   
    135     let s:orange     = "9"   
    136     let s:yellow     = "3"   
    137     let s:green      = "2"
    138     let s:aqua       = "6"
    139     let s:blue       = "4"
    140     let s:purple     = "5"
    141     let s:darkcolumn = "11"
    142     let s:addbg      = "10"
    143     let s:changebg   = "12"
    144   else
    145     let s:foreground = "250"
    146     let s:selection  = "237"
    147     let s:line       = "235"
    148     let s:comment    = "243"
    149     let s:red        = "167"
    150     let s:orange     = "173"
    151     let s:yellow     = "221"
    152     let s:green      = "143"
    153     let s:aqua       = "109"
    154     let s:blue       = "110"
    155     let s:purple     = "139"
    156   endif
    157 endif
    158 
    159 "}}}
    160 " Formatting Options:"{{{
    161 " ----------------------------------------------------------------------------
    162 let s:none   = "NONE"
    163 let s:t_none = "NONE"
    164 let s:n      = "NONE"
    165 let s:c      = ",undercurl"
    166 let s:r      = ",reverse"
    167 let s:s      = ",standout"
    168 let s:b      = ",bold"
    169 let s:u      = ",underline"
    170 let s:i      = ",italic"
    171 
    172 "}}}
    173 " Highlighting Primitives:"{{{
    174 " ----------------------------------------------------------------------------
    175 exe "let s:bg_none       = ' ".s:vmode."bg=".s:none      ."'"
    176 exe "let s:bg_foreground = ' ".s:vmode."bg=".s:foreground."'"
    177 exe "let s:bg_background = ' ".s:vmode."bg=".s:background."'"
    178 exe "let s:bg_selection  = ' ".s:vmode."bg=".s:selection ."'"
    179 exe "let s:bg_line       = ' ".s:vmode."bg=".s:line      ."'"
    180 exe "let s:bg_comment    = ' ".s:vmode."bg=".s:comment   ."'"
    181 exe "let s:bg_red        = ' ".s:vmode."bg=".s:red       ."'"
    182 exe "let s:bg_orange     = ' ".s:vmode."bg=".s:orange    ."'"
    183 exe "let s:bg_yellow     = ' ".s:vmode."bg=".s:yellow    ."'"
    184 exe "let s:bg_green      = ' ".s:vmode."bg=".s:green     ."'"
    185 exe "let s:bg_aqua       = ' ".s:vmode."bg=".s:aqua      ."'"
    186 exe "let s:bg_blue       = ' ".s:vmode."bg=".s:blue      ."'"
    187 exe "let s:bg_purple     = ' ".s:vmode."bg=".s:purple    ."'"
    188 exe "let s:bg_window     = ' ".s:vmode."bg=".s:window    ."'"
    189 exe "let s:bg_darkcolumn = ' ".s:vmode."bg=".s:darkcolumn."'"
    190 exe "let s:bg_addbg      = ' ".s:vmode."bg=".s:addbg     ."'"
    191 exe "let s:bg_addfg      = ' ".s:vmode."bg=".s:addfg     ."'"
    192 exe "let s:bg_changebg   = ' ".s:vmode."bg=".s:changebg  ."'"
    193 exe "let s:bg_changefg   = ' ".s:vmode."bg=".s:changefg  ."'"
    194 exe "let s:bg_darkblue   = ' ".s:vmode."bg=".s:darkblue  ."'"
    195 exe "let s:bg_darkcyan   = ' ".s:vmode."bg=".s:darkcyan  ."'"
    196 exe "let s:bg_darkred    = ' ".s:vmode."bg=".s:darkred   ."'"
    197 exe "let s:bg_darkpurple = ' ".s:vmode."bg=".s:darkpurple."'"
    198 
    199 exe "let s:fg_none       = ' ".s:vmode."fg=".s:none      ."'"
    200 exe "let s:fg_foreground = ' ".s:vmode."fg=".s:foreground."'"
    201 exe "let s:fg_background = ' ".s:vmode."fg=".s:background."'"
    202 exe "let s:fg_selection  = ' ".s:vmode."fg=".s:selection ."'"
    203 exe "let s:fg_line       = ' ".s:vmode."fg=".s:line      ."'"
    204 exe "let s:fg_comment    = ' ".s:vmode."fg=".s:comment   ."'"
    205 exe "let s:fg_red        = ' ".s:vmode."fg=".s:red       ."'"
    206 exe "let s:fg_orange     = ' ".s:vmode."fg=".s:orange    ."'"
    207 exe "let s:fg_yellow     = ' ".s:vmode."fg=".s:yellow    ."'"
    208 exe "let s:fg_green      = ' ".s:vmode."fg=".s:green     ."'"
    209 exe "let s:fg_aqua       = ' ".s:vmode."fg=".s:aqua      ."'"
    210 exe "let s:fg_blue       = ' ".s:vmode."fg=".s:blue      ."'"
    211 exe "let s:fg_purple     = ' ".s:vmode."fg=".s:purple    ."'"
    212 exe "let s:fg_window     = ' ".s:vmode."fg=".s:window    ."'"
    213 exe "let s:fg_darkcolumn = ' ".s:vmode."fg=".s:darkcolumn."'"
    214 exe "let s:fg_addbg      = ' ".s:vmode."fg=".s:addbg     ."'"
    215 exe "let s:fg_addfg      = ' ".s:vmode."fg=".s:addfg     ."'"
    216 exe "let s:fg_changebg   = ' ".s:vmode."fg=".s:changebg  ."'"
    217 exe "let s:fg_changefg   = ' ".s:vmode."fg=".s:changefg  ."'"
    218 exe "let s:fg_darkblue   = ' ".s:vmode."fg=".s:darkblue  ."'"
    219 exe "let s:fg_darkcyan   = ' ".s:vmode."fg=".s:darkcyan  ."'"
    220 exe "let s:fg_darkred    = ' ".s:vmode."fg=".s:darkred   ."'"
    221 exe "let s:fg_darkpurple = ' ".s:vmode."fg=".s:darkpurple."'"
    222 
    223 exe "let s:fmt_none      = ' ".s:vmode."=NONE".          " term=NONE"        ."'"
    224 exe "let s:fmt_bold      = ' ".s:vmode."=NONE".s:b.      " term=NONE".s:b    ."'"
    225 exe "let s:fmt_bldi      = ' ".s:vmode."=NONE".s:b.      " term=NONE".s:b    ."'"
    226 exe "let s:fmt_undr      = ' ".s:vmode."=NONE".s:u.      " term=NONE".s:u    ."'"
    227 exe "let s:fmt_undb      = ' ".s:vmode."=NONE".s:u.s:b.  " term=NONE".s:u.s:b."'"
    228 exe "let s:fmt_undi      = ' ".s:vmode."=NONE".s:u.      " term=NONE".s:u    ."'"
    229 exe "let s:fmt_curl      = ' ".s:vmode."=NONE".s:c.      " term=NONE".s:c    ."'"
    230 exe "let s:fmt_ital      = ' ".s:vmode."=NONE".s:i.      " term=NONE".s:i    ."'"
    231 exe "let s:fmt_stnd      = ' ".s:vmode."=NONE".s:s.      " term=NONE".s:s    ."'"
    232 exe "let s:fmt_revr      = ' ".s:vmode."=NONE".s:r.      " term=NONE".s:r    ."'"
    233 exe "let s:fmt_revb      = ' ".s:vmode."=NONE".s:r.s:b.  " term=NONE".s:r.s:b."'"
    234 
    235 if has("gui_running")
    236   exe "let s:sp_none       = ' guisp=".s:none      ."'"
    237   exe "let s:sp_foreground = ' guisp=".s:foreground."'"
    238   exe "let s:sp_background = ' guisp=".s:background."'"
    239   exe "let s:sp_selection  = ' guisp=".s:selection ."'"
    240   exe "let s:sp_line       = ' guisp=".s:line      ."'"
    241   exe "let s:sp_comment    = ' guisp=".s:comment   ."'"
    242   exe "let s:sp_red        = ' guisp=".s:red       ."'"
    243   exe "let s:sp_orange     = ' guisp=".s:orange    ."'"
    244   exe "let s:sp_yellow     = ' guisp=".s:yellow    ."'"
    245   exe "let s:sp_green      = ' guisp=".s:green     ."'"
    246   exe "let s:sp_aqua       = ' guisp=".s:aqua      ."'"
    247   exe "let s:sp_blue       = ' guisp=".s:blue      ."'"
    248   exe "let s:sp_purple     = ' guisp=".s:purple    ."'"
    249   exe "let s:sp_window     = ' guisp=".s:window    ."'"
    250   exe "let s:sp_addbg      = ' guisp=".s:addbg     ."'"
    251   exe "let s:sp_addfg      = ' guisp=".s:addfg     ."'"
    252   exe "let s:sp_changebg   = ' guisp=".s:changebg  ."'"
    253   exe "let s:sp_changefg   = ' guisp=".s:changefg  ."'"
    254   exe "let s:sp_darkblue   = ' guisp=".s:darkblue  ."'"
    255   exe "let s:sp_darkcyan   = ' guisp=".s:darkcyan  ."'"
    256   exe "let s:sp_darkred    = ' guisp=".s:darkred   ."'"
    257   exe "let s:sp_darkpurple = ' guisp=".s:darkpurple."'"
    258 else
    259   let s:sp_none       = ""
    260   let s:sp_foreground = ""
    261   let s:sp_background = ""
    262   let s:sp_selection  = ""
    263   let s:sp_line       = ""
    264   let s:sp_comment    = ""
    265   let s:sp_red        = ""
    266   let s:sp_orange     = ""
    267   let s:sp_yellow     = ""
    268   let s:sp_green      = ""
    269   let s:sp_aqua       = ""
    270   let s:sp_blue       = ""
    271   let s:sp_purple     = ""
    272   let s:sp_window     = ""
    273   let s:sp_addbg      = ""
    274   let s:sp_addfg      = ""
    275   let s:sp_changebg   = ""
    276   let s:sp_changefg   = ""
    277   let s:sp_darkblue   = ""
    278   let s:sp_darkcyan   = ""
    279   let s:sp_darkred    = ""
    280   let s:sp_darkpurple = ""
    281 endif
    282 
    283 "}}}
    284 " Vim Highlighting: (see :help highlight-groups)"{{{
    285 " ----------------------------------------------------------------------------
    286 exe "hi! ColorColumn"   .s:fg_none        .s:bg_line        .s:fmt_none
    287 "		Conceal"
    288 "		Cursor"
    289 "		CursorIM"
    290 exe "hi! CursorColumn"  .s:fg_none        .s:bg_line        .s:fmt_none
    291 exe "hi! CursorLine"    .s:fg_none        .s:bg_line        .s:fmt_none
    292 exe "hi! Directory"     .s:fg_blue        .s:bg_none        .s:fmt_none
    293 exe "hi! DiffAdd"       .s:fg_addfg       .s:bg_addbg       .s:fmt_none
    294 exe "hi! DiffChange"    .s:fg_changefg    .s:bg_changebg    .s:fmt_none
    295 exe "hi! DiffDelete"    .s:fg_background  .s:bg_red         .s:fmt_none
    296 exe "hi! DiffText"      .s:fg_background  .s:bg_blue        .s:fmt_none
    297 exe "hi! ErrorMsg"      .s:fg_background  .s:bg_red         .s:fmt_stnd
    298 exe "hi! VertSplit"     .s:fg_window      .s:bg_none        .s:fmt_none
    299 exe "hi! Folded"        .s:fg_comment     .s:bg_darkcolumn  .s:fmt_none
    300 exe "hi! FoldColumn"    .s:fg_none        .s:bg_darkcolumn  .s:fmt_none
    301 exe "hi! SignColumn"    .s:fg_none        .s:bg_darkcolumn  .s:fmt_none
    302 "		Incsearch"
    303 exe "hi! LineNr"        .s:fg_selection   .s:bg_none        .s:fmt_none
    304 exe "hi! CursorLineNr"  .s:fg_yellow      .s:bg_none        .s:fmt_bold
    305 exe "hi! MatchParen"    .s:fg_background  .s:bg_changebg    .s:fmt_none
    306 exe "hi! ModeMsg"       .s:fg_green       .s:bg_none        .s:fmt_none
    307 exe "hi! MoreMsg"       .s:fg_green       .s:bg_none        .s:fmt_none
    308 exe "hi! NonText"       .s:fg_selection   .s:bg_none        .s:fmt_none
    309 exe "hi! Pmenu"         .s:fg_foreground  .s:bg_selection   .s:fmt_none
    310 exe "hi! PmenuSel"      .s:fg_foreground  .s:bg_selection   .s:fmt_revr
    311 "		PmenuSbar"
    312 "		PmenuThumb"
    313 exe "hi! Question"      .s:fg_green       .s:bg_none        .s:fmt_none
    314 exe "hi! Search"        .s:fg_background  .s:bg_yellow      .s:fmt_none
    315 exe "hi! SpecialKey"    .s:fg_selection   .s:bg_none        .s:fmt_none
    316 exe "hi! SpellCap"      .s:fg_blue        .s:bg_darkblue    .s:fmt_undr
    317 exe "hi! SpellLocal"    .s:fg_aqua        .s:bg_darkcyan    .s:fmt_undr
    318 exe "hi! SpellBad"      .s:fg_red         .s:bg_darkred     .s:fmt_undr
    319 exe "hi! SpellRare"     .s:fg_purple      .s:bg_darkpurple  .s:fmt_undr
    320 exe "hi! StatusLine"    .s:fg_comment     .s:bg_background  .s:fmt_revr
    321 exe "hi! StatusLineNC"  .s:fg_window      .s:bg_comment     .s:fmt_revr
    322 exe "hi! TabLine"       .s:fg_foreground  .s:bg_darkcolumn  .s:fmt_revr
    323 "		TabLineFill"
    324 "		TabLineSel"
    325 exe "hi! Title"         .s:fg_yellow      .s:bg_none        .s:fmt_none
    326 exe "hi! Visual"        .s:fg_none        .s:bg_selection   .s:fmt_none
    327 "		VisualNos"
    328 exe "hi! WarningMsg"    .s:fg_red         .s:bg_none        .s:fmt_none
    329 "		WildMenu"
    330 
    331 " Use Xresources for background colour
    332 if has('gui_running') || (g:hybrid_use_Xresources != 1 && g:hybrid_use_iTerm_colors != 1)
    333   exe "hi! Normal"        .s:fg_foreground  .s:bg_background  .s:fmt_none
    334 else
    335   exe "hi! Normal"        .s:fg_foreground  .s:bg_none        .s:fmt_none
    336 endif
    337 
    338 "}}}
    339 " Generic Syntax Highlighting: (see :help group-name)"{{{
    340 " ----------------------------------------------------------------------------
    341 exe "hi! Comment"         .s:fg_comment     .s:bg_none        .s:fmt_none
    342 
    343 exe "hi! Constant"        .s:fg_red         .s:bg_none        .s:fmt_none
    344 exe "hi! String"          .s:fg_green       .s:bg_none        .s:fmt_none
    345 "		Character"
    346 "		Number"
    347 "		Boolean"
    348 "		Float"
    349 
    350 exe "hi! Identifier"      .s:fg_purple      .s:bg_none        .s:fmt_none
    351 exe "hi! Function"        .s:fg_yellow      .s:bg_none        .s:fmt_none
    352 
    353 exe "hi! Statement"       .s:fg_blue        .s:bg_none        .s:fmt_none
    354 "		Conditional"
    355 "		Repeat"
    356 "		Label"
    357 exe "hi! Operator"        .s:fg_aqua        .s:bg_none        .s:fmt_none
    358 "		Keyword"
    359 "		Exception"
    360 
    361 exe "hi! PreProc"         .s:fg_aqua        .s:bg_none        .s:fmt_none
    362 "		Include"
    363 "		Define"
    364 "		Macro"
    365 "		PreCondit"
    366 
    367 exe "hi! Type"            .s:fg_orange      .s:bg_none        .s:fmt_none
    368 "		StorageClass"
    369 exe "hi! Structure"       .s:fg_aqua        .s:bg_none        .s:fmt_none
    370 "		Typedef"
    371 
    372 exe "hi! Special"         .s:fg_green       .s:bg_none        .s:fmt_none
    373 "		SpecialChar"
    374 "		Tag"
    375 "		Delimiter"
    376 "		SpecialComment"
    377 "		Debug"
    378 "
    379 exe "hi! Underlined"      .s:fg_blue        .s:bg_none        .s:fmt_none
    380 
    381 exe "hi! Ignore"          .s:fg_none        .s:bg_none        .s:fmt_none
    382 
    383 exe "hi! Error"           .s:fg_red         .s:bg_darkred     .s:fmt_undr
    384 
    385 exe "hi! Todo"            .s:fg_addfg       .s:bg_none        .s:fmt_none
    386 
    387 " Quickfix window highlighting
    388 exe "hi! qfLineNr"        .s:fg_yellow      .s:bg_none        .s:fmt_none
    389 "   qfFileName"
    390 "   qfLineNr"
    391 "   qfError"
    392 
    393 "}}}
    394 " Diff Syntax Highlighting:"{{{
    395 " ----------------------------------------------------------------------------
    396 " Diff
    397 "		diffOldFile
    398 "		diffNewFile
    399 "		diffFile
    400 "		diffOnly
    401 "		diffIdentical
    402 "		diffDiffer
    403 "		diffBDiffer
    404 "		diffIsA
    405 "		diffNoEOL
    406 "		diffCommon
    407 hi! link diffRemoved Constant
    408 "		diffChanged
    409 hi! link diffAdded Special
    410 "		diffLine
    411 "		diffSubname
    412 "		diffComment
    413 
    414 "}}}
    415 " Legal:"{{{
    416 " ----------------------------------------------------------------------------
    417 " Copyright (c) 2011 Ethan Schoonover
    418 " Copyright (c) 2009-2012 NanoTech
    419 " Copyright (c) 2012 w0ng
    420 "
    421 " Permission is hereby granted, free of charge, to any per‐
    422 " son obtaining a copy of this software and associated doc‐
    423 " umentation files (the “Software”), to deal in the Soft‐
    424 " ware without restriction, including without limitation
    425 " the rights to use, copy, modify, merge, publish, distrib‐
    426 " ute, sublicense, and/or sell copies of the Software, and
    427 " to permit persons to whom the Software is furnished to do
    428 " so, subject to the following conditions:
    429 "
    430 " The above copyright notice and this permission notice
    431 " shall be included in all copies or substantial portions
    432 " of the Software.
    433 "
    434 " THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY
    435 " KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
    436 " THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICU‐
    437 " LAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    438 " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
    439 " DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON‐
    440 " TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐
    441 " NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    442 " THE SOFTWARE.
    443 
    444 " }}}