Skip to content

Instantly share code, notes, and snippets.

@paulirwin
Created April 19, 2017 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulirwin/60c28183a1274c67df6bca9eaf3c186f to your computer and use it in GitHub Desktop.
Save paulirwin/60c28183a1274c67df6bca9eaf3c186f to your computer and use it in GitHub Desktop.
Dircolors/Vim config
# Dark 256 color solarized theme for the color GNU ls utility.
# Used and tested with dircolors (GNU coreutils) 8.5
#
# @author {@link http://sebastian.tramp.name Sebastian Tramp}
# @license http://sam.zoy.org/wtfpl/ Do What The Fuck You Want To Public License (WTFPL)
#
# More Information at
# https://github.com/seebi/dircolors-solarized
# Term Section
TERM Eterm
TERM ansi
TERM color-xterm
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM cons25
TERM console
TERM cygwin
TERM dtterm
TERM dvtm
TERM dvtm-256color
TERM eterm-color
TERM fbterm
TERM gnome
TERM gnome-256color
TERM jfbterm
TERM konsole
TERM konsole-256color
TERM kterm
TERM linux
TERM linux-c
TERM mach-color
TERM mlterm
TERM putty
TERM putty-256color
TERM rxvt
TERM rxvt-256color
TERM rxvt-cygwin
TERM rxvt-cygwin-native
TERM rxvt-unicode
TERM rxvt-unicode256
TERM rxvt-unicode-256color
TERM screen
TERM screen-16color
TERM screen-16color-bce
TERM screen-16color-s
TERM screen-16color-bce-s
TERM screen-256color
TERM screen-256color-bce
TERM screen-256color-s
TERM screen-256color-bce-s
TERM screen-256color-italic
TERM screen-bce
TERM screen-w
TERM screen.linux
TERM screen.xterm-256color
TERM st
TERM st-meta
TERM st-256color
TERM st-meta-256color
TERM tmux
TERM tmux-256color
TERM vt100
TERM xterm
TERM xterm-16color
TERM xterm-256color
TERM xterm-256color-italic
TERM xterm-88color
TERM xterm-color
TERM xterm-debian
TERM xterm-termite
## Documentation
#
# standard colors
#
# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
#
#
# 256 color support
# see here: http://www.mail-archive.com/bug-coreutils@gnu.org/msg11030.html)
#
# Text 256 color coding:
# 38;5;COLOR_NUMBER
# Background 256 color coding:
# 48;5;COLOR_NUMBER
## Special files
NORMAL 00;38;5;244 # no color code at all
#FILE 00 # regular file: use no color at all
RESET 0 # reset to "normal" color
DIR 00;38;5;33 # directory 01;34
LINK 00;38;5;37 # symbolic link. (If you set this to 'target' instead of a
# numerical value, the color is as for the file pointed to.)
MULTIHARDLINK 00 # regular file with more than one link
FIFO 48;5;230;38;5;136;01 # pipe
SOCK 48;5;230;38;5;136;01 # socket
DOOR 48;5;230;38;5;136;01 # door
BLK 48;5;230;38;5;244;01 # block device driver
CHR 48;5;230;38;5;244;01 # character device driver
ORPHAN 48;5;235;38;5;160 # symlink to nonexistent file, or non-stat'able file
SETUID 48;5;160;38;5;230 # file that is setuid (u+s)
SETGID 48;5;136;38;5;230 # file that is setgid (g+s)
CAPABILITY 30;41 # file with capability
STICKY_OTHER_WRITABLE 48;5;64;38;5;230 # dir that is sticky and other-writable (+t,o+w)
OTHER_WRITABLE 48;5;235;38;5;33 # dir that is other-writable (o+w) and not sticky
STICKY 48;5;33;38;5;230 # dir with the sticky bit set (+t) and not other-writable
# This is for files with execute permission:
EXEC 00;38;5;64
## Archives or compressed (violet + bold for compression)
.tar 00;38;5;61
.tgz 00;38;5;61
.arj 00;38;5;61
.taz 00;38;5;61
.lzh 00;38;5;61
.lzma 00;38;5;61
.tlz 00;38;5;61
.txz 00;38;5;61
.zip 00;38;5;61
.z 00;38;5;61
.Z 00;38;5;61
.dz 00;38;5;61
.gz 00;38;5;61
.lz 00;38;5;61
.xz 00;38;5;61
.bz2 00;38;5;61
.bz 00;38;5;61
.tbz 00;38;5;61
.tbz2 00;38;5;61
.tz 00;38;5;61
.deb 00;38;5;61
.rpm 00;38;5;61
.jar 00;38;5;61
.rar 00;38;5;61
.ace 00;38;5;61
.zoo 00;38;5;61
.cpio 00;38;5;61
.7z 00;38;5;61
.rz 00;38;5;61
.apk 00;38;5;61
.gem 00;38;5;61
# Image formats (yellow)
.jpg 00;38;5;136
.JPG 00;38;5;136 #stupid but needed
.jpeg 00;38;5;136
.gif 00;38;5;136
.bmp 00;38;5;136
.pbm 00;38;5;136
.pgm 00;38;5;136
.ppm 00;38;5;136
.tga 00;38;5;136
.xbm 00;38;5;136
.xpm 00;38;5;136
.tif 00;38;5;136
.tiff 00;38;5;136
.png 00;38;5;136
.PNG 00;38;5;136
.svg 00;38;5;136
.svgz 00;38;5;136
.mng 00;38;5;136
.pcx 00;38;5;136
.dl 00;38;5;136
.xcf 00;38;5;136
.xwd 00;38;5;136
.yuv 00;38;5;136
.cgm 00;38;5;136
.emf 00;38;5;136
.eps 00;38;5;136
.CR2 00;38;5;136
.ico 00;38;5;136
# Files of special interest (base1)
.tex 00;38;5;245
.rdf 00;38;5;245
.owl 00;38;5;245
.n3 00;38;5;245
.ttl 00;38;5;245
.nt 00;38;5;245
.torrent 00;38;5;245
.xml 00;38;5;245
*Makefile 00;38;5;245
*Rakefile 00;38;5;245
*Dockerfile 00;38;5;245
*build.xml 00;38;5;245
*rc 00;38;5;245
*1 00;38;5;245
.nfo 00;38;5;245
*README 00;38;5;245
*README.txt 00;38;5;245
*readme.txt 00;38;5;245
.md 00;38;5;245
*README.markdown 00;38;5;245
.ini 00;38;5;245
.yml 00;38;5;245
.cfg 00;38;5;245
.conf 00;38;5;245
.h 00;38;5;245
.hpp 00;38;5;245
.c 00;38;5;245
.cpp 00;38;5;245
.cxx 00;38;5;245
.cc 00;38;5;245
.objc 00;38;5;245
.sqlite 00;38;5;245
.go 00;38;5;245
.sql 00;38;5;245
.csv 00;38;5;245
# "unimportant" files as logs and backups (base01)
.log 00;38;5;240
.bak 00;38;5;240
.aux 00;38;5;240
.lof 00;38;5;240
.lol 00;38;5;240
.lot 00;38;5;240
.out 00;38;5;240
.toc 00;38;5;240
.bbl 00;38;5;240
.blg 00;38;5;240
*~ 00;38;5;240
*# 00;38;5;240
.part 00;38;5;240
.incomplete 00;38;5;240
.swp 00;38;5;240
.tmp 00;38;5;240
.temp 00;38;5;240
.o 00;38;5;240
.pyc 00;38;5;240
.class 00;38;5;240
.cache 00;38;5;240
# Audio formats (orange)
.aac 00;38;5;166
.au 00;38;5;166
.flac 00;38;5;166
.mid 00;38;5;166
.midi 00;38;5;166
.mka 00;38;5;166
.mp3 00;38;5;166
.mpc 00;38;5;166
.ogg 00;38;5;166
.opus 00;38;5;166
.ra 00;38;5;166
.wav 00;38;5;166
.m4a 00;38;5;166
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
.axa 00;38;5;166
.oga 00;38;5;166
.spx 00;38;5;166
.xspf 00;38;5;166
# Video formats (as audio + bold)
.mov 00;38;5;166
.MOV 00;38;5;166
.mpg 00;38;5;166
.mpeg 00;38;5;166
.m2v 00;38;5;166
.mkv 00;38;5;166
.ogm 00;38;5;166
.mp4 00;38;5;166
.m4v 00;38;5;166
.mp4v 00;38;5;166
.vob 00;38;5;166
.qt 00;38;5;166
.nuv 00;38;5;166
.wmv 00;38;5;166
.asf 00;38;5;166
.rm 00;38;5;166
.rmvb 00;38;5;166
.flc 00;38;5;166
.avi 00;38;5;166
.fli 00;38;5;166
.flv 00;38;5;166
.gl 00;38;5;166
.m2ts 00;38;5;166
.divx 00;38;5;166
.webm 00;38;5;166
# http://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions
.axv 00;38;5;166
.anx 00;38;5;166
.ogv 00;38;5;166
.ogx 00;38;5;166
syntax on
colorscheme basic-dark
" A simple dark vim colorscheme.
" Maintainer: zcodes <zcodes@qq.com>
" Version: 1.0
"
" The theme file original copyed from Tomorrow theme.
" See https://github.com/chriskempson/vim-tomorrow-theme.git for it.
" And hex color conversion functions borrowed from the theme "Desert256".
"
" Most of the colors based on Google Material Design.
" Default GUI colors
let s:foreground = "cfd8dc"
let s:background = "none"
let s:selection = "546e7a"
let s:line = "37474f"
let s:comment = "78909c"
let s:red = "ee877d"
let s:orange = "ffb74d"
let s:yellow = "fff176"
let s:green = "88b888"
let s:aqua = "00b8d4"
let s:blue = "6699cc"
let s:purple = "ce93d8"
let s:window = "37474f"
let s:grey = "b0bec5"
if !has("gui_running")
let s:background = "none"
let s:line = "303030"
endif
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "basic-dark"
if has("gui_running") || &t_Co == 88 || &t_Co == 256
" Returns an approximate grey index for the given grey level
fun <SID>grey_number(x)
if &t_Co == 88
if a:x < 23
return 0
elseif a:x < 69
return 1
elseif a:x < 103
return 2
elseif a:x < 127
return 3
elseif a:x < 150
return 4
elseif a:x < 173
return 5
elseif a:x < 196
return 6
elseif a:x < 219
return 7
elseif a:x < 243
return 8
else
return 9
endif
else
if a:x < 14
return 0
else
let l:n = (a:x - 8) / 10
let l:m = (a:x - 8) % 10
if l:m < 5
return l:n
else
return l:n + 1
endif
endif
endif
endfun
" Returns the actual grey level represented by the grey index
fun <SID>grey_level(n)
if &t_Co == 88
if a:n == 0
return 0
elseif a:n == 1
return 46
elseif a:n == 2
return 92
elseif a:n == 3
return 115
elseif a:n == 4
return 139
elseif a:n == 5
return 162
elseif a:n == 6
return 185
elseif a:n == 7
return 208
elseif a:n == 8
return 231
else
return 255
endif
else
if a:n == 0
return 0
else
return 8 + (a:n * 10)
endif
endif
endfun
" Returns the palette index for the given grey index
fun <SID>grey_colour(n)
if &t_Co == 88
if a:n == 0
return 16
elseif a:n == 9
return 79
else
return 79 + a:n
endif
else
if a:n == 0
return 16
elseif a:n == 25
return 231
else
return 231 + a:n
endif
endif
endfun
" Returns an approximate colour index for the given colour level
fun <SID>rgb_number(x)
if &t_Co == 88
if a:x < 69
return 0
elseif a:x < 172
return 1
elseif a:x < 230
return 2
else
return 3
endif
else
if a:x < 75
return 0
else
let l:n = (a:x - 55) / 40
let l:m = (a:x - 55) % 40
if l:m < 20
return l:n
else
return l:n + 1
endif
endif
endif
endfun
" Returns the actual colour level for the given colour index
fun <SID>rgb_level(n)
if &t_Co == 88
if a:n == 0
return 0
elseif a:n == 1
return 139
elseif a:n == 2
return 205
else
return 255
endif
else
if a:n == 0
return 0
else
return 55 + (a:n * 40)
endif
endif
endfun
" Returns the palette index for the given R/G/B colour indices
fun <SID>rgb_colour(x, y, z)
if &t_Co == 88
return 16 + (a:x * 16) + (a:y * 4) + a:z
else
return 16 + (a:x * 36) + (a:y * 6) + a:z
endif
endfun
" Returns the palette index to approximate the given R/G/B colour levels
fun <SID>colour(r, g, b)
" Get the closest grey
let l:gx = <SID>grey_number(a:r)
let l:gy = <SID>grey_number(a:g)
let l:gz = <SID>grey_number(a:b)
" Get the closest colour
let l:x = <SID>rgb_number(a:r)
let l:y = <SID>rgb_number(a:g)
let l:z = <SID>rgb_number(a:b)
if l:gx == l:gy && l:gy == l:gz
" There are two possibilities
let l:dgr = <SID>grey_level(l:gx) - a:r
let l:dgg = <SID>grey_level(l:gy) - a:g
let l:dgb = <SID>grey_level(l:gz) - a:b
let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
let l:dr = <SID>rgb_level(l:gx) - a:r
let l:dg = <SID>rgb_level(l:gy) - a:g
let l:db = <SID>rgb_level(l:gz) - a:b
let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
if l:dgrey < l:drgb
" Use the grey
return <SID>grey_colour(l:gx)
else
" Use the colour
return <SID>rgb_colour(l:x, l:y, l:z)
endif
else
" Only one possibility
return <SID>rgb_colour(l:x, l:y, l:z)
endif
endfun
" Returns the palette index to approximate the 'rrggbb' hex string
fun <SID>rgb(rgb)
let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
return <SID>colour(l:r, l:g, l:b)
endfun
" Sets the highlighting for the given group
fun <SID>X(group, fg, bg, attr)
if a:fg != ""
exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . <SID>rgb(a:fg)
endif
if a:bg != ""
exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . <SID>rgb(a:bg)
endif
if a:attr != ""
exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr
endif
endfun
" Vim Highlighting
call <SID>X("Normal", s:foreground, s:background, "")
call <SID>X("LineNr", s:grey, "", "")
call <SID>X("NonText", s:foreground, "", "")
call <SID>X("SpecialKey", s:blue, "", "")
call <SID>X("Search", s:foreground, s:selection, "")
call <SID>X("TabLine", s:foreground, s:background, "reverse")
call <SID>X("StatusLine", s:window, s:foreground, "reverse")
call <SID>X("StatusLineNC", s:window, s:comment, "reverse")
call <SID>X("VertSplit", s:window, s:window, "none")
call <SID>X("Visual", "", s:selection, "")
call <SID>X("Directory", s:blue, "", "")
call <SID>X("ModeMsg", s:green, "", "")
call <SID>X("MoreMsg", s:green, "", "")
call <SID>X("Question", s:green, "", "")
call <SID>X("WarningMsg", s:red, "", "")
call <SID>X("MatchParen", "", s:selection, "")
call <SID>X("Folded", s:comment, s:background, "")
call <SID>X("FoldColumn", s:comment, s:background, "")
if version >= 700
call <SID>X("CursorLine", "", s:line, "none")
call <SID>X("CursorColumn", "", s:line, "none")
call <SID>X("PMenu", s:foreground, s:selection, "none")
call <SID>X("PMenuSel", s:foreground, s:selection, "reverse")
call <SID>X("SignColumn", "", s:background, "none")
end
if version >= 703
call <SID>X("ColorColumn", "", s:line, "none")
end
" Standard Highlighting
call <SID>X("Comment", s:comment, "", "")
call <SID>X("Todo", s:red, s:background, "underline")
call <SID>X("Title", s:comment, "", "")
call <SID>X("Cursor", "", s:foreground, "")
call <SID>X("Identifier", s:grey, "", "none")
call <SID>X("Statement", s:yellow, "", "")
call <SID>X("Conditional", s:foreground, "", "")
call <SID>X("Repeat", s:yellow, "", "")
call <SID>X("Structure", s:purple, "", "")
call <SID>X("Function", s:aqua, "", "")
call <SID>X("Constant", s:foreground, "", "")
call <SID>X("String", s:green, "", "")
call <SID>X("Special", s:foreground, "", "")
call <SID>X("PreProc", s:aqua, "", "")
call <SID>X("Operator", s:foreground, "", "none")
call <SID>X("Type", s:blue, "", "")
call <SID>X("Define", s:purple, "", "none")
call <SID>X("Include", s:blue, "", "")
call <SID>X("Number", s:orange, "", "")
"call <SID>X("Ignore", "666666", "", "")
" Vim Highlighting
call <SID>X("vimCommand", s:blue, "", "")
" C Highlighting
call <SID>X("cType", s:blue, "", "")
call <SID>X("cStorageClass", s:blue, "", "")
call <SID>X("cConditional", s:red, "", "")
call <SID>X("cRepeat", s:red, "", "")
" PHP Highlighting
call <SID>X("phpVarSelector", s:red, "", "")
call <SID>X("phpIdentifier", s:red, "", "")
call <SID>X("phpFCKeyword", s:purple, "", "")
call <SID>X("phpSCKeyword", s:purple, "", "")
call <SID>X("phpKeyword", s:purple, "", "")
call <SID>X("phpType", s:purple, "", "")
call <SID>X("phpRepeat", s:red, "", "")
call <SID>X("phpDefine", s:purple, "", "")
call <SID>X("phpDocTags", s:aqua, "", "")
call <SID>X("phpDocParam", s:green, "", "")
call <SID>X("phpFunction", s:blue, "", "")
call <SID>X("phpFunctions", s:blue, "", "")
call <SID>X("phpClass", s:blue, "", "")
call <SID>X("phpClasses", s:orange, "", "")
call <SID>X("phpMagicConstants", s:yellow, "", "")
call <SID>X("phpMemberSelector", s:grey, "", "")
" Ruby Highlighting
call <SID>X("rubySymbol", s:green, "", "")
call <SID>X("rubyConstant", s:foreground, "", "")
call <SID>X("rubyAttribute", s:blue, "", "")
call <SID>X("rubyInclude", s:blue, "", "")
call <SID>X("rubyLocalVariableOrMethod", s:orange, "", "")
call <SID>X("rubyCurlyBlock", s:orange, "", "")
call <SID>X("rubyStringDelimiter", s:green, "", "")
call <SID>X("rubyInterpolationDelimiter", s:orange, "", "")
call <SID>X("rubyConditional", s:purple, "", "")
call <SID>X("rubyRepeat", s:purple, "", "")
" Python Highlighting
call <SID>X("pythonInclude", s:red, "", "")
call <SID>X("pythonStatement", s:blue, "", "")
call <SID>X("pythonConditional", s:purple, "", "")
call <SID>X("pythonRepeat", s:purple, "", "")
call <SID>X("pythonException", s:purple, "", "")
call <SID>X("pythonFunction", s:aqua, "", "")
call <SID>X("pythonSelf", s:grey, "", "")
call <SID>X("pythonOperator", s:purple, "", "")
call <SID>X("pythonExtraOperator", s:purple, "", "")
call <SID>X("pythonClass", s:aqua, "", "")
call <SID>X("pythonDecorator", s:orange, "", "")
call <SID>X("pythonDocstring", s:comment, "", "")
call <SID>X("pythonBuiltinObj", s:yellow, "", "")
call <SID>X("pythonBuiltinType", s:orange, "", "")
call <SID>X("pythonNumber", s:orange, "", "")
" Go Highlighting
call <SID>X("goStatement", s:purple, "", "")
call <SID>X("goConditional", s:purple, "", "")
call <SID>X("goRepeat", s:purple, "", "")
call <SID>X("goException", s:purple, "", "")
call <SID>X("goDeclaration", s:blue, "", "")
call <SID>X("goConstants", s:yellow, "", "")
call <SID>X("goBuiltins", s:orange, "", "")
" CoffeeScript Highlighting
call <SID>X("coffeeKeyword", s:purple, "", "")
call <SID>X("coffeeConditional", s:purple, "", "")
call <SID>X("coffeeSpecialVar", s:orange, "", "")
call <SID>X("coffeeSpecialIdent", s:red, "", "")
call <SID>X("coffeeObject", s:orange, "", "")
call <SID>X("coffeeObjAssign", s:blue, "", "")
call <SID>X("coffeeArrow", s:purple, "", "")
call <SID>X("coffeeBoolean", s:foreground, "", "")
call <SID>X("coffeeGlobal", s:foreground, "", "")
call <SID>X("coffeeModuleKeyword", s:aqua, "", "")
call <SID>X("coffeeFuncCall", s:blue, "", "")
" JavaScript Highlighting
call <SID>X("javaScriptBraces", s:foreground, "", "")
call <SID>X("javaScriptFunction", s:purple, "", "")
call <SID>X("javaScriptConditional", s:purple, "", "")
call <SID>X("javaScriptRepeat", s:purple, "", "")
call <SID>X("javaScriptNumber", s:orange, "", "")
call <SID>X("javaScriptMember", s:orange, "", "")
" HTML Highlighting
call <SID>X("htmlTag", s:foreground, "", "")
call <SID>X("htmlTagName", s:foreground, "", "")
call <SID>X("htmlArg", s:foreground, "", "")
call <SID>X("htmlScriptTag", s:blue, "", "")
" Blade Tempalte Highlight
call <SID>X("bladeDelimiter", s:orange, "", "")
call <SID>X("bladeKeyword", s:blue, "", "")
" Diff Highlighting
call <SID>X("diffAdded", "", s:green, "none")
call <SID>X("diffRemoved", "", s:red, "none")
call <SID>X("diffChanged", "", s:yellow, "none")
call <SID>X("DiffAdd", s:window, s:green, "none")
call <SID>X("DiffDelete", s:window, s:red, "none")
call <SID>X("DiffChange", s:window, s:yellow, "none")
call <SID>X("DiffText", s:background, s:yellow, "none")
call <SID>X("GitGutterAdd", s:green, "", "")
call <SID>X("GitGutterDelete", s:red, "", "")
call <SID>X("GitGutterChange", s:yellow, "", "")
call <SID>X("GitGutterChangeDelete", s:orange, "", "")
call <SID>X("VimwikiHeader1", s:red, "", "")
call <SID>X("VimwikiHeader2", s:green, "", "")
call <SID>X("VimwikiHeader3", s:blue, "", "")
call <SID>X("VimwikiHeader4", s:aqua, "", "")
call <SID>X("VimwikiHeader5", s:orange, "", "")
call <SID>X("VimwikiHeader6", s:yellow, "", "")
" YAML
call <SID>X("yamlBlockMappingKey", s:blue, "", "")
" Delete Functions
delf <SID>X
delf <SID>rgb
delf <SID>colour
delf <SID>rgb_colour
delf <SID>rgb_level
delf <SID>rgb_number
delf <SID>grey_colour
delf <SID>grey_level
delf <SID>grey_number
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment