Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Many tweaks including powerline and a new color scheme

  • Loading branch information...
commit c5446df9903b870f07286151e5145c19f9c5d8e5 1 parent da9971c
Phil Crosby authored August 28, 2012
110  autoload/Powerline/Themes/my_powerline_theme.vim
... ...
@@ -0,0 +1,110 @@
  1
+let g:Powerline#Themes#my_powerline_theme#theme = Pl#Theme#Create(
  2
+	\ Pl#Theme#Buffer(''
  3
+		\ , 'paste_indicator'
  4
+		\ , 'mode_indicator'
  5
+		\ , 'fileinfo'
  6
+		\ , 'syntastic:errors'
  7
+		\ , Pl#Segment#Truncate()
  8
+		\ , 'tagbar:currenttag'
  9
+		\ , Pl#Segment#Split()
  10
+		\ , 'virtualenv:statusline'
  11
+		\ , 'filetype'
  12
+		\ , 'lineinfo'
  13
+	\ ),
  14
+	\
  15
+	\ Pl#Theme#Buffer('command_t'
  16
+		\ , ['static_str.name', 'Command-T']
  17
+		\ , Pl#Segment#Truncate()
  18
+		\ , Pl#Segment#Split()
  19
+		\ , ['raw.line', '%10(Match #%l%)']
  20
+	\ ),
  21
+	\
  22
+	\ Pl#Theme#Buffer('gundo', Pl#Match#Any('gundo_tree')
  23
+		\ , ['static_str.name', 'Gundo']
  24
+		\ , ['static_str.buffer', 'Undo tree']
  25
+		\ , Pl#Segment#Truncate()
  26
+		\ , Pl#Segment#Split()
  27
+	\ ),
  28
+	\
  29
+	\ Pl#Theme#Buffer('gundo', Pl#Match#Any('gundo_preview')
  30
+		\ , ['static_str.name', 'Gundo']
  31
+		\ , ['static_str.buffer', 'Diff preview']
  32
+		\ , Pl#Segment#Truncate()
  33
+		\ , Pl#Segment#Split()
  34
+	\ ),
  35
+	\
  36
+	\ Pl#Theme#Buffer('bt_help'
  37
+		\ , ['static_str.name', 'Help']
  38
+		\ , 'filename'
  39
+		\ , Pl#Segment#Truncate()
  40
+		\ , Pl#Segment#Split()
  41
+		\ , 'scrollpercent'
  42
+	\ ),
  43
+	\
  44
+	\ Pl#Theme#Buffer('ft_vimpager'
  45
+		\ , ['static_str.name', 'Pager']
  46
+		\ , 'filename'
  47
+		\ , Pl#Segment#Truncate()
  48
+		\ , Pl#Segment#Split()
  49
+		\ , 'scrollpercent'
  50
+	\ ),
  51
+	\
  52
+	\ Pl#Theme#Buffer('lustyexplorer'
  53
+		\ , ['static_str.name', 'LustyExplorer']
  54
+		\ , ['static_str.buffer', 'Buffer list']
  55
+		\ , Pl#Segment#Truncate()
  56
+		\ , Pl#Segment#Split()
  57
+	\ ),
  58
+	\
  59
+	\ Pl#Theme#Buffer('ft_man'
  60
+		\ , ['static_str.name', 'Man page']
  61
+		\ , 'filename'
  62
+		\ , Pl#Segment#Truncate()
  63
+		\ , Pl#Segment#Split()
  64
+		\ , 'scrollpercent'
  65
+	\ ),
  66
+	\
  67
+	\ Pl#Theme#Buffer('minibufexplorer'
  68
+		\ , ['static_str.name', 'MiniBufExplorer']
  69
+		\ , Pl#Segment#Truncate()
  70
+		\ , Pl#Segment#Split()
  71
+	\ ),
  72
+	\
  73
+	\ Pl#Theme#Buffer('ft_qf'
  74
+		\ , ['static_str.name', 'Quickfix']
  75
+		\ , Pl#Segment#Truncate()
  76
+		\ , Pl#Segment#Split()
  77
+	\ ),
  78
+	\
  79
+	\ Pl#Theme#Buffer('tagbar'
  80
+		\ , ['static_str.name', 'Tagbar']
  81
+		\ , ['static_str.buffer', 'Tree']
  82
+		\ , Pl#Segment#Truncate()
  83
+		\ , Pl#Segment#Split()
  84
+	\ ),
  85
+	\
  86
+	\ Pl#Theme#Buffer('ctrlp', Pl#Theme#Callback('ctrlp_main', 'if ! exists("g:ctrlp_status_func") | let g:ctrlp_status_func = {} | endif | let g:ctrlp_status_func.main = "%s"')
  87
+		\ , 'ctrlp:prev'
  88
+		\ , 'ctrlp:item'
  89
+		\ , 'ctrlp:next'
  90
+		\ , 'ctrlp:marked'
  91
+		\ , Pl#Segment#Truncate()
  92
+		\ , Pl#Segment#Split()
  93
+		\ , 'ctrlp:focus'
  94
+		\ , 'ctrlp:byfname'
  95
+		\ , 'pwd'
  96
+	\ ),
  97
+	\
  98
+	\ Pl#Theme#Buffer('ctrlp', Pl#Theme#Callback('ctrlp_prog', 'if ! exists("g:ctrlp_status_func") | let g:ctrlp_status_func = {} | endif | let g:ctrlp_status_func.prog = "%s"')
  99
+		\ , 'ctrlp:count'
  100
+		\ , Pl#Segment#Truncate()
  101
+		\ , Pl#Segment#Split()
  102
+		\ , 'pwd'
  103
+	\ ),
  104
+	\
  105
+	\ Pl#Theme#Buffer('nerdtree'
  106
+		\ , ['raw.name', '%{Powerline#Functions#GetShortPath(4)}']
  107
+		\ , Pl#Segment#Truncate()
  108
+		\ , Pl#Segment#Split()
  109
+	\ )
  110
+\ )
347  colors/Tomorrow-Night-Bright.vim
... ...
@@ -0,0 +1,347 @@
  1
+" Tomorrow Night Bright - Full Colour and 256 Colour
  2
+" http://chriskempson.com
  3
+"
  4
+" Hex colour conversion functions borrowed from the theme "Desert256""
  5
+
  6
+" Default GUI Colours
  7
+let s:foreground = "eaeaea"
  8
+let s:background = "000000"
  9
+let s:selection = "424242"
  10
+let s:line = "2a2a2a"
  11
+let s:comment = "969896"
  12
+let s:red = "d54e53"
  13
+let s:orange = "e78c45"
  14
+let s:yellow = "e7c547"
  15
+let s:green = "b9ca4a"
  16
+let s:aqua = "70c0b1"
  17
+let s:blue = "7aa6da"
  18
+let s:purple = "c397d8"
  19
+let s:window = "4d5057"
  20
+
  21
+set background=dark
  22
+hi clear
  23
+syntax reset
  24
+
  25
+let g:colors_name = "Tomorrow-Night-Bright"
  26
+
  27
+if has("gui_running") || &t_Co == 88 || &t_Co == 256
  28
+	" Returns an approximate grey index for the given grey level
  29
+	fun <SID>grey_number(x)
  30
+		if &t_Co == 88
  31
+			if a:x < 23
  32
+				return 0
  33
+			elseif a:x < 69
  34
+				return 1
  35
+			elseif a:x < 103
  36
+				return 2
  37
+			elseif a:x < 127
  38
+				return 3
  39
+			elseif a:x < 150
  40
+				return 4
  41
+			elseif a:x < 173
  42
+				return 5
  43
+			elseif a:x < 196
  44
+				return 6
  45
+			elseif a:x < 219
  46
+				return 7
  47
+			elseif a:x < 243
  48
+				return 8
  49
+			else
  50
+				return 9
  51
+			endif
  52
+		else
  53
+			if a:x < 14
  54
+				return 0
  55
+			else
  56
+				let l:n = (a:x - 8) / 10
  57
+				let l:m = (a:x - 8) % 10
  58
+				if l:m < 5
  59
+					return l:n
  60
+				else
  61
+					return l:n + 1
  62
+				endif
  63
+			endif
  64
+		endif
  65
+	endfun
  66
+
  67
+	" Returns the actual grey level represented by the grey index
  68
+	fun <SID>grey_level(n)
  69
+		if &t_Co == 88
  70
+			if a:n == 0
  71
+				return 0
  72
+			elseif a:n == 1
  73
+				return 46
  74
+			elseif a:n == 2
  75
+				return 92
  76
+			elseif a:n == 3
  77
+				return 115
  78
+			elseif a:n == 4
  79
+				return 139
  80
+			elseif a:n == 5
  81
+				return 162
  82
+			elseif a:n == 6
  83
+				return 185
  84
+			elseif a:n == 7
  85
+				return 208
  86
+			elseif a:n == 8
  87
+				return 231
  88
+			else
  89
+				return 255
  90
+			endif
  91
+		else
  92
+			if a:n == 0
  93
+				return 0
  94
+			else
  95
+				return 8 + (a:n * 10)
  96
+			endif
  97
+		endif
  98
+	endfun
  99
+
  100
+	" Returns the palette index for the given grey index
  101
+	fun <SID>grey_colour(n)
  102
+		if &t_Co == 88
  103
+			if a:n == 0
  104
+				return 16
  105
+			elseif a:n == 9
  106
+				return 79
  107
+			else
  108
+				return 79 + a:n
  109
+			endif
  110
+		else
  111
+			if a:n == 0
  112
+				return 16
  113
+			elseif a:n == 25
  114
+				return 231
  115
+			else
  116
+				return 231 + a:n
  117
+			endif
  118
+		endif
  119
+	endfun
  120
+
  121
+	" Returns an approximate colour index for the given colour level
  122
+	fun <SID>rgb_number(x)
  123
+		if &t_Co == 88
  124
+			if a:x < 69
  125
+				return 0
  126
+			elseif a:x < 172
  127
+				return 1
  128
+			elseif a:x < 230
  129
+				return 2
  130
+			else
  131
+				return 3
  132
+			endif
  133
+		else
  134
+			if a:x < 75
  135
+				return 0
  136
+			else
  137
+				let l:n = (a:x - 55) / 40
  138
+				let l:m = (a:x - 55) % 40
  139
+				if l:m < 20
  140
+					return l:n
  141
+				else
  142
+					return l:n + 1
  143
+				endif
  144
+			endif
  145
