From f205f3b36db79bc88507f4b637d0a8f0f4d9fb09 Mon Sep 17 00:00:00 2001 From: gryf Date: Sat, 16 Apr 2011 06:53:59 +0200 Subject: [PATCH] Jellybeans colorscheme update, added repeat and zoom plugins, changed vcscommand to support switching VCS on fly, changed python snippets (edbg) added fitnesse wiki syntax. --- .vimrc | 9 ++- colors/jellybeans.vim | 153 ++++++++++++++++++++++++--------------- plugin/repeat.vim | 72 ++++++++++++++++++ plugin/vcscommand.vim | 3 + plugin/zoom.vim | 81 +++++++++++++++++++++ snippets/python.snippets | 2 +- syntax/fitnesse.vim | 62 ++++++++++++++++ 7 files changed, 317 insertions(+), 65 deletions(-) create mode 100644 plugin/repeat.vim create mode 100644 plugin/zoom.vim create mode 100644 syntax/fitnesse.vim diff --git a/.vimrc b/.vimrc index f9cecdd..89b11f8 100644 --- a/.vimrc +++ b/.vimrc @@ -9,6 +9,7 @@ set background=dark "Hint Vim that I use dark colorscheme set confirm "Ask for confirmation rather then refuse certain commands set cursorline "Turn on current line highlight +set nohlsearch "Turn off highlighting text by default set expandtab "I want spaces instead of tabs set fileencodings=ucs-bom,utf-8,latin2,default,latin1,default set fileformats=unix,dos "Type of in written files @@ -196,8 +197,8 @@ map wp VimwikiPrevWord map ]b :call OpenInFirefox() "make displaying tags easy -"nmap t :TlistToo -nmap t :TagbarToggle +nmap t :TlistToo +nmap T :TagbarToggle "eclim Buffer shortcut map b :Buffers @@ -308,8 +309,8 @@ endfunction " GUI: here goes all the gvim customizations {{{ if has('gui_running') "set guifont=Consolas\ 12 "I like this font, but it looks like crap on linux - set guifont=Consolas\ 13 "Let's try again - "set guifont=Fixed\ 14 "I like this font better. + "set guifont=Consolas\ 13 "Let's try again + set guifont=Fixed\ 14 "I like this font better. set mouse=a "Enable mouse support "No toolbar, menu, scrollbars, draw simple text tabs. This would keep "window in one place, and also this will conserve space. Tabs are huge diff --git a/colors/jellybeans.vim b/colors/jellybeans.vim index 83a42cf..3fc5386 100644 --- a/colors/jellybeans.vim +++ b/colors/jellybeans.vim @@ -11,13 +11,13 @@ " " File: jellybeans.vim " Maintainer: NanoTech -" Version: 1.3 -" Last Change: October 25th, 2010 +" Version: 1.4 +" Last Change: April 11th, 2011 " Contributors: Daniel Herbert , " Henry So, Jr. , " David Liang " -" Copyright (c) 2009-2010 NanoTech +" Copyright (c) 2009-2011 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 @@ -269,56 +269,59 @@ fun! s:X(group, fg, bg, attr, lcfg, lcbg) 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) + exec "hi ".a:group." guifg=#".a:fg." guibg=NONE ctermfg=".s:rgb(a:fg)." ctermbg=NONE" elseif l:fge && !l:bge - exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermbg=".s:rgb(a:bg) + exec "hi ".a:group." guifg=NONE guibg=#".a:bg." ctermfg=NONE 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 + let noitalic = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",") + if empty(noitalic) + let noitalic = "none" endif + exec "hi ".a:group." gui=".a:attr." cterm=".noitalic endif endfun " }}} +call s:X("Normal","e8e8d3","151515","","White","") +set background=dark + if version >= 700 - call s:X("CursorLine","","1c1c1c","","","") - call s:X("CursorColumn","","1c1c1c","","","") + call s:X("CursorLine","","1c1c1c","","","Black") + call s:X("CursorColumn","","1c1c1c","","","Black") call s:X("ColorColumn","","1c1c1c","","","") - call s:X("MatchParen","ffffff","80a090","bold","","") + call s:X("MatchParen","ffffff","80a090","bold","","DarkCyan") call s:X("TabLine","000000","b0b8c0","italic","","Black") - call s:X("TabLineFill","9098a0","","","","") - call s:X("TabLineSel","000000","f0f0f0","italic,bold","","") + call s:X("TabLineFill","9098a0","","","","Black") + call s:X("TabLineSel","000000","f0f0f0","italic,bold","Black","White") " Auto-completion - call s:X("Pmenu","ffffff","000000","","","") - call s:X("PmenuSel","101010","eeeeee","","","") + call s:X("Pmenu","ffffff","606060","","White","Black") + call s:X("PmenuSel","101010","eeeeee","","Black","White") endif -call s:X("Visual","","404040","","","") +call s:X("Visual","","404040","","","Black") 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("Todo","808080","","bold","White","Black") call s:X("StatusLine","000000","dddddd","italic","Black","White") call s:X("StatusLineNC","ffffff","403c41","italic","White","Black") call s:X("VertSplit","777777","403c41","italic","Black","Black") +call s:X("WildMenu","f0a0c0","302028","","Magenta","") -call s:X("Folded","a0a8b0","384048","italic","black","") -call s:X("FoldColumn","a0a8b0","384048","","","") -call s:X("SignColumn","a0a8b0","384048","","","") +call s:X("Folded","a0a8b0","384048","italic","Black","") +call s:X("FoldColumn","a0a8b0","384048","","","Black") +hi! link SignColumn FoldColumn -call s:X("Title","70b950","","bold","","") +call s:X("Title","70b950","","bold","Green","") call s:X("Constant","cf6a4c","","","Red","") call s:X("Special","799d6a","","","Green","") @@ -333,23 +336,33 @@ call s:X("Function","fad07a","","","Yellow","") call s:X("Statement","8197bf","","","DarkBlue","") call s:X("PreProc","8fbfdc","","","LightBlue","") -hi link Operator Normal +hi! link Operator Normal call s:X("Type","ffb964","","","Yellow","") -call s:X("NonText","606060","151515","","","") +call s:X("NonText","606060","151515","","Black","") -call s:X("SpecialKey","444444","1c1c1c","","","") +call s:X("SpecialKey","444444","1c1c1c","","Black","") call s:X("Search","f0a0c0","302028","underline","Magenta","") -call s:X("Directory","dad085","","","","") -call s:X("ErrorMsg","","902020","","","") -hi link Error ErrorMsg +call s:X("Directory","dad085","","","Yellow","") +call s:X("ErrorMsg","","902020","","","DarkRed") +hi! link Error ErrorMsg +hi! link MoreMsg Special +call s:X("Question","65C254","","","Green","") + + +" Spell Checking + +call s:X("SpellBad","","902020","underline","","DarkRed") +call s:X("SpellCap","","0000df","underline","","Blue") +call s:X("SpellRare","","540063","underline","","DarkMagenta") +call s:X("SpellLocal","","2D7067","underline","","Green") " Diff -hi link diffRemoved Constant -hi link diffAdded String +hi! link diffRemoved Constant +hi! link diffAdded String " VimDiff @@ -360,30 +373,32 @@ call s:X("DiffText","","000940","","","DarkRed") " PHP -hi link phpFunctions Function +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 +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 +hi! link rubySharpBang Comment call s:X("rubyClass","447799","","","DarkBlue","") -call s:X("rubyIdentifier","c6b6fe","","","","") +call s:X("rubyIdentifier","c6b6fe","","","Cyan","") +hi! link rubyConstant Type +hi! link rubyFunction Function 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 rubyGlobalVariable rubyInstanceVariable +hi! link rubyModule rubyClass +call s:X("rubyControl","7597c6","","","Blue","") -hi link rubyString String -hi link rubyStringDelimiter StringDelimiter -hi link rubyInterpolationDelimiter Identifier +hi! link rubyString String +hi! link rubyStringDelimiter StringDelimiter +hi! link rubyInterpolationDelimiter Identifier call s:X("rubyRegexpDelimiter","540063","","","Magenta","") call s:X("rubyRegexp","dd0093","","","DarkMagenta","") @@ -392,26 +407,44 @@ call s:X("rubyRegexpSpecial","a40073","","","Magenta","") call s:X("rubyPredefinedIdentifier","de5577","","","Red","") " JavaScript -hi link javaScriptValue Constant -hi link javaScriptRegexpString rubyRegexp +hi! link javaScriptValue Constant +hi! link javaScriptRegexpString rubyRegexp + +" CoffeeScript + +hi! link coffeeRegExp javaScriptRegexpString " C -hi link cOperator Constant +hi! link cOperator Constant " Objective-C/Cocoa -hi link objcClass Type -hi link cocoaClass objcClass -hi link objcSubclass objcClass -hi link objcSuperclass objcClass -hi link objcDirective rubyClass -hi link cocoaFunction Function -hi link objcMethodName Identifier -hi link objcMethodArg Normal -hi link objcMessageName Identifier +hi! link objcClass Type +hi! link cocoaClass objcClass +hi! link objcSubclass objcClass +hi! link objcSuperclass objcClass +hi! link objcDirective rubyClass +hi! link cocoaFunction Function +hi! link objcMethodName Identifier +hi! link objcMethodArg Normal +hi! link objcMessageName Identifier -" Tag list -hi link TagListFileName Directory +" Plugins, etc. + +hi! link TagListFileName Directory +call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green") + +" Manual overrides for 256-color terminals. Dark colors auto-map badly. +if !s:low_color + hi StatusLineNC ctermbg=234 + hi Folded ctermbg=236 + hi FoldColumn ctermbg=236 + hi SignColumn ctermbg=236 + hi DiffAdd ctermbg=22 + hi DiffDelete ctermbg=52 + hi DiffChange ctermbg=17 + hi DiffText ctermbg=19 +endif " delete functions {{{ delf s:X diff --git a/plugin/repeat.vim b/plugin/repeat.vim new file mode 100644 index 0000000..e6ec409 --- /dev/null +++ b/plugin/repeat.vim @@ -0,0 +1,72 @@ +" repeat.vim - Let the repeat command repeat plugin maps +" Maintainer: Tim Pope +" Version: 1.0 + +" Installation: +" Place in either ~/.vim/plugin/repeat.vim (to load at start up) or +" ~/.vim/autoload/repeat.vim (to load automatically as needed). +" +" Developers: +" Basic usage is as follows: +" +" silent! call repeat#set("\MappingToRepeatCommand",3) +" +" The first argument is the mapping that will be invoked when the |.| key is +" pressed. Typically, it will be the same as the mapping the user invoked. +" This sequence will be stuffed into the input queue literally. Thus you must +" encode special keys by prefixing them with a backslash inside double quotes. +" +" The second argument is the default count. This is the number that will be +" prefixed to the mapping if no explicit numeric argument was given. The +" value of the v:count variable is usually correct and it will be used if the +" second parameter is omitted. If your mapping doesn't accept a numeric +" argument and you never want to receive one, pass a value of -1. +" +" Make sure to call the repeat#set function _after_ making changes to the +" file. + +if exists("g:loaded_repeat") || &cp || v:version < 700 + finish +endif +let g:loaded_repeat = 1 + +let g:repeat_tick = -1 + +function! repeat#set(sequence,...) + silent exe "norm! \"=''\p" + let g:repeat_sequence = a:sequence + let g:repeat_count = a:0 ? a:1 : v:count + let g:repeat_tick = b:changedtick +endfunction + +function! s:repeat(count) + if g:repeat_tick == b:changedtick + let c = g:repeat_count + let s = g:repeat_sequence + let cnt = c == -1 ? "" : (a:count ? a:count : (c ? c : '')) + call feedkeys(cnt . s) + else + call feedkeys((a:count ? a:count : '') . '.', 'n') + endif +endfunction + +function! s:wrap(command,count) + let preserve = (g:repeat_tick == b:changedtick) + exe 'norm! '.(a:count ? a:count : '').a:command + if preserve + let g:repeat_tick = b:changedtick + endif +endfunction + +nnoremap . :call repeat(v:count) +nnoremap u :call wrap('u',v:count) +nnoremap U :call wrap('U',v:count) +nnoremap :call wrap("\C-R>",v:count) + +augroup repeatPlugin + autocmd! + autocmd BufLeave,BufWritePre,BufReadPre * let g:repeat_tick = (g:repeat_tick == b:changedtick || g:repeat_tick == 0) ? 0 : -1 + autocmd BufEnter,BufWritePost * if g:repeat_tick == 0|let g:repeat_tick = b:changedtick|endif +augroup END + +" vim:set ft=vim et sw=4 sts=4: diff --git a/plugin/vcscommand.vim b/plugin/vcscommand.vim index 98214f2..e4234bb 100644 --- a/plugin/vcscommand.vim +++ b/plugin/vcscommand.vim @@ -1027,6 +1027,9 @@ endfunction " Multiple inexact matches is currently considered an error. function! VCSCommandGetVCSType(buffer) + if exists("g:VCSTypeOverride") + return g:VCSTypeOverride + endif let vcsType = getbufvar(a:buffer, 'VCSCommandVCSType') if strlen(vcsType) > 0 return vcsType diff --git a/plugin/zoom.vim b/plugin/zoom.vim new file mode 100644 index 0000000..b6efb6f --- /dev/null +++ b/plugin/zoom.vim @@ -0,0 +1,81 @@ +if &cp || exists("g:loaded_zoom") + finish +endif +let g:loaded_zoom = 1 + +let s:save_cpo = &cpo +set cpo&vim + +" keep default value +let s:current_font = &guifont + +" command +command! -narg=0 ZoomIn :call s:ZoomIn() +command! -narg=0 ZoomOut :call s:ZoomOut() +command! -narg=0 ZoomReset :call s:ZoomReset() + +" map +nmap :ZoomIn +nmap :ZoomOut +nmap :ZoomReset + +" guifont size + 1 +function! s:ZoomIn() + let l:font = split(&guifont) + let l:size = l:font[1] + 1 + let &guifont = l:font[0] . " " . l:size +endfunction + +" guifont size - 1 +function! s:ZoomOut() + let l:font = split(&guifont) + let l:size = l:font[1] - 1 + let &guifont = l:font[0] . " " . l:size +endfunction + +" reset guifont size +function! s:ZoomReset() + let &guifont = s:current_font +endfunction + +let &cpo = s:save_cpo +finish + +============================================================================== +zoom.vim : control gui font size with "+" or "-" keys. +------------------------------------------------------------------------------ +$VIMRUNTIMEPATH/plugin/zoom.vim +============================================================================== +author : OMI TAKU +url : http://nanasi.jp/ +email : mail@nanasi.jp +version : 2008/07/18 10:00:00 +============================================================================== + +Control Vim editor font size with key "+", or key "-". +Press "+" key, Vim editor gui font size will change bigger. +And, press "-" key, Vim editor gui font size will change smaller. + +This plugin is for GUI only. + + +Normal Mode: + + ... change font size bigger + - ... change font size smaller + +Command-line Mode: + :ZoomIn ... change font size bigger + :ZoomOut ... change font size smaller + :ZoomReset ... reset font size changes. + +============================================================================== + +1. Copy the zoom.vim script to + $HOME/vimfiles/plugin or $HOME/.vim/plugin directory. + Refer to ':help add-plugin', ':help add-global-plugin' and + ':help runtimepath' for more details about Vim plugins. + +2. Restart Vim. + +============================================================================== +" vim: set ff=unix et ft=vim nowrap : diff --git a/snippets/python.snippets b/snippets/python.snippets index 8896120..95a4436 100644 --- a/snippets/python.snippets +++ b/snippets/python.snippets @@ -108,7 +108,7 @@ snippet debug LOG.debug(self.${1:method_name}.__doc__.strip()) snippet edbg import sys - pydevdPath = r"/mnt/data/IDE/eclipse/plugins/org.python.pydev.debug_1.6.3.2010100513/pysrc" + pydevdPath = r"/mnt/data/IDE/eclipse/plugins/org.python.pydev.debug_1.6.5.2011020317/pysrc" if not pydevdPath in sys.path: sys.path.append(pydevdPath) import pydevd diff --git a/syntax/fitnesse.vim b/syntax/fitnesse.vim new file mode 100644 index 0000000..8151346 --- /dev/null +++ b/syntax/fitnesse.vim @@ -0,0 +1,62 @@ +" fitnesse.vim +" @author: Dan Woodward (dan DOT woodward AT gmail.com) + + + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +let b:fitnesseEnabled = 1 + +syntax sync minlines=2 + +syn match collapsibleSectionStart /!\*\+.*/ +syn match collapsibleSectionEnd /\*\+!.*/ +syn match bracesAndBrackets "|\|{\|}\|\[\|\]" +syn match bang /!/ +syn match literalText /!-.\{-}-!/ +syn match openCell /|[^|]\+\n/hs=s+1 +syn region colapsableFold start="!\*\{1,}" end="\*!" fold transparent keepend extend +syn sync fromstart +set foldmethod=syntax +syn region cellContents start=+|+hs=s+1 end=+|+he=e-1 oneline contains=ALL +syn region styledText start=+\[+hs=s+1 end=+\]+he=e-1 oneline contains=ALL +syn region styledText2 start=+{+hs=s+1 end=+}+he=e-1 oneline contains=ALL +syn region styledText3 start=+(+hs=s+1 end=+)+he=e-1 oneline contains=ALL +syn region Comment start=/#/ end=/\n/ +syn match String /"[^"]\+"/ contains=Identifier +syn match String /'[^']\+'/ contains=Identifier +syn match symbol /$\w*/ +syn match extractVariable /${[^}]*}/ +syn match bold /'''.*'''/ +syn region heading start=/!\d/ end=/\n/ +syn match widget /!\w\+[\[{(]/me=e-1,he=e-1 +syn match Keyword /!define / +syn match Keyword /!include / +syn keyword Keyword scenario script Query: start check reject show Comment comment !see !include !See null +syn match scenarioVariable /@\w\+/ +syn match wikiWord /\<[A-Z][a-z]\+[A-Za-z]*[A-Z]\+[A-Za-z]*\>/ + +highlight link collapsibleSectionStart Delimiter +highlight link collapsibleSectionEnd Delimiter +highlight link bracesAndBrackets Delimiter +highlight link cellContents Macro +highlight link bang Delimiter +highlight link styledText Type +highlight link styledText2 Type +highlight link styledText3 Type +highlight link literalText Special +highlight link symbol Identifier +highlight link extractVariable Identifier +highlight link bold Constant +highlight link heading Constant +highlight link scenarioVariable Identifier +highlight link styleMarker Special +highlight link widget Statement +highlight link wikiWord Underlined +highlight link openCell Error + +let b:current_syntax = "fitnesse"