Last active
December 11, 2015 08:38
-
-
Save jordanorelli/4574676 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use Vim settings, rather then Vi settings (much better!). | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
set backspace=indent,eol,start | |
set autoindent | |
set smartindent | |
set tabstop=4 | |
set expandtab " holy war | |
set smarttab " I don't know what this does. | |
set shiftwidth=4 | |
set history=50 " keep 50 lines of command line history | |
set ruler " show the cursor position all the time | |
set showcmd " display incomplete commands | |
set incsearch " incremental searching | |
set ignorecase " case-insensitive searching | |
set smartcase | |
" set scrolloff=3 " scroll when 3 lines from edge | |
" set sidescroll=5 " scroll when 5 chars from the right | |
set wrap " wrap text | |
set linebreak " soft text wrapping | |
set nobackup " disable temporary files. | |
set nowritebackup | |
set noswapfile | |
set wildmenu " enabled the wild menu. | |
set wildmode=list:full " list matches | |
set wildignore=.svn,CVS,.git " ignore verson control files | |
set wildignore+=*.o,*.a,*.so " ignore compiled binaries | |
set wildignore+=*.jpg,*.png,*.gif " ignore images | |
set wildignore+=*.pdf " ignore pdf documents | |
set wildignore+=*.pyc,*.pyo " ignore compiled Python files | |
set mousehide " hides the mouse when typing | |
" set list " show invisible characters. | |
set listchars=tab:>-,trail:.,extends:# | |
set matchpairs+=<:> " match angle brackets | |
" I never use this, but I never use Ex mode, either. | |
map Q gq | |
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo, | |
" so that you can undo CTRL-U after inserting a line break. | |
inoremap <C-U> <C-G>u<C-U> | |
" In many terminal emulators the mouse works just fine, thus enable it. | |
if has('mouse') | |
set mouse=a | |
endif | |
" Enable relative line numbering on vim 7.3 | |
" if version >= 700 | |
" silent! set rnu | |
" endif | |
if &t_Co > 2 || has("gui_running") | |
syntax on " turns on syntax highlighting | |
set hlsearch " highlights the last searched pattern. | |
set t_Co=256 " enable 256 color mode | |
colorscheme jellybeans | |
endif | |
if has("autocmd") | |
filetype plugin indent on " Enable file type detection. | |
" Put these in an autocmd group, so that we can delete them easily. | |
augroup vimrcEx | |
au! | |
" For all text files set 'textwidth' to 78 characters. | |
autocmd FileType text setlocal textwidth=78 | |
" When editing a file, always jump to the last known cursor position. | |
" Don't do it when the position is invalid or when inside an event handler | |
" (happens when dropping a file on gvim). | |
" Also don't do it when the mark is in the first line, that is the default | |
" position when opening a file. | |
autocmd BufReadPost * | |
\ if line("'\"") > 1 && line("'\"") <= line("$") | | |
\ exe "normal! g`\"" | | |
\ endif | |
augroup END | |
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags | |
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS | |
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags | |
autocmd FileType php set omnifunc=phpcomplete#CompletePHP | |
autocmd FileType python set omnifunc=pythoncomplete#Complete | |
autocmd FileType css set omnifunc=csscomplete#CompleteCSS | |
" causes VIM to enter the directory of the file being edited to simplify | |
" finding related files. | |
autocmd BufEnter * cd %:p:h | |
" highlights interpolated variable in sql strings and does sql syntax | |
autocmd FileType php let php_sql_query=1 | |
" highlight html inside of php strings | |
autocmd FileType php let php_htmlInStrings=1 | |
" discourages the use of short tags. | |
autocmd FileType php let php_noShortTags=1 | |
autocmd FileType php nmap <leader>x :w<CR>:silent !php %:p<CR> | |
autocmd FileType php nmap <leader>X :w<CR>:silent !php %:p | |
autocmd FileType php nmap <leader>sx :w<CR>:silent !php %:p >> /tmp/$LOGNAME\screen-out<CR>:redraw<CR> | |
" automagically folds functions & methods. | |
" autocmd FileType php let php_folding=1 | |
" end PHP stuff | |
autocmd FileType python nmap <leader>x :w<CR>:silent !python %:p<CR> | |
autocmd FileType python nmap <leader>X :w<CR>:silent !python %:p | |
autocmd FileType python nmap <leader>sx :w<CR>:!python %:p >> /tmp/$LOGNAME\screen-out 2>&1<CR><CR> | |
" add proper coloring for my .localrc file | |
au BufNewFile,BufRead .localrc call SetFileTypeSH("bash") | |
" add Coloring for ChucK source | |
au! BufNewFile,BufRead *.ck setf ck | |
else | |
endif " has("autocmd") | |
" Convenient command to see the difference between the current buffer and the | |
" file it was loaded from, thus the changes you made. | |
" Only define it when not defined already. | |
if !exists(":DiffOrig") | |
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis | |
\ | wincmd p | diffthis | |
endif | |
if has("multi_byte") | |
if &termencoding == "" | |
let &termencoding = &encoding | |
endif | |
" set encoding=utf-8 | |
" setglobal fileencoding=utf-8 bomb | |
" set fileencodings=ucs-bom,utf-8,latin1 | |
endif | |
" Shortcut to show invisible characters | |
nmap <leader>l :set list!<CR> | |
" ctrl-shift-J appends the current line to the line below it | |
nmap <C-S-J> ddpkJ | |
" swap current line with the line below | |
nmap <leader>s jddkP=j | |
" swap current line with the line above | |
nmap <leader>S kddp=kj | |
" jump to last non-blank line preceding a blank line | |
nmap <leader>f j/^[\s\t]*$/-1 <CR> | |
nmap <leader>i gg=G`` | |
nmap <leader>n :set nu!<CR> | |
nmap <leader>r :set relativenumber!<CR> | |
map <F8> :vertical wincmd f<CR> | |
" closes the current buffer | |
nmap <F10> :bd<CR> | |
" press escape twice to clear highlight search | |
nnoremap <silent> <Esc><Esc> <Esc>:nohlsearch<CR><Esc> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim syntax file | |
" Language: CHUCK | |
" Adapted by Eduard Aylon <[email protected]> from the c.vim syntax file from Bram Moolenar <[email protected]> | |
" NOTE: in order to obtain syntax highlighting in Chuck programs just follow the | |
" steps below or in case you don't have root privileges follow Graham Percival's tip : | |
" 1. copy this file into /usr/share/vim/vim62/syntax. | |
" 2. add the following line in /usr/share/vim/filetype.vim, | |
" | |
" au BufNewFile,BufRead *.ck setf ck | |
" | |
"Tip from Graham Percival: | |
" If you cannot write to /usr/share/ (lacking root privileges), | |
" enter these commands: | |
" $ echo "syntax on" >> ~/.vimrc | |
" $ mkdir ~/.vim | |
" $ mkdir ~/.vim/syntax | |
" $ cp ck.vim ~/.vim/syntax/ | |
" $ echo "if exists(\"did_load_filetypes\") | |
" finish | |
" endif | |
" augroup filetypedetect | |
" au! BufNewFile,BufRead *.ck setf ck | |
" augroup END" >> ~/.vim/filetype.vim | |
" 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 | |
"catch errors caused by wrong parenthesis and brackets | |
" also accept <% for {, %> for }, <: for [ and :> for ] (C99) | |
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cCommentSkip,cOctalZero,cCppOut,cCppOut2,cCppSkip,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom | |
if exists("c_no_bracket_error") | |
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString | |
" cCppParen: same as cParen but ends at end-of-line; used in cDefine | |
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString | |
syn match cParenError display ")" | |
syn match cErrInParen display contained "[{}]\|<%\|%>" | |
else | |
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString | |
" cCppParen: same as cParen but ends at end-of-line; used in cDefine | |
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString | |
syn match cParenError display "[\])]" | |
syn match cErrInParen display contained "[\]{}]\|<%\|%>" | |
syn region cBracket transparent start='\[\|<:' end=']\|:>' contains=ALLBUT,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString | |
" cCppBracket: same as cParen but ends at end-of-line; used in cDefine | |
syn region cCppBracket transparent start='\[\|<:' skip='\\$' excludenl end=']\|:>' end='$' contained contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString | |
syn match cErrInBracket display contained "[);{}]\|<%\|%>" | |
endif | |
if exists("c_no_cformat") | |
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial | |
" cCppString: same as cString, but ends at end of line | |
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial | |
else | |
syn match cFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXDOUfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained | |
syn match cFormat display "%%" contained | |
syn region cString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=cSpecial,cFormat | |
" cCppString: same as cString, but ends at end of line | |
syn region cCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=cSpecial,cFormat | |
endif | |
if exists("c_comment_strings") | |
" A comment can contain cString, cCharacter and cNumber. | |
" But a "*/" inside a cString in a cComment DOES end the comment! So we | |
" need to use a special type of cString: cCommentString, which also ends on | |
" "*/", and sees a "*" at the start of the line as comment again. | |
" Unfortunately this doesn't very well work for // type of comments :-( | |
syntax match cCommentSkip contained "^\s*\*\($\|\s\+\)" | |
syntax region cCommentString contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=cSpecial,cCommentSkip | |
syntax region cComment2String contained start=+L\=\\\@<!"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=cSpecial | |
syntax region cCommentL start="\(//\|<--\)" skip="(//\|<--\)$" end="$" keepend contains=@cCommentGroup,cComment2String,cCharacter,cNumbersCom,cSpaceError | |
syntax region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cCommentString,cCharacter,cNumbersCom,cSpaceError | |
else | |
syn region cCommentL start="\(//\|<--\)" skip="\(//\|<--\)$" end="$" keepend contains=@cCommentGroup,cSpaceError | |
syn region cComment matchgroup=cCommentStart start="/\*" end="\*/" contains=@cCommentGroup,cCommentStartError,cSpaceError | |
endif | |
syn match ckNone "\w\+\.\w\+" | |
syn match ckNumber "\<0x\x\+[Ll]\=\>" | |
syn match ckNumber "\<\d\+[LljJ]\=\>" | |
syn match ckNumber "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" | |
syn match ckNumber "\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>" | |
syn match ckNumber "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" | |
" CHUCK extentions | |
syn keyword ckStatement new goto break return continue spork | |
syn keyword ckConditional if else switch | |
syn keyword ckLoop while for do until | |
syn keyword ckNow now | |
syn keyword ckType dur time complex polar Shred UGen Event Object | |
syn keyword cType int float string void | |
syn match ckComplexPolar "\(%\|#\)\ze(" " \ze means end the match here | |
syn keyword ckAccess public protected private | |
syn keyword ckOperator and bitor or xor compl bitand and_eq or_eq xor_eq not not_eq | |
syn match ckCast "\s*\$\s*\(int\|float\|polar\|complex\)\ze\(\s\|,\)" | |
syn keyword ckStructure class fun | |
syn keyword ckUgen Gain Noise Impulse Step Phasor SinOsc PulseOsc TriOsc SqrOsc SawOsc Halfrec Fullrect Zerox Delayp SndBuf Pan2 | |
syn keyword ckSDK bandedWG blowbotl BlowHole Bowed Brass Clarinet Flute Mandolin ModalBar Moog Saxofony Shakers Sitar StifKarp VoicForm FM BeeThree FMVoices HevyMetl PercFlut Rhodey TubeBell Wurley Delay DelayA DelayL Echo Envelope ADSR BiQuad Filter FilterBasic OnePole TwoPole OneZero TwoZero PoleZero LPF HPF BPF BRF JCRev NRev PRCRev ResonZ Chorus Modulate PitShift SubNoise WvIn WvOut WaveLoop | |
syn keyword ckUAna UAna UAnaBlob Windowing FFT IFFT DCT IDCT Centroid Flux RMS RollOff | |
syn keyword ckBoolean true false | |
syn keyword ckShreds me machine | |
syn keyword ckInheritance subClass extends | |
syn keyword ckIO dac adc blackhole | |
syn keyword ckNetwork NetIn NetOut | |
syn keyword ckCommunication MidiIn MidiOut MidiMsg OSC_Recv OSC_Addr OSC_Send | |
syn keyword ckConstants pi | |
syn match ckOperator "\s*\(+\|-\|/\|*\|\s*\)=\(>\|<\|\^\)\s*" | |
" The minimum and maximum operators in GNU C++ | |
syn match cppMinMax "[<>]?" | |
" Default highlighting | |
if version >= 508 || !exists("did_cpp_syntax_inits") | |
if version < 508 | |
let did_cpp_syntax_inits = 1 | |
command -nargs=+ HiLink hi link <args> | |
else | |
command -nargs=+ HiLink hi def link <args> | |
endif | |
HiLink ckCommunication Special | |
HiLink ckNetwork Special | |
HiLink cCommentL cComment | |
HiLink cCommentStart cComment | |
HiLink cComment Comment | |
HiLink cCppString cString | |
HiLink cString String | |
HiLink ckConditional Conditional | |
HiLink ckLoop Repeat | |
HiLink ckAccess ckStatement | |
HiLink ckUgen ckType | |
HiLink ckSDK ckType | |
HiLink ckUAna ckType | |
HiLink ckStatement Statement | |
HiLink ckCast ckStatement | |
HiLink ckComplexPolar CkStatement | |
HiLink ckNow Special | |
HiLink ckType Type | |
HiLink cType Type | |
HiLink ckStructure Structure | |
HiLink ckOperator Operator | |
HiLink ckShreds ckStatement | |
HiLink ckInheritance ckStatement | |
HiLink ckBoolean Boolean | |
HiLink ckIO Include | |
HiLink cParenError cError | |
HiLink cErrInBracket cError | |
HiLink cErrInParen cError | |
HiLink cParen cError | |
HiLink cCppParen cError | |
HiLink cBracket cError | |
HiLink cCppBracket cError | |
HiLink cError Error | |
HiLink ckNumber Number | |
HiLink ckConstants Constant | |
delcommand HiLink | |
endif | |
let b:current_syntax = "ck" | |
" vim: ts=8 nowrap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Vim color file | |
" | |
" " __ _ _ _ " | |
" " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ " | |
" " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| " | |
" " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ " | |
" " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ " | |
" " \___/ " | |
" | |
" "A colorful, dark color scheme for Vim." | |
" | |
" File: jellybeans.vim | |
" Maintainer: NanoTech <http://nanotech.nanotechcorp.net/> | |
" Version: 1.2 | |
" Last Change: May 26th, 2009 | |
" Contributors: Daniel Herbert <http://pocket-ninja.com>, | |
" Henry So, Jr. <[email protected]>, | |
" David Liang <bmdavll at gmail dot com> | |
" | |
" Copyright (c) 2009 NanoTech | |
" | |
" Permission is hereby granted, free of charge, to any person obtaining a copy | |
" of this software and associated documentation files (the "Software"), to deal | |
" in the Software without restriction, including without limitation the rights | |
" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
" copies of the Software, and to permit persons to whom the Software is | |
" furnished to do so, subject to the following conditions: | |
" | |
" The above copyright notice and this permission notice shall be included in | |
" all copies or substantial portions of the Software. | |
" | |
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
" THE SOFTWARE. | |
set background=dark | |
hi clear | |
if exists("syntax_on") | |
syntax reset | |
endif | |
let colors_name = "jellybeans" | |
if has("gui_running") || &t_Co == 88 || &t_Co == 256 | |
let s:low_color = 0 | |
else | |
let s:low_color = 1 | |
endif | |
" Color approximation functions by Henry So, Jr. and David Liang {{{ | |
" Added to jellybeans.vim by Daniel Herbert | |
" returns an approximate grey index for the given grey level | |
fun! s: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! s: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! s: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! s: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! s: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! s: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! s:color(r, g, b) | |
" get the closest grey | |
let l:gx = s:grey_number(a:r) | |
let l:gy = s:grey_number(a:g) | |
let l:gz = s:grey_number(a:b) | |
" get the closest color | |
let l:x = s:rgb_number(a:r) | |
let l:y = s:rgb_number(a:g) | |
let l:z = s:rgb_number(a:b) | |
if l:gx == l:gy && l:gy == l:gz | |
" there are two possibilities | |
let l:dgr = s:grey_level(l:gx) - a:r | |
let l:dgg = s:grey_level(l:gy) - a:g | |
let l:dgb = s:grey_level(l:gz) - a:b | |
let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb) | |
let l:dr = s:rgb_level(l:gx) - a:r | |
let l:dg = s:rgb_level(l:gy) - a:g | |
let l:db = s: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 s:grey_color(l:gx) | |
else | |
" use the color | |
return s:rgb_color(l:x, l:y, l:z) | |
endif | |
else | |
" only one possibility | |
return s:rgb_color(l:x, l:y, l:z) | |
endif | |
endfun | |
" returns the palette index to approximate the 'rrggbb' hex string | |
fun! s: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 s:color(l:r, l:g, l:b) | |
endfun | |
" sets the highlighting for the given group | |
fun! s:X(group, fg, bg, attr, lcfg, lcbg) | |
if s:low_color | |
let l:fge = empty(a:lcfg) | |
let l:bge = empty(a:lcbg) | |
if !l:fge && !l:bge | |
exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=".a:lcbg | |
elseif !l:fge && l:bge | |
exec "hi ".a:group." ctermfg=".a:lcfg." ctermbg=NONE" | |
elseif l:fge && !l:bge | |
exec "hi ".a:group." ctermfg=NONE ctermbg=".a:lcbg | |
endif | |
else | |
let l:fge = empty(a:fg) | |
let l:bge = empty(a:bg) | |
if !l:fge && !l:bge | |
exec "hi ".a:group." guifg=#".a:fg." guibg=#".a:bg." ctermfg=".s:rgb(a:fg)." ctermbg=".s:rgb(a:bg) | |
elseif !l:fge && l:bge | |
exec "hi ".a:group." guifg=#".a:fg." guibg=NONE ctermfg=".s:rgb(a:fg) | |
elseif l:fge && !l:bge | |
exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermbg=".s:rgb(a:bg) | |
endif | |
endif | |
if a:attr == "" | |
exec "hi ".a:group." gui=none cterm=none" | |
else | |
if a:attr == 'italic' | |
exec "hi ".a:group." gui=".a:attr." cterm=none" | |
else | |
exec "hi ".a:group." gui=".a:attr." cterm=".a:attr | |
endif | |
endif | |
endfun | |
" }}} | |
if version >= 700 | |
call s:X("CursorLine","","1c1c1c","","","") | |
call s:X("CursorColumn","","1c1c1c","","","") | |
call s:X("MatchParen","ffffff","80a090","bold","","") | |
call s:X("TabLine","000000","b0b8c0","italic","","Black") | |
call s:X("TabLineFill","9098a0","","","","") | |
call s:X("TabLineSel","000000","f0f0f0","italic,bold","","") | |
" Auto-completion | |
call s:X("Pmenu","ffffff","000000","","","") | |
call s:X("PmenuSel","101010","eeeeee","","","") | |
endif | |
call s:X("Visual","","404040","","","") | |
call s:X("Cursor","","b0d0f0","","","") | |
call s:X("Normal","e8e8d3","151515","","White","") | |
call s:X("LineNr","605958","151515","none","Black","") | |
call s:X("Comment","888888","","italic","Grey","") | |
call s:X("Todo","808080","","bold","","") | |
call s:X("StatusLine","f0f0f0","101010","italic","","") | |
call s:X("StatusLineNC","a0a0a0","181818","italic","","") | |
call s:X("VertSplit","181818","181818","italic","","") | |
call s:X("Folded","a0a8b0","384048","italic","black","") | |
call s:X("FoldColumn","a0a8b0","384048","","","") | |
call s:X("SignColumn","a0a8b0","384048","","","") | |
call s:X("Title","70b950","","bold","","") | |
call s:X("Constant","cf6a4c","","","Red","") | |
call s:X("Special","799d6a","","","Green","") | |
call s:X("Delimiter","668799","","","Grey","") | |
call s:X("String","99ad6a","","","Green","") | |
call s:X("StringDelimiter","556633","","","DarkGreen","") | |
call s:X("Identifier","c6b6ee","","","LightCyan","") | |
call s:X("Structure","8fbfdc","","","LightCyan","") | |
call s:X("Function","fad07a","","","Yellow","") | |
call s:X("Statement","8197bf","","","DarkBlue","") | |
call s:X("PreProc","8fbfdc","","","LightBlue","") | |
hi link Operator Normal | |
call s:X("Type","ffb964","","","Yellow","") | |
call s:X("NonText","808080","151515","","","") | |
call s:X("SpecialKey","808080","343434","","","") | |
call s:X("Search","f0a0c0","302028","underline","Magenta","") | |
call s:X("Directory","dad085","","","","") | |
call s:X("ErrorMsg","","902020","","","") | |
hi link Error ErrorMsg | |
" Diff | |
hi link diffRemoved Constant | |
hi link diffAdded String | |
" VimDiff | |
call s:X("DiffAdd","","032218","","Black","DarkGreen") | |
call s:X("DiffChange","","100920","","Black","DarkMagenta") | |
call s:X("DiffDelete","220000","220000","","DarkRed","DarkRed") | |
call s:X("DiffText","","000940","","","DarkRed") | |
" PHP | |
hi link phpFunctions Function | |
call s:X("StorageClass","c59f6f","","","Red","") | |
hi link phpSuperglobal Identifier | |
hi link phpQuoteSingle StringDelimiter | |
hi link phpQuoteDouble StringDelimiter | |
hi link phpBoolean Constant | |
hi link phpNull Constant | |
hi link phpArrayPair Operator | |
" Ruby | |
hi link rubySharpBang Comment | |
call s:X("rubyClass","447799","","","DarkBlue","") | |
call s:X("rubyIdentifier","c6b6fe","","","","") | |
call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","") | |
call s:X("rubySymbol","7697d6","","","Blue","") | |
hi link rubyGlobalVariable rubyInstanceVariable | |
hi link rubyModule rubyClass | |
call s:X("rubyControl","7597c6","","","","") | |
hi link rubyString String | |
hi link rubyStringDelimiter StringDelimiter | |
hi link rubyInterpolationDelimiter Identifier | |
call s:X("rubyRegexpDelimiter","540063","","","Magenta","") | |
call s:X("rubyRegexp","dd0093","","","DarkMagenta","") | |
call s:X("rubyRegexpSpecial","a40073","","","Magenta","") | |
call s:X("rubyPredefinedIdentifier","de5577","","","Red","") | |
" JavaScript | |
hi link javaScriptValue Constant | |
hi link javaScriptRegexpString rubyRegexp | |
" Tag list | |
hi link TagListFileName Directory | |
" delete functions {{{ | |
delf s:X | |
delf s:rgb | |
delf s:color | |
delf s:rgb_color | |
delf s:rgb_level | |
delf s:rgb_number | |
delf s:grey_color | |
delf s:grey_level | |
delf s:grey_number | |
" }}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment