From 99bc212d7143cbe41a456bca2f8e7cfce590ddb4 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 13 Sep 2012 22:44:08 -0400 Subject: [PATCH] Add Initial files for vim. --- .bashrc | 2 + .gvimrc | 5 + .vim/.netrwhist | 3 + .vim/colors/Tomorrow-Night-Blue.vim | 347 +++++++++++++++++++++++ .vim/colors/Tomorrow-Night-Bright.vim | 347 +++++++++++++++++++++++ .vim/colors/Tomorrow-Night-Eighties.vim | 347 +++++++++++++++++++++++ .vim/colors/Tomorrow-Night.vim | 362 ++++++++++++++++++++++++ .vim/colors/Tomorrow.vim | 347 +++++++++++++++++++++++ .vimrc | 52 ++++ 9 files changed, 1812 insertions(+) create mode 100644 .gvimrc create mode 100644 .vim/.netrwhist create mode 100644 .vim/colors/Tomorrow-Night-Blue.vim create mode 100644 .vim/colors/Tomorrow-Night-Bright.vim create mode 100644 .vim/colors/Tomorrow-Night-Eighties.vim create mode 100644 .vim/colors/Tomorrow-Night.vim create mode 100644 .vim/colors/Tomorrow.vim create mode 100644 .vimrc diff --git a/.bashrc b/.bashrc index 55387ff..b8864ed 100755 --- a/.bashrc +++ b/.bashrc @@ -11,6 +11,8 @@ fi alias dotfiles='cd; curl -#L https://github.com/atomaka/dotfiles/tarball/master | tar -xzv --strip-components 1 --exclude={README,.gitignore}; source ~/.profile' +alias gvim='gvim -f &' + # Case insensitive matching shopt -s nocaseglob diff --git a/.gvimrc b/.gvimrc new file mode 100644 index 0000000..9826fb7 --- /dev/null +++ b/.gvimrc @@ -0,0 +1,5 @@ +source ~/.vimrc + +colorscheme Tomorrow-Night-Blue +winsize 80 50 +set guifont=Consolas\ 10 diff --git a/.vim/.netrwhist b/.vim/.netrwhist new file mode 100644 index 0000000..66c7798 --- /dev/null +++ b/.vim/.netrwhist @@ -0,0 +1,3 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhist_cnt =1 +let g:netrw_dirhist_1='/home/atomaka/Source/netprint/.git' diff --git a/.vim/colors/Tomorrow-Night-Blue.vim b/.vim/colors/Tomorrow-Night-Blue.vim new file mode 100644 index 0000000..911c99d --- /dev/null +++ b/.vim/colors/Tomorrow-Night-Blue.vim @@ -0,0 +1,347 @@ +" Tomorrow Night Blue - Full Colour and 256 Colour +" http://chriskempson.com +" +" Hex colour conversion functions borrowed from the theme "Desert256"" + +" Default GUI Colours +let s:foreground = "ffffff" +let s:background = "002451" +let s:selection = "003f8e" +let s:line = "00346e" +let s:comment = "7285b7" +let s:red = "ff9da4" +let s:orange = "ffc58f" +let s:yellow = "ffeead" +let s:green = "d1f1a9" +let s:aqua = "99ffff" +let s:blue = "bbdaff" +let s:purple = "ebbbff" +let s:window = "4d5057" + +set background=dark +hi clear +syntax reset + +let g:colors_name = "Tomorrow-Night-Blue" + +if has("gui_running") || &t_Co == 88 || &t_Co == 256 + " Returns an approximate grey index for the given grey level + fun 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 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 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 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 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 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 colour(r, g, b) + " Get the closest grey + let l:gx = grey_number(a:r) + let l:gy = grey_number(a:g) + let l:gz = grey_number(a:b) + + " Get the closest colour + let l:x = rgb_number(a:r) + let l:y = rgb_number(a:g) + let l:z = rgb_number(a:b) + + if l:gx == l:gy && l:gy == l:gz + " There are two possibilities + let l:dgr = grey_level(l:gx) - a:r + let l:dgg = grey_level(l:gy) - a:g + let l:dgb = grey_level(l:gz) - a:b + let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) + let l:dr = rgb_level(l:gx) - a:r + let l:dg = rgb_level(l:gy) - a:g + let l:db = 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 grey_colour(l:gx) + else + " Use the colour + return rgb_colour(l:x, l:y, l:z) + endif + else + " Only one possibility + return rgb_colour(l:x, l:y, l:z) + endif + endfun + + " Returns the palette index to approximate the 'rrggbb' hex string + fun 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 colour(l:r, l:g, l:b) + endfun + + " Sets the highlighting for the given group + fun X(group, fg, bg, attr) + if a:fg != "" + exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) + endif + if a:bg != "" + exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif + endfun + + " Vim Highlighting + call X("Normal", s:foreground, s:background, "") + call X("LineNr", s:selection, "", "") + call X("NonText", s:selection, "", "") + call X("SpecialKey", s:selection, "", "") + call X("Search", s:background, s:yellow, "") + call X("TabLine", s:foreground, s:background, "reverse") + call X("StatusLine", s:window, s:yellow, "reverse") + call X("StatusLineNC", s:window, s:foreground, "reverse") + call X("VertSplit", s:window, s:window, "none") + call X("Visual", "", s:selection, "") + call X("Directory", s:blue, "", "") + call X("ModeMsg", s:green, "", "") + call X("MoreMsg", s:green, "", "") + call X("Question", s:green, "", "") + call X("WarningMsg", s:red, "", "") + call X("MatchParen", "", s:selection, "") + call X("Folded", s:comment, s:background, "") + call X("FoldColumn", "", s:background, "") + if version >= 700 + call X("CursorLine", "", s:line, "none") + call X("CursorColumn", "", s:line, "none") + call X("PMenu", s:foreground, s:selection, "none") + call X("PMenuSel", s:foreground, s:selection, "reverse") + end + if version >= 703 + call X("ColorColumn", "", s:line, "none") + end + + " Standard Highlighting + call X("Comment", s:comment, "", "") + call X("Todo", s:comment, s:background, "") + call X("Title", s:comment, "", "") + call X("Identifier", s:red, "", "none") + call X("Statement", s:foreground, "", "") + call X("Conditional", s:foreground, "", "") + call X("Repeat", s:foreground, "", "") + call X("Structure", s:purple, "", "") + call X("Function", s:blue, "", "") + call X("Constant", s:orange, "", "") + call X("String", s:green, "", "") + call X("Special", s:foreground, "", "") + call X("PreProc", s:purple, "", "") + call X("Operator", s:aqua, "", "none") + call X("Type", s:blue, "", "none") + call X("Define", s:purple, "", "none") + call X("Include", s:blue, "", "") + "call X("Ignore", "666666", "", "") + + " Vim Highlighting + call X("vimCommand", s:red, "", "none") + + " C Highlighting + call X("cType", s:yellow, "", "") + call X("cStorageClass", s:purple, "", "") + call X("cConditional", s:purple, "", "") + call X("cRepeat", s:purple, "", "") + + " PHP Highlighting + call X("phpVarSelector", s:red, "", "") + call X("phpKeyword", s:purple, "", "") + call X("phpRepeat", s:purple, "", "") + call X("phpConditional", s:purple, "", "") + call X("phpStatement", s:purple, "", "") + call X("phpMemberSelector", s:foreground, "", "") + + " Ruby Highlighting + call X("rubySymbol", s:green, "", "") + call X("rubyConstant", s:yellow, "", "") + call X("rubyAttribute", s:blue, "", "") + call X("rubyInclude", s:blue, "", "") + call X("rubyLocalVariableOrMethod", s:orange, "", "") + call X("rubyCurlyBlock", s:orange, "", "") + call X("rubyStringDelimiter", s:green, "", "") + call X("rubyInterpolationDelimiter", s:orange, "", "") + call X("rubyConditional", s:purple, "", "") + call X("rubyRepeat", s:purple, "", "") + + " Python Highlighting + call X("pythonInclude", s:purple, "", "") + call X("pythonStatement", s:purple, "", "") + call X("pythonConditional", s:purple, "", "") + call X("pythonFunction", s:blue, "", "") + + " JavaScript Highlighting + call X("javaScriptBraces", s:foreground, "", "") + call X("javaScriptFunction", s:purple, "", "") + call X("javaScriptConditional", s:purple, "", "") + call X("javaScriptRepeat", s:purple, "", "") + call X("javaScriptNumber", s:orange, "", "") + call X("javaScriptMember", s:orange, "", "") + + " HTML Highlighting + call X("htmlTag", s:red, "", "") + call X("htmlTagName", s:red, "", "") + call X("htmlArg", s:red, "", "") + call X("htmlScriptTag", s:red, "", "") + + " Diff Highlighting + call X("diffAdded", s:green, "", "") + call X("diffRemoved", s:red, "", "") + + " Delete Functions + delf X + delf rgb + delf colour + delf rgb_colour + delf rgb_level + delf rgb_number + delf grey_colour + delf grey_level + delf grey_number +endif diff --git a/.vim/colors/Tomorrow-Night-Bright.vim b/.vim/colors/Tomorrow-Night-Bright.vim new file mode 100644 index 0000000..c222f4e --- /dev/null +++ b/.vim/colors/Tomorrow-Night-Bright.vim @@ -0,0 +1,347 @@ +" Tomorrow Night Bright - Full Colour and 256 Colour +" http://chriskempson.com +" +" Hex colour conversion functions borrowed from the theme "Desert256"" + +" Default GUI Colours +let s:foreground = "eaeaea" +let s:background = "000000" +let s:selection = "424242" +let s:line = "2a2a2a" +let s:comment = "969896" +let s:red = "d54e53" +let s:orange = "e78c45" +let s:yellow = "e7c547" +let s:green = "b9ca4a" +let s:aqua = "70c0b1" +let s:blue = "7aa6da" +let s:purple = "c397d8" +let s:window = "4d5057" + +set background=dark +hi clear +syntax reset + +let g:colors_name = "Tomorrow-Night-Bright" + +if has("gui_running") || &t_Co == 88 || &t_Co == 256 + " Returns an approximate grey index for the given grey level + fun 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 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 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 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 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 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 colour(r, g, b) + " Get the closest grey + let l:gx = grey_number(a:r) + let l:gy = grey_number(a:g) + let l:gz = grey_number(a:b) + + " Get the closest colour + let l:x = rgb_number(a:r) + let l:y = rgb_number(a:g) + let l:z = rgb_number(a:b) + + if l:gx == l:gy && l:gy == l:gz + " There are two possibilities + let l:dgr = grey_level(l:gx) - a:r + let l:dgg = grey_level(l:gy) - a:g + let l:dgb = grey_level(l:gz) - a:b + let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) + let l:dr = rgb_level(l:gx) - a:r + let l:dg = rgb_level(l:gy) - a:g + let l:db = 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 grey_colour(l:gx) + else + " Use the colour + return rgb_colour(l:x, l:y, l:z) + endif + else + " Only one possibility + return rgb_colour(l:x, l:y, l:z) + endif + endfun + + " Returns the palette index to approximate the 'rrggbb' hex string + fun 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 colour(l:r, l:g, l:b) + endfun + + " Sets the highlighting for the given group + fun X(group, fg, bg, attr) + if a:fg != "" + exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) + endif + if a:bg != "" + exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif + endfun + + " Vim Highlighting + call X("Normal", s:foreground, s:background, "") + call X("LineNr", s:selection, "", "") + call X("NonText", s:selection, "", "") + call X("SpecialKey", s:selection, "", "") + call X("Search", s:background, s:yellow, "") + call X("TabLine", s:foreground, s:background, "reverse") + call X("StatusLine", s:window, s:yellow, "reverse") + call X("StatusLineNC", s:window, s:foreground, "reverse") + call X("VertSplit", s:window, s:window, "none") + call X("Visual", "", s:selection, "") + call X("Directory", s:blue, "", "") + call X("ModeMsg", s:green, "", "") + call X("MoreMsg", s:green, "", "") + call X("Question", s:green, "", "") + call X("WarningMsg", s:red, "", "") + call X("MatchParen", "", s:selection, "") + call X("Folded", s:comment, s:background, "") + call X("FoldColumn", "", s:background, "") + if version >= 700 + call X("CursorLine", "", s:line, "none") + call X("CursorColumn", "", s:line, "none") + call X("PMenu", s:foreground, s:selection, "none") + call X("PMenuSel", s:foreground, s:selection, "reverse") + end + if version >= 703 + call X("ColorColumn", "", s:line, "none") + end + + " Standard Highlighting + call X("Comment", s:comment, "", "") + call X("Todo", s:comment, s:background, "") + call X("Title", s:comment, "", "") + call X("Identifier", s:red, "", "none") + call X("Statement", s:foreground, "", "") + call X("Conditional", s:foreground, "", "") + call X("Repeat", s:foreground, "", "") + call X("Structure", s:purple, "", "") + call X("Function", s:blue, "", "") + call X("Constant", s:orange, "", "") + call X("String", s:green, "", "") + call X("Special", s:foreground, "", "") + call X("PreProc", s:purple, "", "") + call X("Operator", s:aqua, "", "none") + call X("Type", s:blue, "", "none") + call X("Define", s:purple, "", "none") + call X("Include", s:blue, "", "") + "call X("Ignore", "666666", "", "") + + " Vim Highlighting + call X("vimCommand", s:red, "", "none") + + " C Highlighting + call X("cType", s:yellow, "", "") + call X("cStorageClass", s:purple, "", "") + call X("cConditional", s:purple, "", "") + call X("cRepeat", s:purple, "", "") + + " PHP Highlighting + call X("phpVarSelector", s:red, "", "") + call X("phpKeyword", s:purple, "", "") + call X("phpRepeat", s:purple, "", "") + call X("phpConditional", s:purple, "", "") + call X("phpStatement", s:purple, "", "") + call X("phpMemberSelector", s:foreground, "", "") + + " Ruby Highlighting + call X("rubySymbol", s:green, "", "") + call X("rubyConstant", s:yellow, "", "") + call X("rubyAttribute", s:blue, "", "") + call X("rubyInclude", s:blue, "", "") + call X("rubyLocalVariableOrMethod", s:orange, "", "") + call X("rubyCurlyBlock", s:orange, "", "") + call X("rubyStringDelimiter", s:green, "", "") + call X("rubyInterpolationDelimiter", s:orange, "", "") + call X("rubyConditional", s:purple, "", "") + call X("rubyRepeat", s:purple, "", "") + + " Python Highlighting + call X("pythonInclude", s:purple, "", "") + call X("pythonStatement", s:purple, "", "") + call X("pythonConditional", s:purple, "", "") + call X("pythonFunction", s:blue, "", "") + + " JavaScript Highlighting + call X("javaScriptBraces", s:foreground, "", "") + call X("javaScriptFunction", s:purple, "", "") + call X("javaScriptConditional", s:purple, "", "") + call X("javaScriptRepeat", s:purple, "", "") + call X("javaScriptNumber", s:orange, "", "") + call X("javaScriptMember", s:orange, "", "") + + " HTML Highlighting + call X("htmlTag", s:red, "", "") + call X("htmlTagName", s:red, "", "") + call X("htmlArg", s:red, "", "") + call X("htmlScriptTag", s:red, "", "") + + " Diff Highlighting + call X("diffAdded", s:green, "", "") + call X("diffRemoved", s:red, "", "") + + " Delete Functions + delf X + delf rgb + delf colour + delf rgb_colour + delf rgb_level + delf rgb_number + delf grey_colour + delf grey_level + delf grey_number +endif diff --git a/.vim/colors/Tomorrow-Night-Eighties.vim b/.vim/colors/Tomorrow-Night-Eighties.vim new file mode 100644 index 0000000..7426924 --- /dev/null +++ b/.vim/colors/Tomorrow-Night-Eighties.vim @@ -0,0 +1,347 @@ +" Tomorrow Night Eighties - Full Colour and 256 Colour +" http://chriskempson.com +" +" Hex colour conversion functions borrowed from the theme "Desert256"" + +" Default GUI Colours +let s:foreground = "cccccc" +let s:background = "2d2d2d" +let s:selection = "515151" +let s:line = "393939" +let s:comment = "999999" +let s:red = "f2777a" +let s:orange = "f99157" +let s:yellow = "ffcc66" +let s:green = "99cc99" +let s:aqua = "009999" +let s:blue = "99cccc" +let s:purple = "cc99cc" +let s:window = "4d5057" + +set background=dark +hi clear +syntax reset + +let g:colors_name = "Tomorrow-Night-Eighties" + +if has("gui_running") || &t_Co == 88 || &t_Co == 256 + " Returns an approximate grey index for the given grey level + fun 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 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 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 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 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 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 colour(r, g, b) + " Get the closest grey + let l:gx = grey_number(a:r) + let l:gy = grey_number(a:g) + let l:gz = grey_number(a:b) + + " Get the closest colour + let l:x = rgb_number(a:r) + let l:y = rgb_number(a:g) + let l:z = rgb_number(a:b) + + if l:gx == l:gy && l:gy == l:gz + " There are two possibilities + let l:dgr = grey_level(l:gx) - a:r + let l:dgg = grey_level(l:gy) - a:g + let l:dgb = grey_level(l:gz) - a:b + let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) + let l:dr = rgb_level(l:gx) - a:r + let l:dg = rgb_level(l:gy) - a:g + let l:db = 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 grey_colour(l:gx) + else + " Use the colour + return rgb_colour(l:x, l:y, l:z) + endif + else + " Only one possibility + return rgb_colour(l:x, l:y, l:z) + endif + endfun + + " Returns the palette index to approximate the 'rrggbb' hex string + fun 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 colour(l:r, l:g, l:b) + endfun + + " Sets the highlighting for the given group + fun X(group, fg, bg, attr) + if a:fg != "" + exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) + endif + if a:bg != "" + exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif + endfun + + " Vim Highlighting + call X("Normal", s:foreground, s:background, "") + call X("LineNr", s:selection, "", "") + call X("NonText", s:selection, "", "") + call X("SpecialKey", s:selection, "", "") + call X("Search", s:background, s:yellow, "") + call X("TabLine", s:foreground, s:background, "reverse") + call X("StatusLine", s:window, s:yellow, "reverse") + call X("StatusLineNC", s:window, s:foreground, "reverse") + call X("VertSplit", s:window, s:window, "none") + call X("Visual", "", s:selection, "") + call X("Directory", s:blue, "", "") + call X("ModeMsg", s:green, "", "") + call X("MoreMsg", s:green, "", "") + call X("Question", s:green, "", "") + call X("WarningMsg", s:red, "", "") + call X("MatchParen", "", s:selection, "") + call X("Folded", s:comment, s:background, "") + call X("FoldColumn", "", s:background, "") + if version >= 700 + call X("CursorLine", "", s:line, "none") + call X("CursorColumn", "", s:line, "none") + call X("PMenu", s:foreground, s:selection, "none") + call X("PMenuSel", s:foreground, s:selection, "reverse") + end + if version >= 703 + call X("ColorColumn", "", s:line, "none") + end + + " Standard Highlighting + call X("Comment", s:comment, "", "") + call X("Todo", s:comment, s:background, "") + call X("Title", s:comment, "", "") + call X("Identifier", s:red, "", "none") + call X("Statement", s:foreground, "", "") + call X("Conditional", s:foreground, "", "") + call X("Repeat", s:foreground, "", "") + call X("Structure", s:purple, "", "") + call X("Function", s:blue, "", "") + call X("Constant", s:orange, "", "") + call X("String", s:green, "", "") + call X("Special", s:foreground, "", "") + call X("PreProc", s:purple, "", "") + call X("Operator", s:aqua, "", "none") + call X("Type", s:blue, "", "none") + call X("Define", s:purple, "", "none") + call X("Include", s:blue, "", "") + "call X("Ignore", "666666", "", "") + + " Vim Highlighting + call X("vimCommand", s:red, "", "none") + + " C Highlighting + call X("cType", s:yellow, "", "") + call X("cStorageClass", s:purple, "", "") + call X("cConditional", s:purple, "", "") + call X("cRepeat", s:purple, "", "") + + " PHP Highlighting + call X("phpVarSelector", s:red, "", "") + call X("phpKeyword", s:purple, "", "") + call X("phpRepeat", s:purple, "", "") + call X("phpConditional", s:purple, "", "") + call X("phpStatement", s:purple, "", "") + call X("phpMemberSelector", s:foreground, "", "") + + " Ruby Highlighting + call X("rubySymbol", s:green, "", "") + call X("rubyConstant", s:yellow, "", "") + call X("rubyAttribute", s:blue, "", "") + call X("rubyInclude", s:blue, "", "") + call X("rubyLocalVariableOrMethod", s:orange, "", "") + call X("rubyCurlyBlock", s:orange, "", "") + call X("rubyStringDelimiter", s:green, "", "") + call X("rubyInterpolationDelimiter", s:orange, "", "") + call X("rubyConditional", s:purple, "", "") + call X("rubyRepeat", s:purple, "", "") + + " Python Highlighting + call X("pythonInclude", s:purple, "", "") + call X("pythonStatement", s:purple, "", "") + call X("pythonConditional", s:purple, "", "") + call X("pythonFunction", s:blue, "", "") + + " JavaScript Highlighting + call X("javaScriptBraces", s:foreground, "", "") + call X("javaScriptFunction", s:purple, "", "") + call X("javaScriptConditional", s:purple, "", "") + call X("javaScriptRepeat", s:purple, "", "") + call X("javaScriptNumber", s:orange, "", "") + call X("javaScriptMember", s:orange, "", "") + + " HTML Highlighting + call X("htmlTag", s:red, "", "") + call X("htmlTagName", s:red, "", "") + call X("htmlArg", s:red, "", "") + call X("htmlScriptTag", s:red, "", "") + + " Diff Highlighting + call X("diffAdded", s:green, "", "") + call X("diffRemoved", s:red, "", "") + + " Delete Functions + delf X + delf rgb + delf colour + delf rgb_colour + delf rgb_level + delf rgb_number + delf grey_colour + delf grey_level + delf grey_number +endif diff --git a/.vim/colors/Tomorrow-Night.vim b/.vim/colors/Tomorrow-Night.vim new file mode 100644 index 0000000..208b6d4 --- /dev/null +++ b/.vim/colors/Tomorrow-Night.vim @@ -0,0 +1,362 @@ +" Tomorrow Night - Full Colour and 256 Colour +" http://chriskempson.com +" +" Hex colour conversion functions borrowed from the theme "Desert256"" + +" Default GUI Colours +let s:foreground = "c5c8c6" +let s:background = "1d1f21" +let s:selection = "373b41" +let s:line = "282a2e" +let s:comment = "969896" +let s:red = "cc6666" +let s:orange = "de935f" +let s:yellow = "f0c674" +let s:green = "b5bd68" +let s:aqua = "8abeb7" +let s:blue = "81a2be" +let s:purple = "b294bb" +let s:window = "4d5057" + +" Console 256 Colours +if !has("gui_running") + let s:background = "303030" + let s:window = "5e5e5e" + let s:line = "3a3a3a" + let s:selection = "585858" +end + +set background=dark +hi clear +syntax reset + +let g:colors_name = "Tomorrow-Night" + +if has("gui_running") || &t_Co == 88 || &t_Co == 256 + " Returns an approximate grey index for the given grey level + fun 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 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 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 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 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 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 colour(r, g, b) + " Get the closest grey + let l:gx = grey_number(a:r) + let l:gy = grey_number(a:g) + let l:gz = grey_number(a:b) + + " Get the closest colour + let l:x = rgb_number(a:r) + let l:y = rgb_number(a:g) + let l:z = rgb_number(a:b) + + if l:gx == l:gy && l:gy == l:gz + " There are two possibilities + let l:dgr = grey_level(l:gx) - a:r + let l:dgg = grey_level(l:gy) - a:g + let l:dgb = grey_level(l:gz) - a:b + let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) + let l:dr = rgb_level(l:gx) - a:r + let l:dg = rgb_level(l:gy) - a:g + let l:db = 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 grey_colour(l:gx) + else + " Use the colour + return rgb_colour(l:x, l:y, l:z) + endif + else + " Only one possibility + return rgb_colour(l:x, l:y, l:z) + endif + endfun + + " Returns the palette index to approximate the 'rrggbb' hex string + fun 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 colour(l:r, l:g, l:b) + endfun + + " Sets the highlighting for the given group + fun X(group, fg, bg, attr) + if a:fg != "" + exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) + endif + if a:bg != "" + exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif + endfun + + " Vim Highlighting + call X("Normal", s:foreground, s:background, "") + call X("LineNr", s:selection, "", "") + call X("NonText", s:selection, "", "") + call X("SpecialKey", s:selection, "", "") + call X("Search", s:background, s:yellow, "") + call X("TabLine", s:foreground, s:background, "reverse") + call X("StatusLine", s:window, s:yellow, "reverse") + call X("StatusLineNC", s:window, s:foreground, "reverse") + call X("VertSplit", s:window, s:window, "none") + call X("Visual", "", s:selection, "") + call X("Directory", s:blue, "", "") + call X("ModeMsg", s:green, "", "") + call X("MoreMsg", s:green, "", "") + call X("Question", s:green, "", "") + call X("WarningMsg", s:red, "", "") + call X("MatchParen", "", s:selection, "") + call X("Folded", s:comment, s:background, "") + call X("FoldColumn", "", s:background, "") + if version >= 700 + call X("CursorLine", "", s:line, "none") + call X("CursorColumn", "", s:line, "none") + call X("PMenu", s:foreground, s:selection, "none") + call X("PMenuSel", s:foreground, s:selection, "reverse") + call X("SignColumn", "", s:background, "none") + end + if version >= 703 + call X("ColorColumn", "", s:line, "none") + end + + " Standard Highlighting + call X("Comment", s:comment, "", "") + call X("Todo", s:comment, s:background, "") + call X("Title", s:comment, "", "") + call X("Identifier", s:red, "", "none") + call X("Statement", s:foreground, "", "") + call X("Conditional", s:foreground, "", "") + call X("Repeat", s:foreground, "", "") + call X("Structure", s:purple, "", "") + call X("Function", s:blue, "", "") + call X("Constant", s:orange, "", "") + call X("String", s:green, "", "") + call X("Special", s:foreground, "", "") + call X("PreProc", s:purple, "", "") + call X("Operator", s:aqua, "", "none") + call X("Type", s:blue, "", "none") + call X("Define", s:purple, "", "none") + call X("Include", s:blue, "", "") + "call X("Ignore", "666666", "", "") + + " Vim Highlighting + call X("vimCommand", s:red, "", "none") + + " C Highlighting + call X("cType", s:yellow, "", "") + call X("cStorageClass", s:purple, "", "") + call X("cConditional", s:purple, "", "") + call X("cRepeat", s:purple, "", "") + + " PHP Highlighting + call X("phpVarSelector", s:red, "", "") + call X("phpKeyword", s:purple, "", "") + call X("phpRepeat", s:purple, "", "") + call X("phpConditional", s:purple, "", "") + call X("phpStatement", s:purple, "", "") + call X("phpMemberSelector", s:foreground, "", "") + + " Ruby Highlighting + call X("rubySymbol", s:green, "", "") + call X("rubyConstant", s:yellow, "", "") + call X("rubyAttribute", s:blue, "", "") + call X("rubyInclude", s:blue, "", "") + call X("rubyLocalVariableOrMethod", s:orange, "", "") + call X("rubyCurlyBlock", s:orange, "", "") + call X("rubyStringDelimiter", s:green, "", "") + call X("rubyInterpolationDelimiter", s:orange, "", "") + call X("rubyConditional", s:purple, "", "") + call X("rubyRepeat", s:purple, "", "") + + " Python Highlighting + call X("pythonInclude", s:purple, "", "") + call X("pythonStatement", s:purple, "", "") + call X("pythonConditional", s:purple, "", "") + call X("pythonFunction", s:blue, "", "") + + " JavaScript Highlighting + call X("javaScriptBraces", s:foreground, "", "") + call X("javaScriptFunction", s:purple, "", "") + call X("javaScriptConditional", s:purple, "", "") + call X("javaScriptRepeat", s:purple, "", "") + call X("javaScriptNumber", s:orange, "", "") + call X("javaScriptMember", s:orange, "", "") + + " HTML Highlighting + call X("htmlTag", s:red, "", "") + call X("htmlTagName", s:red, "", "") + call X("htmlArg", s:red, "", "") + call X("htmlScriptTag", s:red, "", "") + + " Diff Highlighting + call X("diffAdded", s:green, "", "") + call X("diffRemoved", s:red, "", "") + + " ShowMarks Highlighting + call X("ShowMarksHLl", s:orange, s:background, "none") + call X("ShowMarksHLo", s:purple, s:background, "none") + call X("ShowMarksHLu", s:yellow, s:background, "none") + call X("ShowMarksHLm", s:aqua, s:background, "none") + + " Delete Functions + delf X + delf rgb + delf colour + delf rgb_colour + delf rgb_level + delf rgb_number + delf grey_colour + delf grey_level + delf grey_number +endif diff --git a/.vim/colors/Tomorrow.vim b/.vim/colors/Tomorrow.vim new file mode 100644 index 0000000..fb58c5f --- /dev/null +++ b/.vim/colors/Tomorrow.vim @@ -0,0 +1,347 @@ +" Tomorrow - Full Colour and 256 Colour +" http://chriskempson.com +" +" Hex colour conversion functions borrowed from the theme "Desert256"" + +" Default GUI Colours +let s:foreground = "4d4d4c" +let s:background = "fafafa" +let s:selection = "d6d6d6" +let s:line = "efefef" +let s:comment = "8e908c" +let s:red = "c82829" +let s:orange = "f5871f" +let s:yellow = "eab700" +let s:green = "718c00" +let s:aqua = "3e999f" +let s:blue = "4271ae" +let s:purple = "8959a8" +let s:window = "efefef" + +set background=light +hi clear +syntax reset + +let g:colors_name = "Tomorrow" + +if has("gui_running") || &t_Co == 88 || &t_Co == 256 + " Returns an approximate grey index for the given grey level + fun 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 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 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 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 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 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 colour(r, g, b) + " Get the closest grey + let l:gx = grey_number(a:r) + let l:gy = grey_number(a:g) + let l:gz = grey_number(a:b) + + " Get the closest colour + let l:x = rgb_number(a:r) + let l:y = rgb_number(a:g) + let l:z = rgb_number(a:b) + + if l:gx == l:gy && l:gy == l:gz + " There are two possibilities + let l:dgr = grey_level(l:gx) - a:r + let l:dgg = grey_level(l:gy) - a:g + let l:dgb = grey_level(l:gz) - a:b + let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) + let l:dr = rgb_level(l:gx) - a:r + let l:dg = rgb_level(l:gy) - a:g + let l:db = 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 grey_colour(l:gx) + else + " Use the colour + return rgb_colour(l:x, l:y, l:z) + endif + else + " Only one possibility + return rgb_colour(l:x, l:y, l:z) + endif + endfun + + " Returns the palette index to approximate the 'rrggbb' hex string + fun 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 colour(l:r, l:g, l:b) + endfun + + " Sets the highlighting for the given group + fun X(group, fg, bg, attr) + if a:fg != "" + exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . rgb(a:fg) + endif + if a:bg != "" + exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . rgb(a:bg) + endif + if a:attr != "" + exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr + endif + endfun + + " Vim Highlighting + call X("Normal", s:foreground, s:background, "") + highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE + call X("NonText", s:selection, "", "") + call X("SpecialKey", s:selection, "", "") + call X("Search", s:foreground, s:yellow, "") + call X("TabLine", s:foreground, s:background, "reverse") + call X("StatusLine", s:window, s:yellow, "reverse") + call X("StatusLineNC", s:window, s:foreground, "reverse") + call X("VertSplit", s:window, s:window, "none") + call X("Visual", "", s:selection, "") + call X("Directory", s:blue, "", "") + call X("ModeMsg", s:green, "", "") + call X("MoreMsg", s:green, "", "") + call X("Question", s:green, "", "") + call X("WarningMsg", s:red, "", "") + call X("MatchParen", "", s:selection, "") + call X("Folded", s:comment, s:background, "") + call X("FoldColumn", "", s:background, "") + if version >= 700 + call X("CursorLine", "", s:line, "none") + call X("CursorColumn", "", s:line, "none") + call X("PMenu", s:foreground, s:selection, "none") + call X("PMenuSel", s:foreground, s:selection, "reverse") + end + if version >= 703 + call X("ColorColumn", "", s:line, "none") + end + + " Standard Highlighting + call X("Comment", s:comment, "", "") + call X("Todo", s:comment, s:background, "") + call X("Title", s:comment, "", "") + call X("Identifier", s:red, "", "none") + call X("Statement", s:foreground, "", "") + call X("Conditional", s:foreground, "", "") + call X("Repeat", s:foreground, "", "") + call X("Structure", s:purple, "", "") + call X("Function", s:blue, "", "") + call X("Constant", s:orange, "", "") + call X("String", s:green, "", "") + call X("Special", s:foreground, "", "") + call X("PreProc", s:purple, "", "") + call X("Operator", s:aqua, "", "none") + call X("Type", s:blue, "", "none") + call X("Define", s:purple, "", "none") + call X("Include", s:blue, "", "") + "call X("Ignore", "666666", "", "") + + " Vim Highlighting + call X("vimCommand", s:red, "", "none") + + " C Highlighting + call X("cType", s:yellow, "", "") + call X("cStorageClass", s:purple, "", "") + call X("cConditional", s:purple, "", "") + call X("cRepeat", s:purple, "", "") + + " PHP Highlighting + call X("phpVarSelector", s:red, "", "") + call X("phpKeyword", s:purple, "", "") + call X("phpRepeat", s:purple, "", "") + call X("phpConditional", s:purple, "", "") + call X("phpStatement", s:purple, "", "") + call X("phpMemberSelector", s:foreground, "", "") + + " Ruby Highlighting + call X("rubySymbol", s:green, "", "") + call X("rubyConstant", s:yellow, "", "") + call X("rubyAttribute", s:blue, "", "") + call X("rubyInclude", s:blue, "", "") + call X("rubyLocalVariableOrMethod", s:orange, "", "") + call X("rubyCurlyBlock", s:orange, "", "") + call X("rubyStringDelimiter", s:green, "", "") + call X("rubyInterpolationDelimiter", s:orange, "", "") + call X("rubyConditional", s:purple, "", "") + call X("rubyRepeat", s:purple, "", "") + + " Python Highlighting + call X("pythonInclude", s:purple, "", "") + call X("pythonStatement", s:purple, "", "") + call X("pythonConditional", s:purple, "", "") + call X("pythonFunction", s:blue, "", "") + + " JavaScript Highlighting + call X("javaScriptBraces", s:foreground, "", "") + call X("javaScriptFunction", s:purple, "", "") + call X("javaScriptConditional", s:purple, "", "") + call X("javaScriptRepeat", s:purple, "", "") + call X("javaScriptNumber", s:orange, "", "") + call X("javaScriptMember", s:orange, "", "") + + " HTML Highlighting + call X("htmlTag", s:red, "", "") + call X("htmlTagName", s:red, "", "") + call X("htmlArg", s:red, "", "") + call X("htmlScriptTag", s:red, "", "") + + " Diff Highlighting + call X("diffAdded", s:green, "", "") + call X("diffRemoved", s:red, "", "") + + " Delete Functions + delf X + delf rgb + delf colour + delf rgb_colour + delf rgb_level + delf rgb_number + delf grey_colour + delf grey_level + delf grey_number +endif diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..dc6a96d --- /dev/null +++ b/.vimrc @@ -0,0 +1,52 @@ +" --- Options ---------------------------------------------------------------{{{ +set nocompatible " Disable vi compatability +set ffs=unix,dos " File format prefer unix endings +set eol " Add newline at end of file +set shellslash " Use forward slashes for file names +" set vb " Visual bell instead of beep +set nobk " Do not use backup files +set formatoptions=crq " Format options: wrap (c)omments at textwidth, insert comment leade(r), and unknown +set textwidth=80 " 80 characters wide +set hidden " Allow unsaved buffers to be hidden +set laststatus=2 " Always use status line +set showmode " Display current mode +set ch=2 " Command line two lines high +set wildmenu " Command line completion helper +if exists("&wildignorecase") " Windows gvim does not have this (it's automatic) + set wildignorecase " Ignore case when tab-completing files +endif +set timeoutlen=500 " Timeout for remaps +set history=100 " Keep some stuff in the history +set mousehide " Hide the mouse pointer while typing +set scrolloff=8 " Always keep cursor 8 lines from edge +set virtualedit=all " Allow the cursor to go to invalid places +set synmaxcol=1024 " Disable coloring on long lines (helps with large files) +set cul " Highlight current line +set nowrap " Disable wrapping by default +set backspace=2 " Allow backspace over indent, eol, and start of insert +set cpoptions+=$ " Change commands will display a $ to mark end of changed text +set hlsearch " Search highlights +set wrapscan " Search will continue past end of document +set incsearch " Search as you type +set ignorecase " Search will ignore case +set smartcase " Search will respect case if any letter is uppercase +set showcmd " Show command in bottom-right as you type it +set hls " Highlight search +syntax on " Turn on syntax highlighting + +" Tabstops are 2 spaces +set tabstop=2 +set softtabstop=2 +set shiftwidth=2 +set expandtab + +" Set the status line +set stl=%f\ %m\ %r\ Line:\ %l/%L[%p%%]\ Col:\ %c\ Buf:\ #%n\ [%b][0x%B] + + +" Filetype specific stuff +filetype on +filetype plugin on +filetype indent on +" --- }}} +