+		endif
  146
+	endfun
  147
+
  148
+	" Returns the actual colour level for the given colour index
  149
+	fun <SID>rgb_level(n)
  150
+		if &t_Co == 88
  151
+			if a:n == 0
  152
+				return 0
  153
+			elseif a:n == 1
  154
+				return 139
  155
+			elseif a:n == 2
  156
+				return 205
  157
+			else
  158
+				return 255
  159
+			endif
  160
+		else
  161
+			if a:n == 0
  162
+				return 0
  163
+			else
  164
+				return 55 + (a:n * 40)
  165
+			endif
  166
+		endif
  167
+	endfun
  168
+
  169
+	" Returns the palette index for the given R/G/B colour indices
  170
+	fun <SID>rgb_colour(x, y, z)
  171
+		if &t_Co == 88
  172
+			return 16 + (a:x * 16) + (a:y * 4) + a:z
  173
+		else
  174
+			return 16 + (a:x * 36) + (a:y * 6) + a:z
  175
+		endif
  176
+	endfun
  177
+
  178
+	" Returns the palette index to approximate the given R/G/B colour levels
  179
+	fun <SID>colour(r, g, b)
  180
+		" Get the closest grey
  181
+		let l:gx = <SID>grey_number(a:r)
  182
+		let l:gy = <SID>grey_number(a:g)
  183
+		let l:gz = <SID>grey_number(a:b)
  184
+
  185
+		" Get the closest colour
  186
+		let l:x = <SID>rgb_number(a:r)
  187
+		let l:y = <SID>rgb_number(a:g)
  188
+		let l:z = <SID>rgb_number(a:b)
  189
+
  190
+		if l:gx == l:gy && l:gy == l:gz
  191
+			" There are two possibilities
  192
+			let l:dgr = <SID>grey_level(l:gx) - a:r
  193
+			let l:dgg = <SID>grey_level(l:gy) - a:g
  194
+			let l:dgb = <SID>grey_level(l:gz) - a:b
  195
+			let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
  196
+			let l:dr = <SID>rgb_level(l:gx) - a:r
  197
+			let l:dg = <SID>rgb_level(l:gy) - a:g
  198
+			let l:db = <SID>rgb_level(l:gz) - a:b
  199
+			let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
  200
+			if l:dgrey < l:drgb
  201
+				" Use the grey
  202
+				return <SID>grey_colour(l:gx)
  203
+			else
  204
+				" Use the colour
  205
+				return <SID>rgb_colour(l:x, l:y, l:z)
  206
+			endif
  207
+		else
  208
+			" Only one possibility
  209
+			return <SID>rgb_colour(l:x, l:y, l:z)
  210
+		endif
  211
+	endfun
  212
+
  213
+	" Returns the palette index to approximate the 'rrggbb' hex string
  214
+	fun <SID>rgb(rgb)
  215
+		let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
  216
+		let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
  217
+		let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
  218
+
  219
+		return <SID>colour(l:r, l:g, l:b)
  220
+	endfun
  221
+
  222
+	" Sets the highlighting for the given group
  223
+	fun <SID>X(group, fg, bg, attr)
  224
+		if a:fg != ""
  225
+			exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . <SID>rgb(a:fg)
  226
+		endif
  227
+		if a:bg != ""
  228
+			exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . <SID>rgb(a:bg)
  229
+		endif
  230
+		if a:attr != ""
  231
+			exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr
  232
+		endif
  233
+	endfun
  234
+
  235
+	" Vim Highlighting
  236
+	call <SID>X("Normal", s:foreground, s:background, "")
  237
+	call <SID>X("LineNr", s:selection, "", "")
  238
+	call <SID>X("NonText", s:selection, "", "")
  239
+	call <SID>X("SpecialKey", s:selection, "", "")
  240
+	call <SID>X("Search", s:background, s:yellow, "")
  241
+	call <SID>X("TabLine", s:foreground, s:background, "reverse")
  242
+	call <SID>X("StatusLine", s:window, s:yellow, "reverse")
  243
+	call <SID>X("StatusLineNC", s:window, s:foreground, "reverse")
  244
+	call <SID>X("VertSplit", s:window, s:window, "none")
  245
+	call <SID>X("Visual", "", s:selection, "")
  246
+	call <SID>X("Directory", s:blue, "", "")
  247
+	call <SID>X("ModeMsg", s:green, "", "")
  248
+	call <SID>X("MoreMsg", s:green, "", "")
  249
+	call <SID>X("Question", s:green, "", "")
  250
+	call <SID>X("WarningMsg", s:red, "", "")
  251
+	call <SID>X("MatchParen", "", s:selection, "")
  252
+	call <SID>X("Folded", s:comment, s:background, "")
  253
+	call <SID>X("FoldColumn", "", s:background, "")
  254
+	if version >= 700
  255
+		call <SID>X("CursorLine", "", s:line, "none")
  256
+		call <SID>X("CursorColumn", "", s:line, "none")
  257
+		call <SID>X("PMenu", s:foreground, s:selection, "none")
  258
+		call <SID>X("PMenuSel", s:foreground, s:selection, "reverse")
  259
+	end
  260
+	if version >= 703
  261
+		call <SID>X("ColorColumn", "", s:line, "none")
  262
+	end
  263
+
  264
+	" Standard Highlighting
  265
+	call <SID>X("Comment", s:comment, "", "")
  266
+	call <SID>X("Todo", s:comment, s:background, "")
  267
+	call <SID>X("Title", s:comment, "", "")
  268
+	call <SID>X("Identifier", s:red, "", "none")
  269
+	call <SID>X("Statement", s:foreground, "", "")
  270
+	call <SID>X("Conditional", s:foreground, "", "")
  271
+	call <SID>X("Repeat", s:foreground, "", "")
  272
+	call <SID>X("Structure", s:purple, "", "")
  273
+	call <SID>X("Function", s:blue, "", "")
  274
+	call <SID>X("Constant", s:orange, "", "")
  275
+	call <SID>X("String", s:green, "", "")
  276
+	call <SID>X("Special", s:foreground, "", "")
  277
+	call <SID>X("PreProc", s:purple, "", "")
  278
+	call <SID>X("Operator", s:aqua, "", "none")
  279
+	call <SID>X("Type", s:blue, "", "none")
  280
+	call <SID>X("Define", s:purple, "", "none")
  281
+	call <SID>X("Include", s:blue, "", "")
  282
+	"call <SID>X("Ignore", "666666", "", "")
  283
+
  284
+	" Vim Highlighting
  285
+	call <SID>X("vimCommand", s:red, "", "none")
  286
+
  287
+	" C Highlighting
  288
+	call <SID>X("cType", s:yellow, "", "")
  289
+	call <SID>X("cStorageClass", s:purple, "", "")
  290
+	call <SID>X("cConditional", s:purple, "", "")
  291
+	call <SID>X("cRepeat", s:purple, "", "")
  292
+
  293
+	" PHP Highlighting
  294
+	call <SID>X("phpVarSelector", s:red, "", "")
  295
+	call <SID>X("phpKeyword", s:purple, "", "")
  296
+	call <SID>X("phpRepeat", s:purple, "", "")
  297
+	call <SID>X("phpConditional", s:purple, "", "")
  298
+	call <SID>X("phpStatement", s:purple, "", "")
  299
+	call <SID>X("phpMemberSelector", s:foreground, "", "")
  300
+
  301
+	" Ruby Highlighting
  302
+	call <SID>X("rubySymbol", s:green, "", "")
  303
+	call <SID>X("rubyConstant", s:yellow, "", "")
  304
+	call <SID>X("rubyAttribute", s:blue, "", "")
  305
+	call <SID>X("rubyInclude", s:blue, "", "")
  306
+	call <SID>X("rubyLocalVariableOrMethod", s:orange, "", "")
  307
+	call <SID>X("rubyCurlyBlock", s:orange, "", "")
  308
+	call <SID>X("rubyStringDelimiter", s:green, "", "")
  309
+	call <SID>X("rubyInterpolationDelimiter", s:orange, "", "")
  310
+	call <SID>X("rubyConditional", s:purple, "", "")
  311
+	call <SID>X("rubyRepeat", s:purple, "", "")
  312
+
  313
+	" Python Highlighting
  314
+	call <SID>X("pythonInclude", s:purple, "", "")
  315
+	call <SID>X("pythonStatement", s:purple, "", "")
  316
+	call <SID>X("pythonConditional", s:purple, "", "")
  317
+	call <SID>X("pythonFunction", s:blue, "", "")
  318
+
  319
+	" JavaScript Highlighting
  320
+	call <SID>X("javaScriptBraces", s:foreground, "", "")
  321
+	call <SID>X("javaScriptFunction", s:purple, "", "")
  322
+	call <SID>X("javaScriptConditional", s:purple, "", "")
  323
+	call <SID>X("javaScriptRepeat", s:purple, "", "")
  324
+	call <SID>X("javaScriptNumber", s:orange, "", "")
  325
+	call <SID>X("javaScriptMember", s:orange, "", "")
  326
+
  327
+	" HTML Highlighting
  328
+	call <SID>X("htmlTag", s:red, "", "")
  329
+	call <SID>X("htmlTagName", s:red, "", "")
  330
+	call <SID>X("htmlArg", s:red, "", "")
  331
+	call <SID>X("htmlScriptTag", s:red, "", "")
  332
+
  333
+	" Diff Highlighting
  334
+	call <SID>X("diffAdded", s:green, "", "")
  335
+	call <SID>X("diffRemoved", s:red, "", "")
  336
+
  337
+	" Delete Functions
  338
+	delf <SID>X
  339
+	delf <SID>rgb
  340
+	delf <SID>colour
  341
+	delf <SID>rgb_colour
  342
+	delf <SID>rgb_level
  343
+	delf <SID>rgb_number
  344
+	delf <SID>grey_colour
  345
+	delf <SID>grey_level
  346
+	delf <SID>grey_number
  347
+endif
362  colors/Tomorrow-Night.vim
... ...
@@ -0,0 +1,362 @@
  1
+" Tomorrow Night - Full Colour and 256 Colour
  2
+" http://chriskempson.com
  3
+"
  4
+" Hex colour conversion functions borrowed from the theme "Desert256""
  5
+
  6
+" Default GUI Colours
  7
+let s:foreground = "c5c8c6"
  8
+let s:background = "1d1f21"
  9
+let s:selection = "373b41"
  10
