From 0cf5025147b364fcea4b98c09591b8efbd4ecc4d Mon Sep 17 00:00:00 2001 From: Kevin Luo Date: Fri, 16 Aug 2013 14:43:55 +0800 Subject: [PATCH] Add xfalcons's setting --- .netrwhist | 4 + bundle/gitdiff/plugin/gitdiff.vim | 141 ++++++++++++++++++++ bundle/php-doc/plugin/php-doc.vim | 6 +- colors/ir_black.vim | 212 ++++++++++++++++++++++++++++++ colors/xfalcons.vim | 1 + vimrc | 25 ++++ 6 files changed, 386 insertions(+), 3 deletions(-) create mode 100644 .netrwhist create mode 100644 bundle/gitdiff/plugin/gitdiff.vim create mode 100644 colors/ir_black.vim diff --git a/.netrwhist b/.netrwhist new file mode 100644 index 0000000..edf04a4 --- /dev/null +++ b/.netrwhist @@ -0,0 +1,4 @@ +let g:netrw_dirhistmax =10 +let g:netrw_dirhist_cnt =2 +let g:netrw_dirhist_1='/Volumes/MacHD/Users/kevin_luo/dev/miiitv/index/modules/home/controllers' +let g:netrw_dirhist_2='/Volumes/MacHD/Users/kevin_luo/bin' diff --git a/bundle/gitdiff/plugin/gitdiff.vim b/bundle/gitdiff/plugin/gitdiff.vim new file mode 100644 index 0000000..43dc8ac --- /dev/null +++ b/bundle/gitdiff/plugin/gitdiff.vim @@ -0,0 +1,141 @@ +" gitdiff.vim : git helper functions +" http://www.vim.org/scripts/script.php?script_id=1846 +" +" Author: Bart Trojanowski +" Date: 2007/05/02 +" Version: 2 +" +" GetLatestVimScripts: 1846 1 :AutoInstall: gitdiff.vim + +"------------------------------------------------------------------------ +" +" This script currently installs two new functions: +" +" :GITDiff [rev] +" +" Vertical split with working buffer, showing vimdiff between current +" buffer and a commit. +" +" :GITChanges [rev] +" +" Highlights modified lines in current buffer. +" Disable with :syntax on +" +"------------------------------------------------------------------------ + +if exists("loaded_gitdiff") || &compatible + finish +endif +let loaded_gitdiff = 1 + +"" ------------------------------------------------------------------------ +" based on svndiff from... +" http://www.axisym3.net/jdany/vim-the-editor/ +"" ------------------------------------------------------------------------ + +command! -nargs=? GITDiff :call s:GitDiff() + +function! s:GitDiff(...) + if a:0 == 1 + let rev = a:1 + else + let rev = 'HEAD' + endif + + let ftype = &filetype + + let prefix = system("git rev-parse --show-prefix") + let thisfile = substitute(expand("%"),getcwd(),'','') + let gitfile = substitute(prefix,'\n$','','') . thisfile + + " Check out the revision to a temp file + let tmpfile = tempname() + let cmd = "git show " . rev . ":" . gitfile . " > " . tmpfile + let cmd_output = system(cmd) + if v:shell_error && cmd_output != "" + echohl WarningMsg | echon cmd_output + return + endif + + " Begin diff + exe "vert diffsplit" . tmpfile + exe "set filetype=" . ftype + set foldmethod=diff + wincmd l + +endfunction + +"" ------------------------------------------------------------------------ +"" this block is taken from svndiff.vim +"" http://www.vim.org/scripts/script.php?script_id=1881#1.0 +"" by Zevv Ico +"" ------------------------------------------------------------------------ + +command! -nargs=? GITChanges :call s:GitChanges() + +function! s:GitChanges(...) + + if a:0 == 1 + let rev = a:1 + else + let rev = 'HEAD' + endif + + " Check if this file is managed by git, exit otherwise + + let prefix = system("git rev-parse --show-prefix") + let thisfile = substitute(expand("%"),getcwd(),'','') + let gitfile = substitute(prefix,'\n$','','') . thisfile + + " Reset syntax highlighting + + syntax off + + " Pipe the current buffer contents to a shell command calculating the diff + " in a friendly parsable format + + let contents = join(getbufline("%", 1, "$"), "\n") + let diff = system("diff -u0 <(git show " . rev . ":" . gitfile . ") <(cat;echo)", contents) + + " Parse the output of the diff command and hightlight changed, added and + " removed lines + + for line in split(diff, '\n') + + let part = matchlist(line, '@@ -\([0-9]*\),*\([0-9]*\) +\([0-9]*\),*\([0-9]*\) @@') + + if ! empty(part) + let old_from = part[1] + let old_count = part[2] == '' ? 1 : part[2] + let new_from = part[3] + let new_count = part[4] == '' ? 1 : part[4] + + " Figure out if text was added, removed or changed. + + if old_count == 0 + let from = new_from + let to = new_from + new_count - 1 + let group = 'DiffAdd' + elseif new_count == 0 + let from = new_from + let to = new_from + 1 + let group = 'DiffDelete' + else + let from = new_from + let to = new_from + new_count - 1 + let group = 'DiffChange' + endif + + " Set the actual syntax highlight + + exec 'syntax region ' . group . ' start=".*\%' . from . 'l" end=".*\%' . to . 'l"' + + endif + + endfor + +endfunction + + +" vi: ts=2 sw=2 + diff --git a/bundle/php-doc/plugin/php-doc.vim b/bundle/php-doc/plugin/php-doc.vim index 0f9ff77..1a15de7 100644 --- a/bundle/php-doc/plugin/php-doc.vim +++ b/bundle/php-doc/plugin/php-doc.vim @@ -78,9 +78,9 @@ let g:pdv_cfg_CommentSingle = "//" let g:pdv_cfg_Type = "mixed" let g:pdv_cfg_Package = "" let g:pdv_cfg_Version = "$id$" -let g:pdv_cfg_Author = "Joseph Chiang " -let g:pdv_cfg_Copyright = "1997-2005 The PHP Group" -let g:pdv_cfg_License = "PHP Version 3.0 {@link http://www.php.net/license/3_0.txt}" +let g:pdv_cfg_Author = "Kevin Luo " +let g:pdv_cfg_Copyright = "1997-2012 Chi-Ming (Kevin) Luo" +let g:pdv_cfg_License = "PHP Version 5.0 {@link http://www.php.net/license/5_0.txt}" let g:pdv_cfg_ReturnVal = "void" diff --git a/colors/ir_black.vim b/colors/ir_black.vim new file mode 100644 index 0000000..2e151d8 --- /dev/null +++ b/colors/ir_black.vim @@ -0,0 +1,212 @@ +" ir_black color scheme +" More at: http://blog.infinitered.com/entries/show/8 + + +" ******************************************************************************** +" Standard colors used in all ir_black themes: +" Note, x:x:x are RGB values +" +" normal: #f6f3e8 +" +" string: #A8FF60 168:255:96 +" string inner (punc, code, etc): #00A0A0 0:160:160 +" number: #FF73FD 255:115:253 +" comments: #7C7C7C 124:124:124 +" keywords: #96CBFE 150:203:254 +" operators: white +" class: #FFFFB6 255:255:182 +" method declaration name: #FFD2A7 255:210:167 +" regular expression: #E9C062 233:192:98 +" regexp alternate: #FF8000 255:128:0 +" regexp alternate 2: #B18A3D 177:138:61 +" variable: #C6C5FE 198:197:254 +" +" Misc colors: +" red color (used for whatever): #FF6C60 255:108:96 +" light red: #FFB6B0 255:182:176 +" +" brown: #E18964 good for special +" +" lightpurpleish: #FFCCFF +" +" Interface colors: +" background color: black +" cursor (where underscore is used): #FFA560 255:165:96 +" cursor (where block is used): white +" visual selection: #1D1E2C +" current line: #151515 21:21:21 +" search selection: #07281C 7:40:28 +" line number: #3D3D3D 61:61:61 + + +" ******************************************************************************** +" The following are the preferred 16 colors for your terminal +" Colors Bright Colors +" Black #4E4E4E #7C7C7C +" Red #FF6C60 #FFB6B0 +" Green #A8FF60 #CEFFAB +" Yellow #FFFFB6 #FFFFCB +" Blue #96CBFE #FFFFCB +" Magenta #FF73FD #FF9CFE +" Cyan #C6C5FE #DFDFFE +" White #EEEEEE #FFFFFF + + +" ******************************************************************************** +set background=dark +hi clear + +if exists("syntax_on") + syntax reset +endif + +let colors_name = "ir_black" + + +"hi Example guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + +" General colors +hi Normal guifg=#f6f3e8 guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi NonText guifg=#070707 guibg=black gui=NONE ctermfg=black ctermbg=NONE cterm=NONE + +hi Cursor guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=reverse +hi LineNr guifg=#3D3D3D guibg=black gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE + +hi VertSplit guifg=#202020 guibg=#202020 gui=NONE ctermfg=darkgray ctermbg=darkgray cterm=NONE +hi StatusLine guifg=#CCCCCC guibg=#202020 gui=italic ctermfg=white ctermbg=darkgray cterm=NONE +hi StatusLineNC guifg=black guibg=#202020 gui=NONE ctermfg=blue ctermbg=darkgray cterm=NONE + +hi Folded guifg=#a0a8b0 guibg=#384048 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE +hi Title guifg=#f6f3e8 guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=NONE +hi Visual guifg=NONE guibg=#262D51 gui=NONE ctermfg=NONE ctermbg=darkgray cterm=NONE + +hi SpecialKey guifg=#808080 guibg=#343434 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + +hi WildMenu guifg=green guibg=yellow gui=NONE ctermfg=black ctermbg=yellow cterm=NONE +hi PmenuSbar guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=NONE +"hi Ignore guifg=gray guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + +hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=white ctermbg=red cterm=NONE guisp=#FF6C60 " undercurl color +hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE +hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE + +" Message displayed in lower left, such as --INSERT-- +hi ModeMsg guifg=black guibg=#C6C5FE gui=BOLD ctermfg=black ctermbg=cyan cterm=BOLD + +if version >= 700 " Vim 7.x specific colors + hi CursorLine guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD + hi CursorColumn guifg=NONE guibg=#121212 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD + hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=BOLD ctermfg=white ctermbg=darkgray cterm=NONE + hi Pmenu guifg=#f6f3e8 guibg=#444444 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + hi PmenuSel guifg=#000000 guibg=#cae682 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE + hi Search guifg=NONE guibg=NONE gui=underline ctermfg=NONE ctermbg=NONE cterm=underline +endif + +" Syntax highlighting +hi Comment guifg=#7C7C7C guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE +hi String guifg=#A8FF60 guibg=NONE gui=NONE ctermfg=green ctermbg=NONE cterm=NONE +hi Number guifg=#FF73FD guibg=NONE gui=NONE ctermfg=magenta ctermbg=NONE cterm=NONE + +hi Keyword guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE +hi PreProc guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE +hi Conditional guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE " if else end + +hi Todo guifg=#8f8f8f guibg=NONE gui=NONE ctermfg=red ctermbg=NONE cterm=NONE +hi Constant guifg=#99CC99 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE + +hi Identifier guifg=#C6C5FE guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE +hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE +hi Type guifg=#FFFFB6 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE +hi Statement guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE + +hi Special guifg=#E18964 guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE +hi Delimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE +hi Operator guifg=white guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE + +hi link Character Constant +hi link Boolean Constant +hi link Float Number +hi link Repeat Statement +hi link Label Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link Tag Special +hi link SpecialChar Special +hi link SpecialComment Special +hi link Debug Special + + +" Special for Ruby +hi rubyRegexp guifg=#B18A3D guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE +hi rubyRegexpDelimiter guifg=#FF8000 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE +hi rubyEscape guifg=white guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE +hi rubyInterpolationDelimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE +hi rubyControl guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE "and break, etc +"hi rubyGlobalVariable guifg=#FFCCFF guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE "yield +hi rubyStringDelimiter guifg=#336633 guibg=NONE gui=NONE ctermfg=lightgreen ctermbg=NONE cterm=NONE +"rubyInclude +"rubySharpBang +"rubyAccess +"rubyPredefinedVariable +"rubyBoolean +"rubyClassVariable +"rubyBeginEnd +"rubyRepeatModifier +"hi link rubyArrayDelimiter Special " [ , , ] +"rubyCurlyBlock { , , } + +hi link rubyClass Keyword +hi link rubyModule Keyword +hi link rubyKeyword Keyword +hi link rubyOperator Operator +hi link rubyIdentifier Identifier +hi link rubyInstanceVariable Identifier +hi link rubyGlobalVariable Identifier +hi link rubyClassVariable Identifier +hi link rubyConstant Type + + +" Special for Java +" hi link javaClassDecl Type +hi link javaScopeDecl Identifier +hi link javaCommentTitle javaDocSeeTag +hi link javaDocTags javaDocSeeTag +hi link javaDocParam javaDocSeeTag +hi link javaDocSeeTagParam javaDocSeeTag + +hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE +hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE +"hi javaClassDecl guifg=#CCFFCC guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE + + +" Special for XML +hi link xmlTag Keyword +hi link xmlTagName Conditional +hi link xmlEndTag Identifier + + +" Special for HTML +hi link htmlTag Keyword +hi link htmlTagName Conditional +hi link htmlEndTag Identifier + + +" Special for Javascript +hi link javaScriptNumber Number + + +" Special for Python +"hi link pythonEscape Keyword + + +" Special for CSharp +hi link csXmlTag Keyword + + +" Special for PHP diff --git a/colors/xfalcons.vim b/colors/xfalcons.vim index dd83db8..c91e3e8 100644 --- a/colors/xfalcons.vim +++ b/colors/xfalcons.vim @@ -38,5 +38,6 @@ hi CursorLine guibg=#dbdbdb gui=none "highlight Pmenu ctermfg=1 ctermbg=4 guibg=grey30 hi PmenuSel ctermfg=1 ctermbg=7 guibg=grey30 + "} diff --git a/vimrc b/vimrc index 0a554a6..e315836 100644 --- a/vimrc +++ b/vimrc @@ -162,6 +162,16 @@ cnoremap cnoremap cnoremap +" PHP Folding +map :EnableFastPHPFolds +map :EnablePHPFolds +map :DisablePHPFolds + +" PHP Documentation plugin. +inoremap :call PhpDocSingle()i +nnoremap :call PhpDocSingle() +vnoremap :call PhpDocRange() + " ,p toggles paste mode nmap p :set paste!set paste? @@ -314,3 +324,18 @@ let g:tagbar_autofocus = 1 " --- PowerLine " let g:Powerline_symbols = 'fancy' " require fontpatcher +" --- Syntax highlight for vimdiff +highlight DiffAdd term=reverse cterm=bold ctermbg=green ctermfg=black +highlight DiffChange term=reverse cterm=bold ctermbg=cyan ctermfg=black +highlight DiffText term=reverse cterm=bold ctermbg=gray ctermfg=black +highlight DiffDelete term=reverse cterm=bold ctermbg=red ctermfg=black + +" Syntax highlight. +" syntax on +hi Comment term=standout cterm=bold ctermfg=0 +highlight Search term=reverse ctermbg=3 ctermfg=0 +highlight Normal ctermbg=black ctermfg=white +highlight Folded ctermbg=black ctermfg=darkcyan +hi Cursor ctermbg=Gray ctermfg=Blue +highlight clear SpellBad +highlight SpellBad term=underline cterm=underline ctermfg=red