Commits

arsooy  committed 3a63fc4

Cleaning up vim config.

External plugins in bundle not added because I use git to track most of them
and it seems silly to see .git and its files managed by mercurial.

  • Participants
  • Parent commits 5b9f5ac

Comments (0)

Files changed (56)

File vim/.vim/after/ftplugin/c.vim

-" OmniCppComplete initialization
-call omni#cpp#complete#Init()

File vim/.vim/after/ftplugin/cpp.vim

-" OmniCppComplete initialization
-call omni#cpp#complete#Init()

File vim/.vim/autoload/pathogen.vim

+" pathogen.vim - path option manipulation
+" Maintainer:   Tim Pope <http://tpo.pe/>
+" Version:      2.0
+
+" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
+"
+" For management of individually installed plugins in ~/.vim/bundle (or
+" ~\vimfiles\bundle), adding `call pathogen#infect()` to your .vimrc
+" prior to `filetype plugin indent on` is the only other setup necessary.
+"
+" The API is documented inline below.  For maximum ease of reading,
+" :set foldmethod=marker
+
+if exists("g:loaded_pathogen") || &cp
+  finish
+endif
+let g:loaded_pathogen = 1
+
+" Point of entry for basic default usage.  Give a directory name to invoke
+" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path
+" to invoke pathogen#runtime_prepend_subdirectories().  Afterwards,
+" pathogen#cycle_filetype() is invoked.
+function! pathogen#infect(...) abort " {{{1
+  let source_path = a:0 ? a:1 : 'bundle'
+  if source_path =~# '[\\/]'
+    call pathogen#runtime_prepend_subdirectories(source_path)
+  else
+    call pathogen#runtime_append_all_bundles(source_path)
+  endif
+  call pathogen#cycle_filetype()
+endfunction " }}}1
+
+" Split a path into a list.
+function! pathogen#split(path) abort " {{{1
+  if type(a:path) == type([]) | return a:path | endif
+  let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
+  return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
+endfunction " }}}1
+
+" Convert a list to a path.
+function! pathogen#join(...) abort " {{{1
+  if type(a:1) == type(1) && a:1
+    let i = 1
+    let space = ' '
+  else
+    let i = 0
+    let space = ''
+  endif
+  let path = ""
+  while i < a:0
+    if type(a:000[i]) == type([])
+      let list = a:000[i]
+      let j = 0
+      while j < len(list)
+        let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
+        let path .= ',' . escaped
+        let j += 1
+      endwhile
+    else
+      let path .= "," . a:000[i]
+    endif
+    let i += 1
+  endwhile
+  return substitute(path,'^,','','')
+endfunction " }}}1
+
+" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
+function! pathogen#legacyjoin(...) abort " {{{1
+  return call('pathogen#join',[1] + a:000)
+endfunction " }}}1
+
+" Remove duplicates from a list.
+function! pathogen#uniq(list) abort " {{{1
+  let i = 0
+  let seen = {}
+  while i < len(a:list)
+    if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
+      call remove(a:list,i)
+    elseif a:list[i] ==# ''
+      let i += 1
+      let empty = 1
+    else
+      let seen[a:list[i]] = 1
+      let i += 1
+    endif
+  endwhile
+  return a:list
+endfunction " }}}1
+
+" \ on Windows unless shellslash is set, / everywhere else.
+function! pathogen#separator() abort " {{{1
+  return !exists("+shellslash") || &shellslash ? '/' : '\'
+endfunction " }}}1
+
+" Convenience wrapper around glob() which returns a list.
+function! pathogen#glob(pattern) abort " {{{1
+  let files = split(glob(a:pattern),"\n")
+  return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
+endfunction "}}}1
+
+" Like pathogen#glob(), only limit the results to directories.
+function! pathogen#glob_directories(pattern) abort " {{{1
+  return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
+endfunction "}}}1
+
+" Turn filetype detection off and back on again if it was already enabled.
+function! pathogen#cycle_filetype() " {{{1
+  if exists('g:did_load_filetypes')
+    filetype off
+    filetype on
+  endif
+endfunction " }}}1
+
+" Checks if a bundle is 'disabled'. A bundle is considered 'disabled' if
+" its 'basename()' is included in g:pathogen_disabled[]' or ends in a tilde.
+function! pathogen#is_disabled(path) " {{{1
+  if a:path =~# '\~$'
+    return 1
+  elseif !exists("g:pathogen_disabled")
+    return 0
+  endif
+  let sep = pathogen#separator()
+  return index(g:pathogen_disabled, strpart(a:path, strridx(a:path, sep)+1)) != -1
+endfunction "}}}1
+
+" Prepend all subdirectories of path to the rtp, and append all 'after'
+" directories in those subdirectories.
+function! pathogen#runtime_prepend_subdirectories(path) " {{{1
+  let sep    = pathogen#separator()
+  let before = filter(pathogen#glob_directories(a:path.sep."*"), '!pathogen#is_disabled(v:val)')
+  let after  = filter(pathogen#glob_directories(a:path.sep."*".sep."after"), '!pathogen#is_disabled(v:val[0:-7])')
+  let rtp = pathogen#split(&rtp)
+  let path = expand(a:path)
+  call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
+  let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
+  return &rtp
+endfunction " }}}1
+
+" For each directory in rtp, check for a subdirectory named dir.  If it
+" exists, add all subdirectories of that subdirectory to the rtp, immediately
+" after the original directory.  If no argument is given, 'bundle' is used.
+" Repeated calls with the same arguments are ignored.
+function! pathogen#runtime_append_all_bundles(...) " {{{1
+  let sep = pathogen#separator()
+  let name = a:0 ? a:1 : 'bundle'
+  if "\n".s:done_bundles =~# "\\M\n".name."\n"
+    return ""
+  endif
+  let s:done_bundles .= name . "\n"
+  let list = []
+  for dir in pathogen#split(&rtp)
+    if dir =~# '\<after$'
+      let list +=  filter(pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
+    else
+      let list +=  [dir] + filter(pathogen#glob_directories(dir.sep.name.sep.'*[^~]'), '!pathogen#is_disabled(v:val)')
+    endif
+  endfor
+  let &rtp = pathogen#join(pathogen#uniq(list))
+  return 1
+endfunction
+
+let s:done_bundles = ''
+" }}}1
+
+" Invoke :helptags on all non-$VIM doc directories in runtimepath.
+function! pathogen#helptags() " {{{1
+  let sep = pathogen#separator()
+  for dir in pathogen#split(&rtp)
+    if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags'))
+      helptags `=dir.'/doc'`
+    endif
+  endfor
+endfunction " }}}1
+
+command! -bar Helptags :call pathogen#helptags()
+
+" Like findfile(), but hardcoded to use the runtimepath.
+function! pathogen#runtime_findfile(file,count) "{{{1
+  let rtp = pathogen#join(1,pathogen#split(&rtp))
+  let file = findfile(a:file,rtp,a:count)
+  if file ==# ''
+    return ''
+  else
+    return fnamemodify(file,':p')
+  endif
+endfunction " }}}1
+
+" Backport of fnameescape().
+function! pathogen#fnameescape(string) " {{{1
+  if exists('*fnameescape')
+    return fnameescape(a:string)
+  elseif a:string ==# '-'
+    return '\-'
+  else
+    return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
+  endif
+endfunction " }}}1
+
+function! s:find(count,cmd,file,lcd) " {{{1
+  let rtp = pathogen#join(1,pathogen#split(&runtimepath))
+  let file = pathogen#runtime_findfile(a:file,a:count)
+  if file ==# ''
+    return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
+  elseif a:lcd
+    let path = file[0:-strlen(a:file)-2]
+    execute 'lcd `=path`'
+    return a:cmd.' '.pathogen#fnameescape(a:file)
+  else
+    return a:cmd.' '.pathogen#fnameescape(file)
+  endif
+endfunction " }}}1
+
+function! s:Findcomplete(A,L,P) " {{{1
+  let sep = pathogen#separator()
+  let cheats = {
+        \'a': 'autoload',
+        \'d': 'doc',
+        \'f': 'ftplugin',
+        \'i': 'indent',
+        \'p': 'plugin',
+        \'s': 'syntax'}
+  if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
+    let request = cheats[a:A[0]].a:A[1:-1]
+  else
+    let request = a:A
+  endif
+  let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
+  let found = {}
+  for path in pathogen#split(&runtimepath)
+    let path = expand(path, ':p')
+    let matches = split(glob(path.sep.pattern),"\n")
+    call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
+    call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
+    for match in matches
+      let found[match] = 1
+    endfor
+  endfor
+  return sort(keys(found))
+endfunction " }}}1
+
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve       :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit    :execute s:find(<count>,'edit<bang>',<q-args>,0)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen    :execute s:find(<count>,'edit<bang>',<q-args>,1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit   :execute s:find(<count>,'split',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit  :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit   :execute s:find(<count>,'pedit',<q-args>,<bang>1)
+command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread    :execute s:find(<count>,'read',<q-args>,<bang>1)
+
+" vim:set ft=vim ts=8 sw=2 sts=2:

File vim/.vim/bundle/manifest

+a			   - C/C++ header & implementation file switcher.
+                 http://www.vim.org/scripts/script.php?script_id=31
+clang_complete - Code completion using clang.
+                 https://github.com/Rip-Rip/clang_complete
+command-t      - Fuzzy-matching file & buffer selector
+                 https://wincent.com/products/command-t
+fugitive       - Working with git inside vim.
+                 https://github.com/tpope/vim-fugitive
+localvimrc     - Read local vim configuration file.
+                 https://github.com/embear/vim-localvimrc
+mercurial      - Configs bundled together for working with hg.
+nerdtree       - Filesystem navigation.
+                 https://github.com/scrooloose/nerdtree
+python-coding  - Configs bundled together for coding in Python.
+quickbuf       - A rather sane buffer switcher.
+                 http://www.vim.org/scripts/script.php?script_id=1910
+rooter         - Change vim's working directory to project's root.
+                 https://github.com/airblade/vim-rooter
+soy            - Personal preferences for vim.
+supertab       - Tab-based insert completion.
+                 https://github.com/ervandew/supertab
+syntastic      - Syntax-checking for vim.
+                 https://github.com/scrooloose/syntastic/
+tagbar         - Display & browse tags.
+                 https://github.com/majutsushi/tagbar/
+vissort        - Visual-mode block sorting.
+                 http://www.drchip.org/astronaut/vim/index.html#VISSORT

File vim/.vim/bundle/mercurial/syntax/hg.vim

+" Vim syntax file
+" Language:		hg commit file
+" Maintainer:   Marius Gedminas <marius@gedmin.as>
+" Filenames:    /tmp/hg-editor-*.txt
+" Last Change:  2012 July 8
+
+" Based on gitcommit.vim by Tim Pope
+
+if exists("b:current_syntax")
+  finish
+endif
+
+syn case match
+syn sync minlines=50
+
+if has("spell")
+  syn spell toplevel
+endif
+
+syn match   hgComment   "^HG: .*"
+hi def link hgComment   Comment
+
+let b:current_syntax = "hg"

File vim/.vim/bundle/python-coding/compiler/pylint.vim

+" Vim compiler file for Python
+" Compiler:     Style checking tool for Python
+" Maintainer:   Oleksandr Tymoshenko <gonzo@univ.kiev.ua>
+" Last Change:  2011 August 21
+" Version:      0.7
+" Contributors:
+"     Artur Wroblewski
+"     Menno
+"     Jose Blanca
+"     Bogdan Frankovskyi
+"     Oren Held
+"
+" Installation:
+"   Drop pylint.vim in ~/.vim/compiler directory. Ensure that your PATH
+"   environment variable includes the path to 'pylint' executable.
+"
+"   Add the following line to the autocmd section of .vimrc
+"
+"      autocmd FileType python compiler pylint
+"
+" Usage:
+"   Pylint is called after a buffer with Python code is saved. QuickFix
+"   window is opened to show errors, warnings and hints provided by Pylint.
+"   Code rate calculated by Pylint is displayed at the bottom of the
+"   window.
+"
+"   Above is realized with :Pylint command. To disable calling Pylint every
+"   time a buffer is saved put into .vimrc file
+"
+"       let g:pylint_onwrite = 0
+"
+"   Displaying code rate calculated by Pylint can be avoided by setting
+"
+"       let g:pylint_show_rate = 0
+"
+"   Openning of QuickFix window can be disabled with
+"
+"       let g:pylint_cwindow = 0
+"
+"   Setting signs for the lines with errors can be enabled with
+"
+"	let g:pylint_signs = 1
+"
+"   Of course, standard :make command can be used as in case of every
+"   other compiler.
+"
+"   Setting highlights for the lines can be disabled with
+"
+"       let g:pylint_inline_highlight = 0
+"
+"   Coding style warning highlight can be disabled with
+"
+"       let g:pylint_conventions = 0
+"
+"   Warning highlight can be disabled with
+"   
+"       let g:pylint_warning = 0
+"
+
+if exists('current_compiler')
+  finish
+endif
+let current_compiler = 'pylint'
+
+if !exists('g:pylint_onwrite')
+    let g:pylint_onwrite = 1
+endif
+
+if !exists('g:pylint_onfly')
+    let g:pylint_onfly = 0
+endif
+
+if !exists('g:pylint_show_rate')
+    let g:pylint_show_rate = 1
+endif
+
+if !exists('g:pylint_cwindow')
+    let g:pylint_cwindow = 1
+endif
+
+if !exists('g:pylint_signs')
+    let g:pylint_signs = 0
+endif
+
+if !exists('g:pylint_inline_highlight')
+    let g:pylint_inline_highlight = 1
+endif
+
+if !exists('g:pylint_warning')
+    let g:pylint_warning = 1
+endif
+
+if !exists('g:pylint_conventions')
+    let g:pylint_conventions = 1
+endif
+
+if exists(':Pylint') != 2
+    command Pylint :call Pylint(0)
+endif
+
+if exists(":CompilerSet") != 2          " older Vim always used :setlocal
+  command -nargs=* CompilerSet setlocal <args>
+endif
+
+au CursorHold <buffer> call s:GetPylintMessage()
+au CursorMoved <buffer> call s:GetPylintMessage()
+
+
+" We оhouldиechр filename because pylint truncates .py
+" If someone know better way - let me know :) 
+" CompilerSet makeprg=(echo\ '[%]';\ pylint\ -r\ y\ %)
+" modified by Jose Blanca
+" it does not list the info messages and it lists errors first
+" pylint --rcfile pylint.rc -i y hola.py|grep -e '^[WECY]'|sed -e 's/^W/2 W /' -e 's/^E/1 E /' -e
+" 's/^C/3 C /' |sort -k1,3
+CompilerSet makeprg=(echo\ '[%]';pylint\ -i\ y\ %\\\|grep\ -e\ \'^[WECY]\'\\\|sed\ -e\ \'s/^E/1\ E\ /\'\ -e\ \'s/^W/2\ W\ /\'\ -e\ \'s/^C/3\ C\ /\'\ -e\ \'s/:[\.\ _a-Z]*:/:/g\'\ \\\|sort\ -k1,3)
+
+" We could omit end of file-entry, there is only one file
+" %+I... - include code rating information
+" %-G... - remove all remaining report lines from quickfix buffer
+" the original efm
+"CompilerSet efm=%+P[%f],%t:\ %#%l:%m,%Z,%+IYour\ code%m,%Z,%-G%.%#
+"modified by Jose Blanca
+"version for the sorted and filtered pylint
+"modified by Oren Held - support pylint v0.24.0
+CompilerSet efm=%+P[%f],%*\\d\ %t\ %n:\ %#%l\\,%c:%m,%Z,%+IYour\ code%m,%Z,%-G%.%#
+
+""sings
+"signs definition
+sign define W text=WW texthl=pylint
+sign define C text=CC texthl=pylint
+sign define E text=EE texthl=pylint_error
+
+if g:pylint_onwrite
+    augroup python
+        au!
+        au BufWritePost * call Pylint(1)
+    augroup end
+endif
+
+if g:pylint_onfly
+    augroup python
+        au!
+        au BufRead * call Pylint(1)
+    augroup end
+endif
+
+if !exists("*s:Pylint")
+function! Pylint(writing)
+    if has('win32') || has('win16') || has('win95') || has('win64')
+        setlocal sp=>%s
+    else
+        setlocal sp=>%s\ 2>&1
+    endif
+
+    " If check is executed by buffer write - do not jump to first error
+    if !a:writing
+        silent make
+    else
+        silent make!
+    endif
+
+    if g:pylint_cwindow
+        cwindow
+    endif
+
+    call PylintEvaluation()
+
+    if g:pylint_show_rate
+        echon 'code rate: ' b:pylint_rate ', prev: ' b:pylint_prev_rate
+    endif
+
+    if g:pylint_signs
+        call PlacePylintSigns()
+    endif
+    
+    if g:pylint_inline_highlight
+        call PylintHighlight() 
+    endif
+endfunction
+endif
+
+function! PylintEvaluation()
+    let l:list = getqflist()
+    let b:pylint_rate = '0.00'
+    let b:pylint_prev_rate = '0.00'
+    for l:item in l:list
+        if l:item.type == 'I' && l:item.text =~ 'Your code has been rated'
+            let l:re_rate = '\(-\?[0-9]\{1,2\}\.[0-9]\{2\}\)/'
+            let b:pylint_rate = substitute(l:item.text, '.*rated at '.l:re_rate.'.*', '\1', 'g')
+            " Only if there is information about previous run
+            if l:item.text =~ 'previous run: '
+                let b:pylint_prev_rate = substitute(l:item.text, '.*previous run: '.l:re_rate.'.*', '\1', 'g')
+            endif    
+        endif
+    endfor
+endfunction
+
+function! PlacePylintSigns()
+    "in which buffer are we?
+    "in theory let l:buffr=bufname(l:item.bufnr)
+    "should work inside the next loop, but i haven't manage to do it
+    let l:buffr = bufname('%')
+    "the previous lines are suppose to work, but sometimes it doesn't
+    if empty(l:buffr)
+        let l:buffr=bufname(1)
+    endif
+
+    "first remove all sings
+    exec('sign unplace *')
+    "now we place one sign for every quickfix line
+    let l:list = getqflist()
+    let l:id = 1
+    for l:item in l:list
+	"the line signs
+	let l:lnum=item.lnum
+	let l:type=item.type
+	"sign place 1 line=l:lnum name=pylint file=l:buffr
+	if l:type != 'I'
+	    let l:exec = printf('sign place %d name=%s line=%d file=%s',
+	                        \ l:id, l:type, l:lnum, l:buffr)
+	    let l:id = l:id + 1
+	    execute l:exec
+	endif
+    endfor
+    call PylintHighlight()
+endfunction
+
+if !exists("*s:PylintHighlight")
+    function! PylintHighlight()
+        highlight link PyError SpellBad
+        highlight link PyWarning SpellRare
+        highlight link PyConventions SpellCap
+       
+	"clear all already highlighted
+        if exists("b:cleared")
+            if b:cleared == 0
+                silent call s:ClearHighlight()
+                let b:cleared = 1
+            endif
+        else
+            let b:cleared = 1
+        endif
+        
+        let b:matchedlines = {}
+	
+        " get all messages from qicklist
+        let l:list = getqflist()
+        for l:item in l:list
+	    " highlight lines with errors (only word characters) without end
+	    " of line
+            let l:matchDict = {}
+            let l:matchDict['linenum'] = l:item.lnum
+	    let l:matchDict['message'] = l:item.text
+	    if l:item.type == 'E'
+		if !has_key(b:matchedlines, l:item.lnum)
+                 let b:matchedlines[l:item.lnum] = l:matchDict
+                 call matchadd("PyError", '\w\%' . l:item.lnum . 'l\n\@!')
+		endif
+            elseif item.type == 'W' && g:pylint_warning 
+		if !has_key(b:matchedlines, l:item.lnum)
+                 let b:matchedlines[l:item.lnum] = l:matchDict
+                 call matchadd("PyWarning", '\w\%' . l:item.lnum . 'l\n\@!')
+		endif
+	    elseif item.type == 'C' && g:pylint_conventions
+		if !has_key(b:matchedlines, l:item.lnum)
+                 let b:matchedlines[item.lnum] = l:matchDict
+                 call matchadd("PyConventions", '\w\%' . l:item.lnum . 'l\n\@!')
+		endif
+	    endif
+	endfor
+        let b:cleared = 0
+    endfunction
+endif
+
+" keep track of whether or not we are showing a message
+let b:showing_message = 0
+
+" WideMsg() prints [long] message up to (&columns-1) length
+" guaranteed without "Press Enter" prompt.
+if !exists("*s:WideMsg")
+    function s:WideMsg(msg)
+        let x=&ruler | let y=&showcmd
+        set noruler noshowcmd
+        redraw
+        echo a:msg
+        let &ruler=x | let &showcmd=y
+    endfun
+endif
+
+if !exists('*s:GetPylintMessage')
+function s:GetPylintMessage()
+    let l:cursorPos = getpos(".")
+
+    " Bail if Pylint hasn't been called yet.
+    if !exists('b:matchedlines')
+        return
+    endif
+    " if there's a message for the line the cursor is currently on, echo
+    " it to the console
+    if has_key(b:matchedlines, l:cursorPos[1])
+        let l:pylintMatch = get(b:matchedlines, l:cursorPos[1])
+        call s:WideMsg(l:pylintMatch['message'])
+        let b:showing_message = 1
+        return
+    endif
+	" otherwise, if we're showing a message, clear it
+    if b:showing_message == 1
+        echo
+        let b:showing_message = 0
+    endif
+endfunction
+endif
+
+if !exists('*s:ClearHighlight')
+    function s:ClearHighlight()
+        let l:matches = getmatches()
+        for l:matchId in l:matches
+            if l:matchId['group'] == 'PyError' || l:matchId['group'] == 'PyWarning' || l:matchId['group'] == 'PyConventions'
+                call matchdelete(l:matchId['id'])
+            endif
+        endfor
+        let b:matchedlines = {}
+        let b:cleared = 1
+    endfunction
+endif
+

File vim/.vim/bundle/python-coding/ftplugin/python.vim

+set autoindent
+set foldmethod=indent
+set nowrap
+set omnifunc=pythoncomplete#Complete
+
+" whitespace settings
+set expandtab
+set shiftwidth=4
+set softtabstop=4
+set tabstop=4
+
+" rewire 'make' on python files to pylint it
+autocmd FileType python compiler pylint 
+
+" set pylint not to check on file write
+let g:pylint_onwrite=0

File vim/.vim/bundle/python-coding/ftplugin/python/flake8.vim

+"
+" Python filetype plugin for running flake8
+" Language:     Python (ft=python)
+" Maintainer:   Vincent Driessen <vincent@3rdcloud.com>
+" Version:      Vim 7 (may work with lower Vim versions, but not tested)
+" URL:          http://github.com/nvie/vim-flake8
+"
+" Only do this when not done yet for this buffer
+if exists("b:loaded_flake8_ftplugin")
+    finish
+endif
+let b:loaded_flake8_ftplugin=1
+
+if exists("g:flake8_cmd")
+    let s:flake8_cmd=g:flake8_cmd
+else
+    let s:flake8_cmd="flake8"
+endif
+
+let s:flake8_ignores=""
+if exists("g:flake8_ignore")
+    let s:flake8_ignores=" --ignore=".g:flake8_ignore
+endif
+
+let s:flake8_max_line_length=""
+if exists("g:flake8_max_line_length")
+    let s:flake8_max_line_length=" --max-line-length=".g:flake8_max_line_length
+endif
+
+if !exists("*Flake8()")
+    function Flake8()
+        if !executable(s:flake8_cmd)
+            echoerr "File " . s:flake8_cmd . " not found. Please install it first."
+            return
+        endif
+
+        set lazyredraw   " delay redrawing
+        cclose           " close any existing cwindows
+
+        " store old grep settings (to restore later)
+        let l:old_gfm=&grepformat
+        let l:old_gp=&grepprg
+
+        " write any changes before continuing
+        if &readonly == 0
+            update
+        endif
+
+        " perform the grep itself
+        let &grepformat="%f:%l:%c: %m\,%f:%l: %m"
+        let &grepprg=s:flake8_cmd.s:flake8_ignores.s:flake8_max_line_length
+        silent! grep! %
+
+        " restore grep settings
+        let &grepformat=l:old_gfm
+        let &grepprg=l:old_gp
+
+        " open cwindow
+        let has_results=getqflist() != []
+        if has_results
+            execute 'belowright copen'
+            setlocal wrap
+            nnoremap <buffer> <silent> c :cclose<CR>
+            nnoremap <buffer> <silent> q :cclose<CR>
+        endif
+
+        set nolazyredraw
+        redraw!
+
+        if has_results == 0
+            " Show OK status
+            hi Green ctermfg=green
+            echohl Green
+            echon "Flake8 check OK"
+            echohl
+        endif
+    endfunction
+endif
+
+" Add mappings, unless the user didn't want this.
+" The default mapping is registered under to <F7> by default, unless the user
+" remapped it already (or a mapping exists already for <F7>)
+if !exists("no_plugin_maps") && !exists("no_flake8_maps")
+    if !hasmapto('Flake8(')
+        noremap <buffer> <F7> :call Flake8()<CR>
+    endif
+endif

File vim/.vim/bundle/python-coding/syntax/python.vim

+" Vim syntax file
+" Language:     Python
+" Maintainer:	Dmitry Vasiliev <dima at hlabs dot org>
+" URL:		    https://github.com/hdima/vim-scripts/blob/master/syntax/python/python3.0.vim
+" Last Change:	2012-02-11
+" Filenames:	*.py
+" Version:	    3.0.7
+"
+" Based on python.vim (from Vim 6.1 distribution)
+" by Neil Schemenauer <nas at python dot ca>
+"
+" Thanks:
+"
+"    Jeroen Ruigrok van der Werven
+"        for the idea to highlight erroneous operators
+"    Pedro Algarvio
+"        for the patch to enable spell checking only for the right spots
+"        (strings and comments)
+"    John Eikenberry
+"        for the patch fixing small typo
+"    Caleb Adamantine
+"        for the patch fixing highlighting for decorators
+"    Andrea Riciputi
+"        for the patch with new configuration options
+"    Anton Butanaev
+"        for the patch fixing bytes literals highlighting
+"        for the patch fixing str.format syntax highlighting
+
+"
+" Options:
+"
+"    For set option do: let OPTION_NAME = 1
+"    For clear option do: let OPTION_NAME = 0
+"
+" Option names:
+"
+"    For highlight builtin functions:
+"       python_highlight_builtins
+"
+"    For highlight builtin objects:
+"       python_highlight_builtin_objs
+"
+"    For highlight builtin funtions:
+"       python_highlight_builtin_funcs
+"
+"    For highlight standard exceptions:
+"       python_highlight_exceptions
+"
+"    For highlight string formatting:
+"       python_highlight_string_formatting
+"
+"    For highlight str.format syntax:
+"       python_highlight_string_format
+"
+"    For highlight string.Template syntax:
+"       python_highlight_string_templates
+"
+"    For highlight indentation errors:
+"       python_highlight_indent_errors
+"
+"    For highlight trailing spaces:
+"       python_highlight_space_errors
+"
+"    For highlight doc-tests:
+"       python_highlight_doctests
+"
+"    If you want all Python highlightings above:
+"       python_highlight_all
+"    (This option not override previously set options)
+"
+"    For fast machines:
+"       python_slow_sync
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+if exists("python_highlight_all") && python_highlight_all != 0
+  " Not override previously set options
+  if !exists("python_highlight_builtins")
+    if !exists("python_highlight_builtin_objs")
+      let python_highlight_builtin_objs = 1
+    endif
+    if !exists("python_highlight_builtin_funcs")
+      let python_highlight_builtin_funcs = 1
+    endif
+  endif
+  if !exists("python_highlight_exceptions")
+    let python_highlight_exceptions = 1
+  endif
+  if !exists("python_highlight_string_formatting")
+    let python_highlight_string_formatting = 1
+  endif
+  if !exists("python_highlight_string_format")
+    let python_highlight_string_format = 1
+  endif
+  if !exists("python_highlight_string_templates")
+    let python_highlight_string_templates = 1
+  endif
+  if !exists("python_highlight_indent_errors")
+    let python_highlight_indent_errors = 1
+  endif
+  if !exists("python_highlight_space_errors")
+    let python_highlight_space_errors = 1
+  endif
+  if !exists("python_highlight_doctests")
+    let python_highlight_doctests = 1
+  endif
+endif
+
+" Keywords
+syn keyword pythonStatement	break continue del
+syn keyword pythonStatement	exec return as
+syn keyword pythonStatement	pass raise
+syn keyword pythonStatement	global assert
+syn keyword pythonStatement	lambda yield
+syn keyword pythonStatement	with nonlocal
+syn keyword pythonStatement	False None True
+syn keyword pythonStatement	def class nextgroup=pythonFunction skipwhite
+syn match   pythonFunction	"\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
+syn keyword pythonRepeat	for while
+syn keyword pythonConditional	if elif else
+syn keyword pythonPreCondit	import from
+syn keyword pythonException	try except finally
+syn keyword pythonOperator	and in is not or
+
+" Decorators (new in Python 2.4)
+syn match   pythonDecorator	"@" display nextgroup=pythonDottedName skipwhite
+syn match   pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained
+syn match   pythonDot        "\." display containedin=pythonDottedName
+
+" Comments
+syn match   pythonComment	"#.*$" display contains=pythonTodo,@Spell
+syn match   pythonRun		"\%^#!.*$"
+syn match   pythonCoding	"\%^.*\%(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$"
+syn keyword pythonTodo		TODO FIXME XXX contained
+
+" Errors
+syn match pythonError		"\<\d\+\D\+\>" display
+syn match pythonError		"[$?]" display
+syn match pythonError		"[&|]\{2,}" display
+syn match pythonError		"[=]\{3,}" display
+
+" TODO: Mixing spaces and tabs also may be used for pretty formatting multiline
+" statements. For now I don't know how to work around this.
+if exists("python_highlight_indent_errors") && python_highlight_indent_errors != 0
+  syn match pythonIndentError	"^\s*\%( \t\|\t \)\s*\S"me=e-1 display
+endif
+
+" Trailing space errors
+if exists("python_highlight_space_errors") && python_highlight_space_errors != 0
+  syn match pythonSpaceError	"\s\+$" display
+endif
+
+" Strings
+syn region pythonString		start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell
+syn region pythonString		start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell
+syn region pythonString		start=+"""+ end=+"""+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest2,pythonSpaceError,@Spell
+syn region pythonString		start=+'''+ end=+'''+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest,pythonSpaceError,@Spell
+
+syn match  pythonEscape		    +\\[abfnrtv'"\\]+ display contained
+syn match  pythonEscape		    "\\\o\o\=\o\=" display contained
+syn match  pythonEscapeError	"\\\o\{,2}[89]" display contained
+syn match  pythonEscape		    "\\x\x\{2}" display contained
+syn match  pythonEscapeError	"\\x\x\=\X" display contained
+syn match  pythonEscape		    "\\$"
+syn match  pythonEscape         "\\u\x\{4}" display contained
+syn match  pythonEscapeError	"\\u\x\{,3}\X" display contained
+syn match  pythonEscape	        "\\U\x\{8}" display contained
+syn match  pythonEscapeError	"\\U\x\{,7}\X" display contained
+syn match  pythonEscape	        "\\N{[A-Z ]\+}" display contained
+syn match  pythonEscapeError	"\\N{[^A-Z ]\+}" display contained
+
+" Raw strings
+syn region pythonRawString	start=+[bB]\=[rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,@Spell
+syn region pythonRawString	start=+[bB]\=[rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,@Spell
+syn region pythonRawString	start=+[bB]\=[rR]"""+ end=+"""+ keepend contains=pythonDocTest2,pythonSpaceError,@Spell
+syn region pythonRawString	start=+[bB]\=[rR]'''+ end=+'''+ keepend contains=pythonDocTest,pythonSpaceError,@Spell
+
+syn match pythonRawEscape	+\\['"]+ display transparent contained
+
+" Bytes
+syn region pythonBytes		start=+[bB]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonBytesError,pythonBytesContent,@Spell
+syn region pythonBytes		start=+[bB]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesError,pythonBytesContent,@Spell
+syn region pythonBytes		start=+[bB]"""+ end=+"""+ keepend contains=pythonBytesError,pythonBytesContent,pythonDocTest2,pythonSpaceError,@Spell
+syn region pythonBytes		start=+[bB]'''+ end=+'''+ keepend contains=pythonBytesError,pythonBytesContent,pythonDocTest,pythonSpaceError,@Spell
+
+syn match pythonBytesError    ".\+" display contained
+syn match pythonBytesContent    "[\u0000-\u00ff]\+" display contained contains=pythonBytesEscape,pythonBytesEscapeError
+
+syn match pythonBytesEscape	    +\\[abfnrtv'"\\]+ display contained
+syn match pythonBytesEscape	    "\\\o\o\=\o\=" display contained
+syn match pythonBytesEscapeError	"\\\o\{,2}[89]" display contained
+syn match pythonBytesEscape	    "\\x\x\{2}" display contained
+syn match pythonBytesEscapeError	"\\x\x\=\X" display contained
+syn match pythonBytesEscape	    "\\$"
+
+if exists("python_highlight_string_formatting") && python_highlight_string_formatting != 0
+  " String formatting
+  syn match pythonStrFormatting	"%\%(([^)]\+)\)\=[-#0 +]*\d*\%(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonRawString
+  syn match pythonStrFormatting	"%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonRawString
+endif
+
+if exists("python_highlight_string_format") && python_highlight_string_format != 0
+  " str.format syntax
+  syn match pythonStrFormat "{{\|}}" contained containedin=pythonString,pythonRawString
+  syn match pythonStrFormat	"{\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)\=\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\[\%(\d\+\|[^!:\}]\+\)\]\)*\%(![rsa]\)\=\%(:\%({\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)}\|\%([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*,\=\%(\.\d\+\)\=[bcdeEfFgGnosxX%]\=\)\=\)\=}" contained containedin=pythonString,pythonRawString
+endif
+
+if exists("python_highlight_string_templates") && python_highlight_string_templates != 0
+  " String templates
+  syn match pythonStrTemplate	"\$\$" contained containedin=pythonString,pythonRawString
+  syn match pythonStrTemplate	"\${[a-zA-Z_][a-zA-Z0-9_]*}" contained containedin=pythonString,pythonRawString
+  syn match pythonStrTemplate	"\$[a-zA-Z_][a-zA-Z0-9_]*" contained containedin=pythonString,pythonRawString
+endif
+
+if exists("python_highlight_doctests") && python_highlight_doctests != 0
+  " DocTests
+  syn region pythonDocTest	start="^\s*>>>" end=+'''+he=s-1 end="^\s*$" contained
+  syn region pythonDocTest2	start="^\s*>>>" end=+"""+he=s-1 end="^\s*$" contained
+endif
+
+" Numbers (ints, longs, floats, complex)
+syn match   pythonHexError	"\<0[xX]\x*[g-zG-Z]\x*\>" display
+
+syn match   pythonHexNumber	"\<0[xX]\x\+\>" display
+syn match   pythonOctNumber "\<0[oO]\o\+\>" display
+syn match   pythonBinNumber "\<0[bB][01]\+\>" display
+
+syn match   pythonNumberError	"\<\d\+\D\>" display
+syn match   pythonNumberError	"\<0\d\+\>" display
+syn match   pythonNumber	"\<\d\>" display
+syn match   pythonNumber	"\<[1-9]\d\+\>" display
+syn match   pythonNumber	"\<\d\+[jJ]\>" display
+
+syn match   pythonFloat		"\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>" display
+syn match   pythonFloat		"\<\d\+[eE][+-]\=\d\+[jJ]\=\>" display
+syn match   pythonFloat		"\<\d\+\.\d*\%([eE][+-]\=\d\+\)\=[jJ]\=" display
+
+syn match   pythonOctError	"\<0[oO]\=\o*[8-9]\d*\>" display
+syn match   pythonBinError	"\<0[bB][01]*[2-9]\d*\>" display
+
+if exists("python_highlight_builtin_objs") && python_highlight_builtin_objs != 0
+  " Builtin objects and types
+  syn keyword pythonBuiltinObj	Ellipsis NotImplemented
+  syn keyword pythonBuiltinObj	__debug__ __doc__ __file__ __name__ __package__
+endif
+
+if exists("python_highlight_builtin_funcs") && python_highlight_builtin_funcs != 0
+  " Builtin functions
+  syn keyword pythonBuiltinFunc	__import__ abs all any ascii
+  syn keyword pythonBuiltinFunc	bin bool bytearray bytes
+  syn keyword pythonBuiltinFunc	chr classmethod cmp compile complex
+  syn keyword pythonBuiltinFunc	delattr dict dir divmod enumerate eval
+  syn keyword pythonBuiltinFunc	exec filter float format frozenset getattr
+  syn keyword pythonBuiltinFunc	globals hasattr hash hex id
+  syn keyword pythonBuiltinFunc	input int isinstance
+  syn keyword pythonBuiltinFunc	issubclass iter len list locals map max
+  syn keyword pythonBuiltinFunc	memoryview min next object oct open ord
+  syn keyword pythonBuiltinFunc	pow print property range
+  syn keyword pythonBuiltinFunc	repr reversed round set setattr
+  syn keyword pythonBuiltinFunc	slice sorted staticmethod str sum super tuple
+  syn keyword pythonBuiltinFunc	type vars zip
+endif
+
+if exists("python_highlight_exceptions") && python_highlight_exceptions != 0
+  " Builtin exceptions and warnings
+  syn keyword pythonExClass	BaseException
+  syn keyword pythonExClass	Exception ArithmeticError
+  syn keyword pythonExClass	LookupError EnvironmentError
+
+  syn keyword pythonExClass	AssertionError AttributeError BufferError EOFError
+  syn keyword pythonExClass	FloatingPointError GeneratorExit IOError
+  syn keyword pythonExClass	ImportError IndexError KeyError
+  syn keyword pythonExClass	KeyboardInterrupt MemoryError NameError
+  syn keyword pythonExClass	NotImplementedError OSError OverflowError
+  syn keyword pythonExClass	ReferenceError RuntimeError StopIteration
+  syn keyword pythonExClass	SyntaxError IndentationError TabError
+  syn keyword pythonExClass	SystemError SystemExit TypeError
+  syn keyword pythonExClass	UnboundLocalError UnicodeError
+  syn keyword pythonExClass	UnicodeEncodeError UnicodeDecodeError
+  syn keyword pythonExClass	UnicodeTranslateError ValueError VMSError
+  syn keyword pythonExClass	WindowsError ZeroDivisionError
+
+  syn keyword pythonExClass	Warning UserWarning BytesWarning DeprecationWarning
+  syn keyword pythonExClass	PendingDepricationWarning SyntaxWarning
+  syn keyword pythonExClass	RuntimeWarning FutureWarning
+  syn keyword pythonExClass	ImportWarning UnicodeWarning
+endif
+
+if exists("python_slow_sync") && python_slow_sync != 0
+  syn sync minlines=2000
+else
+  " This is fast but code inside triple quoted strings screws it up. It
+  " is impossible to fix because the only way to know if you are inside a
+  " triple quoted string is to start from the beginning of the file.
+  syn sync match pythonSync grouphere NONE "):$"
+  syn sync maxlines=200
+endif
+
+if version >= 508 || !exists("did_python_syn_inits")
+  if version <= 508
+    let did_python_syn_inits = 1
+    command -nargs=+ HiLink hi link <args>
+  else
+    command -nargs=+ HiLink hi def link <args>
+  endif
+
+  HiLink pythonStatement	Statement
+  HiLink pythonPreCondit	Statement
+  HiLink pythonFunction		Function
+  HiLink pythonConditional	Conditional
+  HiLink pythonRepeat		Repeat
+  HiLink pythonException	Exception
+  HiLink pythonOperator		Operator
+
+  HiLink pythonDecorator	Define
+  HiLink pythonDottedName	Function
+  HiLink pythonDot          Normal
+
+  HiLink pythonComment		Comment
+  HiLink pythonCoding		Special
+  HiLink pythonRun		Special
+  HiLink pythonTodo		Todo
+
+  HiLink pythonError		Error
+  HiLink pythonIndentError	Error
+  HiLink pythonSpaceError	Error
+
+  HiLink pythonString		String
+  HiLink pythonRawString	String
+  HiLink pythonEscape			Special
+  HiLink pythonEscapeError		Error
+
+  HiLink pythonBytes		    String
+  HiLink pythonBytesContent	    String
+  HiLink pythonBytesError	    Error
+  HiLink pythonBytesEscape		Special
+  HiLink pythonBytesEscapeError	Error
+
+  HiLink pythonStrFormatting	Special
+  HiLink pythonStrFormat    	Special
+  HiLink pythonStrTemplate	    Special
+
+  HiLink pythonDocTest		Special
+  HiLink pythonDocTest2		Special
+
+  HiLink pythonNumber		Number
+  HiLink pythonHexNumber	Number
+  HiLink pythonOctNumber	Number
+  HiLink pythonBinNumber	Number
+  HiLink pythonFloat		Float
+  HiLink pythonNumberError  Error
+  HiLink pythonOctError	    Error
+  HiLink pythonHexError		Error
+  HiLink pythonBinError		Error
+
+  HiLink pythonBuiltinObj	Structure
+  HiLink pythonBuiltinFunc	Function
+
+  HiLink pythonExClass	Structure
+
+  delcommand HiLink
+endif
+
+let b:current_syntax = "python"

File vim/.vim/bundle/soy/ftplugin/qf.vim

+" move quickfix location to bottom
+:autocmd FileType qf wincmd J

File vim/.vim/bundle/soy/plugin/soystatusline.vim

+set laststatus=2
+set statusline=
+set statusline+=%2.4n\                       " buffer number
+set statusline+=%P\ %-5.10(%l,%c%V%)\        " position in buffer
+set statusline+=%f\                          " file name (if any)
+set statusline+=%h%m%r%w\                    " flags
+set statusline+=%=%<                         " switch to right alignment
+set statusline+=[%{toupper(&encoding)}:      " encoding
+set statusline+=%{&fileformat}:              " file format
+set statusline+=%{strlen(&ft)?&ft:'none'}]\  " file type
+set statusline+=\#%02.4B\                    " current char

File vim/.vim/bundle/soy/plugin/soytabline.vim

+set showtabline=1
+set tabline=%!SoyTabLine()
+fun SoyTabLine()
+	let sl = ''
+
+	for tabidx in range(tabpagenr('$'))
+		let bufnrlist = tabpagebuflist(tabidx + 1)
+		let sl .= '%#TabLineSel#'
+
+		" start 'selected' highlighting on active tab buffer
+		if tabidx + 1 == tabpagenr()
+			let sl .= '%#TabLine#'
+		else
+			let sl .= '%#TabLineSel#'
+		endif
+
+		" the tab page number
+		let sl .= '%' . (tabidx + 1) . 'T'
+		let sl .= tabidx + 1 . ': '
+
+		let title = ''
+		let modnr = 0
+		let winnr = tabpagewinnr(tabidx + 1, '$')
+
+		" count modified buffer in tab
+		for bufidx in bufnrlist
+			if getbufvar(bufidx, "&modified" )
+				let modnr += 1
+			endif
+		endfor
+
+		let blid = bufnrlist[tabpagewinnr(tabidx + 1) - 1]
+		if getbufvar(blid, "&buftype" ) == 'help'
+			let title .= '- Hlp ' . fnamemodify( bufname(blid), ':t:s/.txt$//' ) . ' -'
+		elseif getbufvar(blid, "&buftype" ) == 'quickfix'
+			let title .= '- QFix -'
+		else
+			let fname = bufname(blid)
+			if fname == ''
+				let title .= '- No Name -'
+			else
+				let title .= fnamemodify(fname, ':t')
+			endif
+		endif
+
+		" add title
+		let sl .= title
+
+		" add modified/total buffer information
+		if modnr > 0
+			let sl .= '[' . modnr . '/' . winnr . ']'
+		endif
+
+		" stop 'selected' highlighting
+		let sl .= ' %#TabLineSel#'
+	endfor
+
+	" right-align the close label ( x )
+	if tabpagenr('$') > 1
+		let sl .= '%=%999X%#TabLineFill# x '
+	endif
+	return sl
+endfun
+
+" map <Leader>tt to create new tab
+nnoremap <Leader>tt :tabnew<CR>
+" map <Leader>tr to remove current tab
+nnoremap <Leader>tr :tabclose<CR>

File vim/.vim/colors/darkblack.vim

-" Vim color file
-" Maintainer:	Matthew Jimenez	<mjimenez@ersnet.net>
-" Last Change:	2005 Feb 25
-
-" darkblack -- an alteration to the darkblue colorscheme by Bohdan Vlasyuk <bohdan@vstu.edu.ua>
-
-
-set bg=dark
-hi clear
-if exists("syntax_on")
-	syntax reset
-endif
-
-let colors_name = "darkblack"
-
-hi Normal	guifg=lightgrey guibg=black	ctermfg=lightgray ctermbg=black
-hi ErrorMsg	guifg=white guibg=lightblue	ctermfg=white ctermbg=lightblue
-hi Visual	guifg=lightblue guibg=fg	gui=reverse	ctermfg=lightblue ctermbg=fg cterm=reverse
-hi VisualNOS	guifg=lightblue guibg=fg	gui=reverse,underline	ctermfg=lightblue ctermbg=fg cterm=reverse,underline
-hi Todo		guifg=red guibg=black	ctermfg=red	ctermbg=black
-hi Search	guifg=white guibg=black	ctermfg=white ctermbg=black cterm=underline term=underline
-hi IncSearch	guifg=black guibg=gray	ctermfg=black ctermbg=gray
-
-hi SpecialKey	guifg=cyan	ctermfg=darkcyan
-hi Directory	guifg=cyan	ctermfg=cyan
-hi Title	guifg=magenta gui=none ctermfg=magenta cterm=bold
-hi WarningMsg	guifg=red	ctermfg=red
-hi WildMenu	guifg=yellow guibg=black ctermfg=yellow ctermbg=black cterm=none term=none
-hi ModeMsg	guifg=lightblue	ctermfg=lightblue
-hi MoreMsg	ctermfg=darkgreen	ctermfg=darkgreen
-hi Question	guifg=green gui=none ctermfg=green cterm=none
-hi NonText	guifg=lightcyan	ctermfg=lightcyan
-
-hi StatusLine	guifg=lightblue guibg=darkgray gui=none	ctermfg=lightblue ctermbg=gray term=none cterm=none
-hi StatusLineNC	guifg=black guibg=darkgray gui=none	ctermfg=black ctermbg=gray term=none cterm=none
-hi VertSplit	guifg=black guibg=darkgray gui=none	ctermfg=black ctermbg=gray term=none cterm=none
-
-hi Folded	guifg=darkgrey guibg=black	ctermfg=darkgrey ctermbg=black cterm=bold term=bold
-hi FoldColumn	guifg=darkgrey guibg=black	ctermfg=darkgrey ctermbg=black cterm=bold term=bold
-hi LineNr	guifg=green	ctermfg=green cterm=none
-
-hi DiffAdd	guibg=black	ctermbg=black term=none cterm=none
-hi DiffChange	guibg=darkmagenta ctermbg=magenta cterm=none
-hi DiffDelete	ctermfg=lightblue ctermbg=cyan gui=bold guifg=Blue guibg=DarkCyan
-hi DiffText	cterm=bold ctermbg=red gui=bold guibg=Red
-
-hi Cursor	guifg=bg guibg=lightgrey ctermfg=bg ctermbg=lightgrey
-hi lCursor	guifg=bg guibg=darkgreen ctermfg=bg ctermbg=darkgreen
-
-
-hi Comment	guifg=lightblue ctermfg=lightblue
-hi Constant	ctermfg=magenta guifg=magenta cterm=none
-hi Special	ctermfg=brown guifg=Orange cterm=none gui=none
-hi Identifier	ctermfg=cyan guifg=cyan cterm=none
-hi Statement	ctermfg=yellow cterm=none guifg=yellow gui=none
-hi PreProc	ctermfg=magenta guifg=magenta gui=none cterm=none
-hi type		ctermfg=green guifg=green gui=none cterm=none
-hi Underlined	cterm=underline term=underline
-hi Ignore	guifg=bg ctermfg=bg
-

File vim/.vim/colors/darkblue2.vim

-" Vim color file
-" Maintainer: Datila Carvalho <datila@hotmail.com>
-" Last Change: May, 19, 2005
-" Version: 0.2
-
-" This is a VIM's version of the emacs color theme
-" _Dark Blue2_ created by Chris McMahan.
-
-""" Init stuff
-
-set background=dark
-hi clear
-if exists("syntax_on")
-    syntax reset
-endif
-
-let g:colors_name = "darkblue2"
-
-
-""" Colors
-
-" GUI colors
-hi Cursor               guifg=#233b5a guibg=Yellow
-hi CursorIM             guifg=NONE guibg=Yellow
-hi Directory            gui=bold guifg=cyan
-"hi DiffAdd
-"hi DiffChange
-"hi DiffDelete
-hi DiffText             guibg=grey50
-hi ErrorMsg             gui=bold guifg=White guibg=gray85
-hi VertSplit            gui=bold guifg=NONE guibg=gray80
-"hi Folded
-"hi FoldColumn
-"hi IncSearch
-hi LineNr				gui=bold guifg=lightsteelblue guibg=#132b4a
-hi ModeMsg              gui=bold
-"hi MoreMsg
-"hi NonText
-hi Normal               guibg=#233b5a guifg=#fff8dc
-"hi Question
-hi Search               gui=bold guifg=#233b5a guibg=lightgoldenrod
-"hi SpecialKey
-hi StatusLine           guifg=steelblue4 guibg=lightgray 
-hi StatusLineNC         guifg=royalblue4 guibg=lightsteelblue
-"hi Title
-hi Visual               guifg=steelblue guibg=fg
-hi VisualNOS            gui=bold guifg=steelblue guibg=fg
-hi WarningMsg           guifg=White guibg=Tomato
-"hi WildMenu
-
-hi User2				guifg=lightskyblue guibg=#021a39 gui=bold
-
-" If using Motif/Athena
-hi Menu                 guibg=#233b5a guifg=#fff8dc
-hi Scrollbar            guibg=bg
-
-" Colors for syntax highlighting
-hi Comment              gui=italic guifg=mediumaquamarine
-
-hi Constant             gui=bold guifg=lightgoldenrod1
-    hi String           guifg=aquamarine
-    hi Character        guifg=aquamarine
-    hi Number           gui=bold guifg=lightgoldenrod1
-    hi Boolean          gui=bold guifg=lightgoldenrod1
-    hi Float            gui=bold guifg=lightgoldenrod1
-
-hi Identifier           gui=bold guifg=palegreen
-    hi Function         guifg=lightskyblue
-
-hi Statement            gui=bold guifg=cyan
-    hi Conditional      gui=bold guifg=cyan
-    hi Repeat           gui=bold guifg=cyan
-    hi Label            guifg=cyan
-    hi Operator         guifg=cyan
-    "hi Keyword
-    "hi Exception
-
-hi PreProc              guifg=lightsteelblue
-    hi Include          gui=bold guifg=lightsteelblue
-    hi Define           guifg=lightsteelblue
-    hi Macro            guifg=lightsteelblue
-    hi PreCondit        guifg=lightsteelblue
-
-hi Type                 gui=bold guifg=palegreen
-    hi StorageClass     gui=bold guifg=lightgoldenrod1
-    hi Structure        gui=bold guifg=lightgoldenrod1
-    hi Typedef          gui=bold guifg=lightgoldenrod1
-
-"hi Special
-    ""Underline Character
-    "hi SpecialChar
-    "hi Tag
-    ""Statement
-    "hi Delimiter
-    ""Bold comment (in Java at least)
-    "hi SpecialComment
-    "hi Debug
-
-hi Underlined           gui=underline
-
-hi Ignore               guifg=bg
-
-hi Error                gui=bold guifg=White guibg=Red
-
-"hi Todo

File vim/.vim/colors/darkburn.vim

-"=============================================================================
-" Vim color file
-" File:       darkburn.vim
-" Maintainer: Taurus Olson <taurusolson@gmail.com>
-" License:    GPL
-" Created:    2009-03-27 20:25:21 CET
-" Modified:   2009-06-06 21:18:55 CET
-" Version:    1.2
-
-" Modified version of zenburn originally created by: 
-" Maintainer:   Jani Nurminen <slinky@iki.fi>
-" Last Change:  $Id: zenburn.vim,v 2.4 2008/11/18 20:43:18 slinky Exp $
-" URL:      	http://slinky.imukuppi.org/zenburnpage/
-" License:      GPL
-"=============================================================================
-"
-" Credits:
-"  - Jani Nurminen - original Zenburn
-"  - Steve Hall & Cream posse - higher-contrast Visual selection
-"  - Kurt Maier - 256 color console coloring, low and high contrast toggle,
-"                 bug fixing
-"  - Charlie - spotted too bright StatusLine in non-high contrast mode
-"  - Pablo Castellazzi - CursorLine fix for 256 color mode
-"  - Tim Smith - force dark background
-"
-" CONFIGURABLE PARAMETERS:
-" 
-" You can use the default (don't set any parameters), or you can
-" set some parameters to tweak the Zenburn colours.
-"
-" * You can now set a darker background for bright environments. To activate, use:
-"   contrast Zenburn, use:
-"
-     let g:darkburn_high_Contrast = 1
-"
-" * To get more contrast to the Visual selection, use
-"   
-"     let g:darkburn_alternate_Visual = 1
-" 
-" * To use alternate colouring for Error message, use
-"     
-      let g:darkburn_alternate_Error = 1
-"
-" * The new default for Include is a duller orange. To use the original
-"   colouring for Include, use
-"     
-      let g:darkburn_alternate_Include = 1
-"
-" * Work-around to a Vim bug, it seems to misinterpret ctermfg and 234 and 237
-"   as light values, and sets background to light for some people. If you have
-"   this problem, use:
-"
-      let g:darkburn_force_dark_Background = 1
-"
-" * To turn the parameter(s) back to defaults, use UNLET:
-"
-"      unlet g:darkburn_alternate_Include
-"
-"   Setting to 0 won't work!
-"
-" That's it, enjoy!
-" 
-" TODO
-"   - Visual alternate color is broken? Try GVim >= 7.0.66 if you have trouble
-"   - IME colouring (CursorIM)
-
-set background=dark
-hi clear          
-if exists("syntax_on")
-    syntax reset
-endif
-let g:colors_name="darkburn"
-
-hi Boolean         guifg=#dca3a3
-hi Character       guifg=#dca3a3 gui=bold
-hi Comment         guifg=#7f9f7f gui=italic
-hi Conditional     guifg=#f0dfaf gui=bold
-hi Constant        guifg=#dca3a3 gui=bold
-hi Cursor          guifg=#000d18 guibg=#8faf9f gui=bold
-hi Debug           guifg=#bca3a3 gui=bold
-hi Define          guifg=#ffcfaf gui=bold
-hi Delimiter       guifg=#8f8f8f
-hi DiffAdd         guifg=#709080 guibg=#313c36 gui=bold
-hi DiffChange      guibg=#333333
-hi DiffDelete      guifg=#333333 guibg=#464646
-hi DiffText        guifg=#ecbcbc guibg=#41363c gui=bold
-hi Directory       guifg=#dcdccc gui=bold
-hi ErrorMsg        guifg=#80d4aa guibg=#2f2f2f gui=bold
-hi Exception       guifg=#c3bf9f gui=bold
-hi Float           guifg=#c0bed1
-hi FoldColumn      guifg=#93b3a3 guibg=#3f4040
-hi Folded          guifg=#93b3a3 guibg=#3f4040
-hi Function        guifg=#efef8f
-hi Identifier      guifg=#dcdcdc
-hi IncSearch       guibg=#f8f893 guifg=#385f38
-hi Keyword         guifg=#f0dfaf gui=bold
-hi Label           guifg=#dfcfaf gui=underline
-hi LineNr          guifg=#9fafaf guibg=#262626
-hi Macro           guifg=#ffcfaf gui=bold
-hi ModeMsg         guifg=#6fb86f gui=none
-hi MoreMsg         guifg=#ffffff gui=bold
-hi NonText         guifg=#404040
-hi Number          guifg=#8cd0d3
-hi Operator        guifg=#f0efd0
-hi PreCondit       guifg=#dfaf8f gui=bold
-hi PreProc         guifg=#ffb23f gui=bold
-hi Question        guifg=#ffffff gui=bold
-hi Repeat          guifg=#ffd7a7 gui=bold
-hi Search          guifg=#ffffe0 guibg=#284f28
-hi SpecialChar     guifg=#9fbfd6 gui=bold
-hi SpecialComment  guifg=#82a282 gui=bold
-hi Special         guifg=#9fbfd6
-hi SpecialKey      guifg=#9ece9e
-hi Statement       guifg=#6fb86f  gui=none
-hi StatusLine      guifg=#313633 guibg=#ccdc90
-hi StatusLineNC    guifg=#2e3330 guibg=#88b090
-hi StorageClass    guifg=#c3bf9f gui=bold
-hi String          guifg=#b75151
-hi Structure       guifg=#efefaf gui=bold
-hi Tag             guifg=#e89393 gui=bold
-hi Title           guifg=#efefef gui=bold
-hi Todo            guifg=#dfdfdf guibg=bg gui=bold
-hi Typedef         guifg=#dfe4cf gui=bold
-hi Type            guifg=#dfdfbf gui=bold
-hi Underlined      guifg=#dcdccc gui=underline
-hi VertSplit       guifg=#2e3330 guibg=#688060
-hi VisualNOS       guifg=#333333 guibg=#f18c96 gui=bold,underline
-hi WarningMsg      guifg=#ffffff guibg=#333333 gui=bold
-hi WildMenu        guibg=#2c302d guifg=#cbecd0 gui=underline
-
-hi SpellBad   guisp=#bc6c4c guifg=#dc8c6c
-hi SpellCap   guisp=#6c6c9c guifg=#8c8cbc
-hi SpellRare  guisp=#bc6c9c guifg=#bc8cbc
-hi SpellLocal guisp=#7cac7c guifg=#9ccc9c
-
-" Entering Kurt zone
-if &t_Co > 255
-    hi Boolean         ctermfg=181  
-    hi Character       ctermfg=181   cterm=bold
-    hi Comment         ctermfg=108   
-    hi Conditional     ctermfg=223   cterm=bold
-    hi Constant        ctermfg=181   cterm=bold
-    hi Cursor          ctermfg=233   ctermbg=109     cterm=bold
-    hi Debug           ctermfg=181   cterm=bold
-    hi Define          ctermfg=223   cterm=bold
-    hi Delimiter       ctermfg=245  
-    hi DiffAdd         ctermfg=66    ctermbg=237     cterm=bold
-    hi DiffChange      ctermbg=236  
-    hi DiffDelete      ctermfg=236   ctermbg=238    
-    hi DiffText        ctermfg=217   ctermbg=237     cterm=bold
-    hi Directory       ctermfg=188   cterm=bold
-    hi ErrorMsg        ctermfg=115   ctermbg=236     cterm=bold
-    hi Exception       ctermfg=249   cterm=bold
-    hi Float           ctermfg=251  
-    hi FoldColumn      ctermfg=109   ctermbg=238    
-    hi Folded          ctermfg=109   ctermbg=238    
-    hi Function        ctermfg=228  
-    hi Identifier      ctermfg=223  
-    hi IncSearch       ctermbg=228   ctermfg=238    
-    hi Keyword         ctermfg=223   cterm=bold
-    hi Label           ctermfg=187   cterm=underline
-    hi LineNr          ctermfg=248   ctermbg=235    
-    hi Macro           ctermfg=223   cterm=bold
-    hi ModeMsg         ctermfg=223   cterm=none
-    hi MoreMsg         ctermfg=15    cterm=bold
-    hi NonText         ctermfg=238  
-    hi Number          ctermfg=116  
-    hi Operator        ctermfg=230  
-    hi PreCondit       ctermfg=180   cterm=bold
-    hi PreProc         ctermfg=223   cterm=bold
-    hi Question        ctermfg=15    cterm=bold
-    hi Repeat          ctermfg=223   cterm=bold
-    hi Search          ctermfg=230   ctermbg=236    
-    hi SpecialChar     ctermfg=181   cterm=bold
-    hi SpecialComment  ctermfg=108   cterm=bold
-    hi Special         ctermfg=181  
-    hi SpecialKey      ctermfg=151  
-    hi Statement       ctermfg=187   ctermbg=234     cterm=none
-    hi StatusLine      ctermfg=236   ctermbg=186    
-    hi StatusLineNC    ctermfg=235   ctermbg=108    
-    hi StorageClass    ctermfg=249   cterm=bold
-    hi String          ctermfg=174  
-    hi Structure       ctermfg=229   cterm=bold
-    hi Tag             ctermfg=181   cterm=bold
-    hi Title           ctermfg=7     ctermbg=234     cterm=bold
-    hi Todo            ctermfg=108   ctermbg=234     cterm=bold
-    hi Typedef         ctermfg=253   cterm=bold
-    hi Type            ctermfg=187   cterm=bold
-    hi Underlined      ctermfg=188   ctermbg=234     cterm=bold
-    hi VertSplit       ctermfg=236   ctermbg=65 
-    hi VisualNOS       ctermfg=236   ctermbg=210     cterm=bold
-    hi WarningMsg      ctermfg=15    ctermbg=236     cterm=bold
-    hi WildMenu        ctermbg=236   ctermfg=194     cterm=bold
-    hi CursorLine      ctermbg=236   cterm=none
-
-    " spellchecking, always "bright" background
-    hi SpellLocal ctermfg=14  ctermbg=237
-    hi SpellBad   ctermfg=9   ctermbg=237
-    hi SpellCap   ctermfg=12  ctermbg=237
-    hi SpellRare  ctermfg=13  ctermbg=237
-  
-    " pmenu
-    hi PMenu      ctermfg=248  ctermbg=0
-    hi PMenuSel   ctermfg=223 ctermbg=235
-
-    if exists("g:darkburn_high_Contrast")
-        hi Normal ctermfg=188 ctermbg=234
-    else
-        hi Normal ctermfg=188 ctermbg=237
-        hi Cursor          ctermbg=109
-        hi diffadd         ctermbg=237
-        hi diffdelete      ctermbg=238
-        hi difftext        ctermbg=237
-        hi errormsg        ctermbg=237
-        hi foldcolumn      ctermbg=238
-        hi folded          ctermbg=238
-        hi incsearch       ctermbg=228
-        hi linenr          ctermbg=238  
-        hi search          ctermbg=238
-        hi statement       ctermbg=237
-        hi statusline      ctermbg=144
-        hi statuslinenc    ctermbg=108
-        hi title           ctermbg=237
-        hi todo            ctermbg=237
-        hi underlined      ctermbg=237
-        hi vertsplit       ctermbg=65 
-        hi visualnos       ctermbg=210
-        hi warningmsg      ctermbg=236
-        hi wildmenu        ctermbg=236
-    endif
-endif
-
-if exists("g:darkburn_force_dark_Background")
-    " Force dark background, because of a bug in VIM:  VIM sets background
-    " automatically during "hi Normal ctermfg=X"; it misinterprets the high
-    " value (234 or 237 above) as a light color, and wrongly sets background to
-    " light.  See ":help highlight" for details.
-    set background=dark
-endif
-
-if exists("g:darkburn_high_Contrast")
-    " use new darker background
-    hi Normal          guifg=#ffffff guibg=#1f1f1f
-    hi CursorLine      guibg=#121212 gui=bold
-    hi Pmenu           guibg=#242424 guifg=#ccccbc
-    hi PMenuSel        guibg=#353a37 guifg=#ccdc90 gui=bold
-    hi PmenuSbar       guibg=#2e3330 guifg=#000000
-    hi PMenuThumb      guibg=#a0afa0 guifg=#040404 
-    hi MatchParen      guifg=#f0f0c0 guibg=#383838 gui=bold
-    hi SignColumn      guifg=#9fafaf guibg=#181818 gui=bold
-    hi TabLineFill     guifg=#cfcfaf guibg=#181818 gui=bold
-    hi TabLineSel      guifg=#efefef guibg=#1c1c1b gui=bold
-    hi TabLine         guifg=#b6bf98 guibg=#181818 gui=bold
-    hi CursorColumn    guifg=#dcdccc guibg=#2b2b2b
-else
-    " Original, lighter background
-    hi Normal          guifg=#dcdccc guibg=#3f3f3f
-    hi CursorLine      guibg=#434443
-    hi Pmenu           guibg=#2c2e2e guifg=#9f9f9f
-    hi PMenuSel        guibg=#242424 guifg=#d0d0a0 gui=bold
-    hi PmenuSbar       guibg=#2e3330 guifg=#000000
-    hi PMenuThumb      guibg=#a0afa0 guifg=#040404 
-    hi MatchParen      guifg=#b2b2a0 guibg=#2e2e2e gui=bold
-    hi SignColumn      guifg=#9fafaf guibg=#343434 gui=bold
-    hi TabLineFill     guifg=#cfcfaf guibg=#353535 gui=bold
-    hi TabLineSel      guifg=#efefef guibg=#3a3a39 gui=bold
-    hi TabLine         guifg=#b6bf98 guibg=#353535 gui=bold
-    hi CursorColumn    guifg=#dcdccc guibg=#4f4f4f
-endif
-    
-
-if exists("g:darkburn_alternate_Visual")
-    " Visual with more contrast, thanks to Steve Hall & Cream posse
-    " gui=none fixes weird highlight problem in at least GVim 7.0.66, thanks to Kurt Maier
-    hi Visual          guifg=#000000 guibg=#71d3b4 gui=none
-    hi VisualNOS       guifg=#000000 guibg=#71d3b4 gui=none
-else
-    " use default visual
-    hi Visual          guifg=#71d3b4 guibg=#233323 gui=none
-    hi VisualNOS       guifg=#71d3b4 guibg=#233323 gui=none
-endif
-
-if exists("g:darkburn_alternate_Error")
-    " use a bit different Error
-    hi Error           guifg=#ef9f9f guibg=#201010 gui=bold  
-else
-    " default
-    hi Error           guifg=#e37170 guibg=#332323 gui=none
-endif
-
-if exists("g:darkburn_alternate_Include")
-    " original setting
-    hi Include         guifg=#ffcfaf  gui=bold
-else
-    " new, less contrasted one
-    hi Include         guifg=#dfaf8f gui=bold
-endif
-    " TODO check for more obscure syntax groups that they're ok
-
-" vim: :

File vim/.vim/colors/desert256.vim

-" Vim color file
-" Maintainer: Henry So, Jr. <henryso@panix.com>
-
-" These are the colors of the "desert" theme by Hans Fugal with a few small
-" modifications (namely that I lowered the intensity of the normal white and
-" made the normal and nontext backgrounds black), modified to work with 88-
-" and 256-color xterms.
-"
-" The original "desert" theme is available as part of the vim distribution or
-" at http://hans.fugal.net/vim/colors/.
-"
-" The real feature of this color scheme, with a wink to the "inkpot" theme, is
-" the programmatic approximation of the gui colors to the palettes of 88- and
-" 256- color xterms.  The functions that do this (folded away, for
-" readability) are calibrated to the colors used for Thomas E. Dickey's xterm
-" (version 200), which is available at http://dickey.his.com/xterm/xterm.html.
-"
-" I struggled with trying to parse the rgb.txt file to avoid the necessity of
-" converting color names to #rrggbb form, but decided it was just not worth
-" the effort.  Maybe someone seeing this may decide otherwise...
-
-set background=dark
-if version > 580
-    " no guarantees for version 5.8 and below, but this makes it stop
-    " complaining
-    hi clear
-    if exists("syntax_on")
-        syntax reset
-    endif
-endif
-let g:colors_name="desert256"
-
-if has("gui_running") || &t_Co == 88 || &t_Co == 256
-    " functions {{{
-    " 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_color(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 color index for the given color 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 color level for the given color 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 color indices
-    fun <SID>rgb_color(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 color levels
-    fun <SID>color(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 color
-        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_color(l:gx)
-            else
-                " use the color
-                return <SID>rgb_color(l:x, l:y, l:z)
-            endif
-        else
-            " only one possibility
-            return <SID>rgb_color(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>color(l:r, l:g, l:b)