+let s:line = "282a2e"
  11
+let s:comment = "969896"
  12
+let s:red = "cc6666"
  13
+let s:orange = "de935f"
  14
+let s:yellow = "f0c674"
  15
+let s:green = "b5bd68"
  16
+let s:aqua = "8abeb7"
  17
+let s:blue = "81a2be"
  18
+let s:purple = "b294bb"
  19
+let s:window = "4d5057"
  20
+
  21
+" Console 256 Colours
  22
+if !has("gui_running")
  23
+	let s:background = "303030"
  24
+	let s:window = "5e5e5e"
  25
+	let s:line = "3a3a3a"
  26
+	let s:selection = "585858"
  27
+end
  28
+
  29
+set background=dark
  30
+hi clear
  31
+syntax reset
  32
+
  33
+let g:colors_name = "Tomorrow-Night"
  34
+
  35
+if has("gui_running") || &t_Co == 88 || &t_Co == 256
  36
+	" Returns an approximate grey index for the given grey level
  37
+	fun <SID>grey_number(x)
  38
+		if &t_Co == 88
  39
+			if a:x < 23
  40
+				return 0
  41
+			elseif a:x < 69
  42
+				return 1
  43
+			elseif a:x < 103
  44
+				return 2
  45
+			elseif a:x < 127
  46
+				return 3
  47
+			elseif a:x < 150
  48
+				return 4
  49
+			elseif a:x < 173
  50
+				return 5
  51
+			elseif a:x < 196
  52
+				return 6
  53
+			elseif a:x < 219
  54
+				return 7
  55
+			elseif a:x < 243
  56
+				return 8
  57
+			else
  58
+				return 9
  59
+			endif
  60
+		else
  61
+			if a:x < 14
  62
+				return 0
  63
+			else
  64
+				let l:n = (a:x - 8) / 10
  65
+				let l:m = (a:x - 8) % 10
  66
+				if l:m < 5
  67
+					return l:n
  68
+				else
  69
+					return l:n + 1
  70
+				endif
  71
+			endif
  72
+		endif
  73
+	endfun
  74
+
  75
+	" Returns the actual grey level represented by the grey index
  76
+	fun <SID>grey_level(n)
  77
+		if &t_Co == 88
  78
+			if a:n == 0
  79
+				return 0
  80
+			elseif a:n == 1
  81
+				return 46
  82
+			elseif a:n == 2
  83
+				return 92
  84
+			elseif a:n == 3
  85
+				return 115
  86
+			elseif a:n == 4
  87
+				return 139
  88
+			elseif a:n == 5
  89
+				return 162
  90
+			elseif a:n == 6
  91
+				return 185
  92
+			elseif a:n == 7
  93
+				return 208
  94
+			elseif a:n == 8
  95
+				return 231
  96
+			else
  97
+				return 255
  98
+			endif
  99
+		else
  100
+			if a:n == 0
  101
+				return 0
  102
+			else
  103
+				return 8 + (a:n * 10)
  104
+			endif
  105
+		endif
  106
+	endfun
  107
+
  108
+	" Returns the palette index for the given grey index
  109
+	fun <SID>grey_colour(n)
  110
+		if &t_Co == 88
  111
+			if a:n == 0
  112
+				return 16
  113
+			elseif a:n == 9
  114
+				return 79
  115
+			else
  116
+				return 79 + a:n
  117
+			endif
  118
+		else
  119
+			if a:n == 0
  120
+				return 16
  121
+			elseif a:n == 25
  122
+				return 231
  123
+			else
  124
+				return 231 + a:n
  125
+			endif
  126
+		endif
  127
+	endfun
  128
+
  129
+	" Returns an approximate colour index for the given colour level
  130
+	fun <SID>rgb_number(x)
  131
+		if &t_Co == 88
  132
+			if a:x < 69
  133
+				return 0
  134
+			elseif a:x < 172
  135
+				return 1
  136
+			elseif a:x < 230
  137
+				return 2
  138
+			else
  139
+				return 3
  140
+			endif
  141
+		else
  142
+			if a:x < 75
  143
+				return 0
  144
+			else
  145
+				let l:n = (a:x - 55) / 40
  146
+				let l:m = (a:x - 55) % 40
  147
+				if l:m < 20
  148
+					return l:n
  149
+				else
  150
+					return l:n + 1
  151
+				endif
  152
+			endif
  153
+		endif
  154
+	endfun
  155
+
  156
+	" Returns the actual colour level for the given colour index
  157
+	fun <SID>rgb_level(n)
  158
+		if &t_Co == 88
  159
+			if a:n == 0
  160
+				return 0
  161
+			elseif a:n == 1
  162
+				return 139
  163
+			elseif a:n == 2
  164
+				return 205
  165
+			else
  166
+				return 255
  167
+			endif
  168
+		else
  169
+			if a:n == 0
  170
+				return 0
  171
+			else
  172
+				return 55 + (a:n * 40)
  173
+			endif
  174
+		endif
  175
+	endfun
  176
+
  177
+	" Returns the palette index for the given R/G/B colour indices
  178
+	fun <SID>rgb_colour(x, y, z)
  179
+		if &t_Co == 88
  180
+			return 16 + (a:x * 16) + (a:y * 4) + a:z
  181
+		else
  182
+			return 16 + (a:x * 36) + (a:y * 6) + a:z
  183
+		endif
  184
+	endfun
  185
+
  186
+	" Returns the palette index to approximate the given R/G/B colour levels
  187
+	fun <SID>colour(r, g, b)
  188
+		" Get the closest grey
  189
+		let l:gx = <SID>grey_number(a:r)
  190
+		let l:gy = <SID>grey_number(a:g)
  191
+		let l:gz = <SID>grey_number(a:b)
  192
+
  193
+		" Get the closest colour
  194
+		let l:x = <SID>rgb_number(a:r)
  195
+		let l:y = <SID>rgb_number(a:g)
  196
+		let l:z = <SID>rgb_number(a:b)
  197
+
  198
+		if l:gx == l:gy && l:gy == l:gz
  199
+			" There are two possibilities
  200
+			let l:dgr = <SID>grey_level(l:gx) - a:r
  201
+			let l:dgg = <SID>grey_level(l:gy) - a:g
  202
+			let l:dgb = <SID>grey_level(l:gz) - a:b
  203
+			let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
  204
+			let l:dr = <SID>rgb_level(l:gx) - a:r
  205
+			let l:dg = <SID>rgb_level(l:gy) - a:g
  206
+			let l:db = <SID>rgb_level(l:gz) - a:b
  207
+			let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
  208
+			if l:dgrey < l:drgb
  209
+				" Use the grey
  210
+				return <SID>grey_colour(l:gx)
  211
+			else
  212
+				" Use the colour
  213
+				return <SID>rgb_colour(l:x, l:y, l:z)
  214
+			endif
  215
+		else
  216
+			" Only one possibility
  217
+			return <SID>rgb_colour(l:x, l:y, l:z)
  218
+		endif
  219
+	endfun
  220
+
  221
+	" Returns the palette index to approximate the 'rrggbb' hex string
  222
+	fun <SID>rgb(rgb)
  223
+		let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
  224
+		let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
  225
+		let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
  226
+
  227
+		return <SID>colour(l:r, l:g, l:b)
  228
+	endfun
  229
+
  230
+	" Sets the highlighting for the given group
  231
+	fun <SID>X(group, fg, bg, attr)
  232
+		if a:fg != ""
  233
+			exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . <SID>rgb(a:fg)
  234
+		endif
  235
+		if a:bg != ""
  236
+			exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . <SID>rgb(a:bg)
  237
+		endif
  238
+		if a:attr != ""
  239
+			exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr
  240
+		endif
  241
+	endfun
  242
+
  243
+	" Vim Highlighting
  244
+	call <SID>X("Normal", s:foreground, s:background, "")
  245
+	call <SID>X("LineNr", s:selection, "", "")
  246
+	call <SID>X("NonText", s:selection, "", "")
  247
+	call <SID>X("SpecialKey", s:selection, "", "")
  248
+	call <SID>X("Search", s:background, s:yellow, "")
  249
+	call <SID>X("TabLine", s:foreground, s:background, "reverse")
  250
+	call <SID>X("StatusLine", s:window, s:yellow, "reverse")
  251
+	call <SID>X("StatusLineNC", s:window, s:foreground, "reverse")
  252
+	call <SID>X("VertSplit", s:window, s:window, "none")
  253
+	call <SID>X("Visual", "", s:selection, "")
  254
+	call <SID>X("Directory", s:blue, "", "")
  255
+	call <SID>X("ModeMsg", s:green, "", "")
  256
+	call <SID>X("MoreMsg", s:green, "", "")
  257
+	call <SID>X("Question", s:green, "", "")
  258
+	call <SID>X("WarningMsg", s:red, "", "")
  259
+	call <SID>X("MatchParen", "", s:selection, "")
  260
+	call <SID>X("Folded", s:comment, s:background, "")
  261
+	call <SID>X("FoldColumn", "", s:background, "")
  262
+	if version >= 700
  263
+		call <SID>X("CursorLine", "", s:line, "none")
  264
+		call <SID>X("CursorColumn", "", s:line, "none")
  265
+		call <SID>X("PMenu", s:foreground, s:selection, "none")
  266
+		call <SID>X("PMenuSel", s:foreground, s:selection, "reverse")
  267
+		call <SID>X("SignColumn", "", s:background, "none")
  268
+	end
  269
+	if version >= 703
  270
+		call <SID>X("ColorColumn", "", s:line, "none")
  271
+	end
  272
+
  273
+	" Standard Highlighting
  274
+	call <SID>X("Comment", s:comment, "", "")
  275
+	call <SID>X("Todo", s:comment, s:background, "")
  276
+	call <SID>X("Title", s:comment, "", "")
  277
+	call <SID>X("Identifier", s:red, "", "none")
  278
+	call <SID>X("Statement", s:foreground, "", "")
  279
+	call <SID>X("Conditional", s:foreground, "", "")
  280
+	call <SID>X("Repeat", s:foreground, "", "")
  281
+	call <SID>X("Structure", s:purple, "", "")
  282
+	call <SID>X("Function", s:blue, "", "")
  283
+	call <SID>X("Constant", s:orange, "", "")
  284
+	call <SID>X("String", s:green, "", "")
  285
+	call <SID>X("Special", s:foreground, "", "")
  286
+	call <SID>X("PreProc", s:purple, "", "")
  287
+	call <SID>X("Operator", s:aqua, "", "none")
  288
+	call <SID>X("Type", s:blue, "", "none")
  289
+	call <SID>X("Define", s:purple, "", "none")
  290
+	call <SID>X("Include", s:blue, "", "")
  291
+	"call <SID>X("Ignore", "666666", "", "")
  292
+
  293
+	" Vim Highlighting
  294
+	call <SID>X("vimCommand", s:red, "", "none")
  295
+
  296
+	" C Highlighting
  297
+	call <SID>X("cType", s:yellow, "", "")
  298
+	call <SID>X("cStorageClass", s:purple, "", "")
  299
+	call <SID>X("cConditional", s:purple, "", "")
  300
+	call <SID>X("cRepeat", s:purple, "", "")
  301
+
  302
+	" PHP Highlighting
  303
+	call <SID>X("phpVarSelector", s:red, "", "")
  304
+	call <SID>X("phpKeyword", s:purple, "", "")
  305
+	call <SID>X("phpRepeat", s:purple, "", "")
  306
+	call <SID>X("phpConditional", s:purple, "", "")
  307
+	call <SID>X("phpStatement", s:purple, "", "")
  308
+	call <SID>X("phpMemberSelector", s:foreground, "", "")
  309
+
  310
+	" Ruby Highlighting
  311
+	call <SID>X("rubySymbol", s:green, "", "")
  312
+	call <SID>X("rubyConstant", s:yellow, "", "")
  313
+	call <SID>X("rubyAttribute", s:blue, "", "")
  314
+	call <SID>X("rubyInclude", s:blue, "", "")
  315
+	call <SID>X("rubyLocalVariableOrMethod", s:orange, "", "")
  316
+	call <SID>X("rubyCurlyBlock", s:orange, "", "")
  317
+	call <SID>X("rubyStringDelimiter", s:green, "", "")
  318
+	call <SID>X("rubyInterpolationDelimiter", s:orange, "", "")
  319
+	call <SID>X("rubyConditional", s:purple, "", "")
  320
+	call <SID>X("rubyRepeat", s:purple, "", "")
  321
+
  322
+	" Python Highlighting
  323
+	call <SID>X("pythonInclude", s:purple, "", "")
  324
+	call <SID>X("pythonStatement", s:purple, "", "")
  325
+	call <SID>X("pythonConditional", s:purple, "", "")
  326
+	call <SID>X("pythonFunction", s:blue, "", "")
  327
+
  328
+	" JavaScript Highlighting
  329
+	call <SID>X("javaScriptBraces", s:foreground, "", "")
  330
+	call <SID>X("javaScriptFunction", s:purple, "", "")
  331
+	call <SID>X("javaScriptConditional", s:purple, "", "")
  332
+	call <SID>X("javaScriptRepeat", s:purple, "", "")
  333
+	call <SID>X("javaScriptNumber", s:orange, "", "")
  334
+	call <SID>X("javaScriptMember", s:orange, "", "")
  335
+
  336
+	" HTML Highlighting
  337
+	call <SID>X("htmlTag", s:red, "", "")
  338
+	call <SID>X("htmlTagName", s:red, "", "")
  339
+	call <SID>X("htmlArg", s:red, "", "")
  340
+	call <SID>X("htmlScriptTag", s:red, "", "")
  341
+
  342
+	" Diff Highlighting
  343
+	call <SID>X("diffAdded", s:green, "", "")
  344
+	call <SID>X("diffRemoved", s:red, "", "")
  345
+
  346
+    " ShowMarks Highlighting
  347
+    call <SID>X("ShowMarksHLl", s:orange, s:background, "none")
  348
+    call <SID>X("ShowMarksHLo", s:purple, s:background, "none")
  349
+    call <SID>X("ShowMarksHLu", s:yellow, s:background, "none")
  350
+    call <SID>X("ShowMarksHLm", s:aqua, s:background, "none")
  351
+
  352
+	" Delete Functions
  353
+	delf <SID>X
  354
+	delf <SID>rgb
  355
+	delf <SID>colour
  356
+	delf <SID>rgb_colour
  357
+	delf <SID>rgb_level
  358
+	delf <SID>rgb_number
  359
+	delf <SID>grey_colour
  360
+	delf <SID>grey_level
  361
+	delf <SID>grey_number
  362
+endif
3  gvimrc
@@ -18,6 +18,3 @@ imap <D-k> <esc><D-k>
18 18
 imap <D-h> <esc><D-h>
19 19
 imap <D-l> <esc><D-l>
20 20
 
21  
-
22  
-
23  
-
47  vimrc
@@ -8,7 +8,6 @@ set noswapfile
8 8
 set nowritebackup
9 9
 set undodir=~/.vim/tmp/undo/ " store persistent undo files here.
10 10
 filetype plugin on
11  
-
12 11
 " Chrome
13 12
 set encoding=utf-8
14 13
 set showmode
@@ -21,19 +20,19 @@ set cursorline
21 20
 set ttyfast
22 21
 set ruler
23 22
 set backspace=indent,eol,start " Allow backspacing over everything in insert mode.
24  
-set laststatus=2
25  
-" set relativenumber " Show relative line numbers.
  23
+set laststatus=2 " Always show the status line
26 24
 set number
27 25
 set undofile
28 26
 set scrolloff=4 " Keep 4 lines of context when scrolling
29 27
 set shortmess+=I " Remove the default splash screen when a new file is created.
  28
+set autoread " When a file is changed outside of Vim, just reload it rather than asking what to do.
30 29
 
31 30
 " line wrapping
32 31
 set textwidth=110
33 32
 " set wrap
34 33
 set nolist " List disables linebreak.
35 34
 set linebreak " Wrap lines on whitespace, not in the middle of words.
36  
-"set colorcolumn=111 " Show a margin indicator. todo this is ugly.
  35
+set colorcolumn=110 " Show a margin indicator.
37 36
 " set formatoptions=qrn1
38 37
 let &wrapmargin= &textwidth
39 38
 set formatoptions=croql " Now it shouldn't hard-wrap long lines as you're typing (annoying), but you can gq
@@ -68,9 +67,17 @@ set shiftround " use multiples of shiftwidth when indenting with <
68 67
 set autoindent
69 68
 set copyindent
70 69
 filetype plugin indent on
71  
-map <Leader>j :join<CR>
  70
+set nojoinspaces " When joining lines, Vim inserts two spaces if a line ends with a period. Turn that off.
  71
+noremap <Leader>j J
72 72
 set clipboard=unnamed " Use the OSX clipboard, not vim's own
73 73
 imap <C-d> <Del>
  74
+imap <silent> <C-e> <ESC>A
  75
+imap <silent> <C-a> <ESC>I
  76
+
  77
+" Indentation in insert mode
  78
+" These keys are alt+< and alt+> on OSX. They indent the line while preserving the cursor position.
  79
+inoremap ≤ <C-d>
  80
+inoremap ≥ <C-t>
74 81
 
75 82
 " Textmate-style invisible char markers
76 83
 " note: setting list breaks the linebreak option.
@@ -80,10 +87,18 @@ imap <C-d> <Del>
80 87
 " Colorscehem
81 88
 set background=dark
82 89
 if &t_Co >= 256 || has("gui_running")
  90
+  " colorscheme Tomorrow-Night-Bright
83 91
   colorscheme mustang
84  
-  "colorscheme twilight256
  92
+  " Some customizations to the Mustang theme.
  93
+  hi Todo guifg=#808080 guibg=#000000 gui=italic ctermfg=244 " Don't make todos so loud.
  94
+  hi Comment gui=none " turn off italics for comments and strings.
  95
+  hi String gui=none
  96
+  hi Function gui=none " The function identification for clojure is sketchy so don't bold some and not others
85 97
 endif
86 98
 
  99
+" Make the margin indicator more subtle than the default red.
  100
+hi ColorColumn ctermbg=darkgray guibg=#444444
  101
+
87 102
 " Hide the macvim toolbar
88 103
 if has("gui_running")
89 104
   set guioptions=egmrt
@@ -141,6 +156,13 @@ imap <D-k> <esc><D-k>
141 156
 imap <D-h> <esc><D-h>
142 157
 imap <D-l> <esc><D-l>
143 158
 
  159
+" Resizing windows
  160
+noremap <leader>= 6<C-W>+
  161
+noremap <leader>- 6<C-W>-
  162
+
  163
+" Treat .txt files as markdown. All of my .txt notes are in markdown.
  164
+au BufRead,BufNewFile *.txt set filetype=markdown
  165
+
144 166
 " commenting (provided by NERDCommenter
145 167
 let NERDSpaceDelims=1 " Insert one space after comment characters.
146 168
 map <D-/> <plug>NERDCommenterToggle
@@ -150,8 +172,7 @@ map <leader>/ <plug>NERDCommenterToggle
150 172
 " Command-T
151 173
 let g:CommandTMaxHeight=20
152 174
 let g:CommandTMinHeight=20 " This option doesn't seem to work as of Aug 13 2012.
153  
-let g:CommandTMatchWindowAtTop=1
154  
-" <C-f> is supposed to refresh while commandT is open, but it doesn't work, so binding this manually.
  175
+let g:CommandTMatchWindowAtTop=1" <C-f> is supposed to refresh while commandT is open, but it doesn't work, so binding this manually.
155 176
 nnoremap <leader>r :CommandTFlush<CR>
156 177
 
157 178
 " Nerd Tree
@@ -181,3 +202,13 @@ nmap ,r :call SlimvEval([g:slimv_cmdhistory[-1]])<CR>
181 202
 vmap ,r :call SlimvEval([g:slimv_cmdhistory[-1]])<CR>
182 203
 let g:paredit_mode = 0 " turn this off for now.
183 204
 
  205
+" Powerline
  206
+let g:Powerline_symbols = 'unicode'
  207
+" call Pl#Theme#RemoveSegment('charcode')
  208
+" call Pl#Theme#RemoveSegment('filetype')
  209
+" call Pl#Theme#RemoveSegment('pwd')
  210
+" call Pl#Theme#RemoveSegment('scrollpercent')
  211
+"
  212
+" Using a customized powerline theme to remove segments, as suggested by 
  213
+" http://stackoverflow.com/questions/11404863/how-to-remove-a-segment-in-vim-powerline
  214
+let g:Powerline_theme='my_powerline_theme'

0 notes on commit c5446df

Please sign in to comment.
Something went wrong with that request. Please try again.