From f7dabac03a5799f4bc6b8a456964bae6de805c13 Mon Sep 17 00:00:00 2001 From: andre Date: Fri, 3 Apr 2009 11:01:32 +0000 Subject: [PATCH] Modified indentation for Python Added VCS plugin (CVS, SVN, git) Updated templating system Added option to process a ~/.vim/vimrc.local, after all other rc files --- vim/colors/ir_black.vim | 212 ++++++ vim/colors/manxome.vim | 47 ++ vim/colors/midnight2.vim | 102 +++ vim/colors/railscasts.vim | 96 +++ vim/doc/vcscommand.txt | 814 +++++++++++++++++++++++ vim/gvimrc | 11 +- vim/indent/python.vim | 355 +++++----- vim/indent/python_i.vim | 1 + vim/menu.vim.old | 982 +++++++++++++++++++++++++++ vim/plugin/skeleton.vim | 11 +- vim/plugin/vcscommand.vim | 1292 ++++++++++++++++++++++++++++++++++++ vim/plugin/vcscvs.vim | 441 ++++++++++++ vim/plugin/vcsgit.vim | 258 +++++++ vim/plugin/vcssvk.vim | 262 ++++++++ vim/plugin/vcssvn.vim | 288 ++++++++ vim/syntax/CVSAnnotate.vim | 45 ++ vim/syntax/SVKAnnotate.vim | 42 ++ vim/syntax/SVNAnnotate.vim | 40 ++ vim/syntax/python.vim | 4 +- vim/syntax/vcscommit.vim | 31 + vim/templates/skeleton.c | 5 +- vim/vimrc | 63 +- 22 files changed, 5189 insertions(+), 213 deletions(-) create mode 100644 vim/colors/ir_black.vim create mode 100644 vim/colors/manxome.vim create mode 100644 vim/colors/midnight2.vim create mode 100644 vim/colors/railscasts.vim create mode 100644 vim/doc/vcscommand.txt create mode 100644 vim/indent/python_i.vim create mode 100644 vim/menu.vim.old create mode 100644 vim/plugin/vcscommand.vim create mode 100644 vim/plugin/vcscvs.vim create mode 100644 vim/plugin/vcsgit.vim create mode 100644 vim/plugin/vcssvk.vim create mode 100644 vim/plugin/vcssvn.vim create mode 100644 vim/syntax/CVSAnnotate.vim create mode 100644 vim/syntax/SVKAnnotate.vim create mode 100644 vim/syntax/SVNAnnotate.vim create mode 100644 vim/syntax/vcscommit.vim diff --git a/vim/colors/ir_black.vim b/vim/colors/ir_black.vim new file mode 100644 index 0000000..2e151d8 --- /dev/null +++ b/vim/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/vim/colors/manxome.vim b/vim/colors/manxome.vim new file mode 100644 index 0000000..0db38ea --- /dev/null +++ b/vim/colors/manxome.vim @@ -0,0 +1,47 @@ +""" local syntax file - set colors on a per-machine basis: +""" Vim color file +""" Title: Manxome Foes Color Scheme +""" Maintainer: Ricardo SIGNES +""" This Version: R2v2 [2003-07-16] +""" suggested vim editing options: tw=0 ts=4 sw=4 + +"" clear and re-initialize global variables +hi clear +set background=dark +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "manxome" + +"" set highlight groups +"" you'll notice that the ctermbg is often 'none'; this is so that when +"" console vim runs in a terminal, transparency (if any) is not broken + +highlight Title ctermfg=3 ctermbg=none cterm=bold guifg=#ffff00 guibg=#000000 gui=none +highlight Directory ctermfg=4 ctermbg=none cterm=bold guifg=#0000ff guibg=#000000 gui=none +highlight StatusLine ctermfg=7 ctermbg=4 cterm=bold guifg=#ffffff guibg=#0000ff gui=none +highlight StatusLineNC ctermfg=0 ctermbg=4 cterm=bold guifg=#000000 guibg=#0000ff gui=none +highlight Normal ctermfg=7 ctermbg=none cterm=none guifg=#cccccc guibg=#000000 gui=none +highlight Search ctermfg=7 ctermbg=4 cterm=bold guifg=#ffffff guibg=#0000ff gui=none +highlight Visual ctermfg=7 ctermbg=6 cterm=bold guifg=#ffffff guibg=#00aaaa gui=none + +"" set major preferred groups + +highlight Comment ctermfg=2 ctermbg=none cterm=bold guifg=#00ff00 guibg=#000000 gui=none +highlight Constant ctermfg=6 ctermbg=none cterm=bold guifg=#00ffff guibg=#000000 gui=none +highlight Identifier ctermfg=4 ctermbg=none cterm=bold guifg=#0000ee guibg=#000000 gui=none +highlight Statement ctermfg=6 ctermbg=none cterm=none guifg=#00aaaa guibg=#000000 gui=none +highlight PreProc ctermfg=7 ctermbg=none cterm=bold guifg=#ffffff guibg=#000000 gui=none +highlight Type ctermfg=6 ctermbg=none cterm=none guifg=#00aaaa guibg=#000000 gui=none +highlight Special ctermfg=7 ctermbg=none cterm=bold guifg=#ffffff guibg=#000000 gui=none +highlight Underlined ctermfg=2 ctermbg=none cterm=none guifg=#00aa00 guibg=#000000 gui=none +highlight Ignore ctermfg=0 ctermbg=none cterm=bold guifg=#aaaaaa guibg=#000000 gui=none +highlight Error ctermfg=1 ctermbg=none cterm=bold guibg=#ff0000 guibg=#000000 gui=none +highlight Todo ctermfg=3 ctermbg=none cterm=none guifg=#aaaa00 guibg=#000000 gui=none + +" set syntax-specific groups +" I'd like to avoid using these, but the default settings for these two are +" just no good. Seeing italic text in Vim is just plain wrong. + +highlight htmlBold ctermfg=7 ctermbg=none cterm=bold guifg=#ffffff guibg=#000000 gui=none +highlight htmlItalic ctermfg=5 ctermbg=none cterm=bold guifg=#ff00ff guibg=#000000 gui=none diff --git a/vim/colors/midnight2.vim b/vim/colors/midnight2.vim new file mode 100644 index 0000000..51adeba --- /dev/null +++ b/vim/colors/midnight2.vim @@ -0,0 +1,102 @@ +" Vim color file +" Maintainer: Michael Brailsford +" Date: $Date: 2002/11/25 20:25:54 $ +" Version: $Revision: 1.1 $ +" Inspiration: This colorscheme was inspired by midnight.vim. It is a darker +" version of it. With some colors tweaked. +" +" Thanks: Thanks go to Hans Fugal for creating the colorscheme template. +" Without it I would have been lost creating the original midnight.vim +" Thanks to Mark Lodato for providing vim7 updates. +" +" Note: If you do not like the dark look of the colorscheme, you can +" easily lighten things up with the following line: +" :%s/\(\w\)3/\12/g +" It is easily pasteable into the command line. you can also +" change "\12" to "\11", "\1" or "\14" (if you want things even +" darker). If you do use the "\14" replacement, then it looks +" like your monitor in a fog bank. :) + +" your pick: +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name="midnight2" + +hi Normal guifg=slategray3 guibg=#000029 ctermfg=14 + +"Toggle semicolon matching at the end of lines +nmap ; :call ToggleSemicolonHighlighting() +"{{{ +function! ToggleSemicolonHighlighting() + if exists("b:semicolon") + unlet b:semicolon + hi semicolon guifg=NONE gui=NONE ctermfg=NONE + else + syn match semicolon #;$# + hi semicolon guifg=red3 gui=bold ctermfg=1 + let b:semicolon = 1 + endif +endfunction +"}}} + +hi Cursor guifg=bg guibg=fg ctermfg=0 ctermbg=11 +"hi CursorIM +hi Directory gui=bold +hi DiffAdd guifg=yellow3 guibg=darkgreen ctermbg=0 +"hi DiffChange +"hi DiffDelete green +"hi DiffText +hi ErrorMsg guibg=red3 ctermfg=1 +"hi VertSplit +hi Folded guibg=#00001a guifg=yellow3 ctermbg=4 ctermfg=11 gui=NONE +hi FoldColumn guibg=steelblue3 ctermbg=14 guifg=navyblue ctermfg=11 gui=bold +"hi SignColumn +"hi IncSearch +hi LineNr guifg=yellow3 ctermfg=3 +hi MatchParen guibg=navyblue gui=italic +hi ModeMsg guifg=yellow3 gui=bold ctermfg=3 +"hi MoreMsg( ) +"hi NonText +hi Pmenu guibg=steelblue3 guifg=bg ctermfg=7 ctermbg=4 cterm=bold +hi PmenuSel guibg=fg guifg=bg gui=bold ctermfg=4 ctermbg=7 cterm=bold +hi link PmenuSbar Pmenu +"hi PmenuThumb +"hi Question +hi Search guibg=yellow3 guifg=bg +"hi SpecialKey +"hi SpellBad +"hi SpellCap +"hi SpellLocal +"hi SpellRare +hi StatusLine guifg=steelblue3 +hi StatusLineNC guifg=steelblue4 +"hi TabLine +"hi TabLineFill +"hi TabLineSel +"hi Title +hi Visual guifg=bg guibg=fg +"hi VisualNOS +"hi WarningMsg +"hi WildMenu +"hi Menu +"hi Scrollbar +"hi Tooltip + +" syntax highlighting groups +hi Comment guifg=chartreuse3 ctermfg=10 +hi Constant guifg=plum3 gui=bold ctermfg=13 +hi String guifg=indianred3 ctermfg=5 +hi Character guifg=mediumpurple3 ctermfg=5 +hi Number guifg=turquoise3 ctermfg=5 +"hi Identifier +hi Statement guifg=khaki3 gui=bold ctermfg=15 cterm=underline +hi PreProc guifg=firebrick3 gui=italic ctermfg=9 +hi Type guifg=gold3 gui=bold ctermfg=3 +hi Special guifg=orange ctermfg=208 +hi Underlined ctermfg=white cterm=underline +"hi Ignore +"hi Error +hi Todo guifg=yellow3 guibg=blue3 gui=bold ctermfg=3 diff --git a/vim/colors/railscasts.vim b/vim/colors/railscasts.vim new file mode 100644 index 0000000..2055b41 --- /dev/null +++ b/vim/colors/railscasts.vim @@ -0,0 +1,96 @@ +" Vim color scheme +" +" Name: railscasts.vim +" Maintainer: Nick Moffitt +" Last Change: 01 Mar 2008 +" License: WTFPL +" Version: 2.1 +" +" This theme is based on Josh O'Rourke's Vim clone of the railscast +" textmate theme. The key thing I have done here is supply 256-color +" terminal equivalents for as many of the colors as possible, and fixed +" up some of the funny behaviors for editing e-mails and such. +" +" To use for gvim: +" 1: install this file as ~/.vim/colors/railscasts.vim +" 2: put "colorscheme railscasts" in your .gvimrc +" +" If you are using Ubuntu, you can get the benefit of this in your +" terminals using ordinary vim by taking the following steps: +" +" 1: sudo apt-get install ncurses-term +" 2: put the following in your .vimrc +" if $COLORTERM == 'gnome-terminal' +" set term=gnome-256color +" colorscheme railscasts +" else +" colorscheme default +" endif +" 3: if you wish to use this with screen, add the following to your .screenrc: +" attrcolor b ".I" +" termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm' +" defbce "on" +" term screen-256color-bce + +set background=dark +hi clear +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "railscasts" + +hi link htmlTag xmlTag +hi link htmlTagName xmlTagName +hi link htmlEndTag xmlEndTag + +highlight Normal guifg=#E6E1DC guibg=#111111 +highlight Cursor guifg=#000000 ctermfg=0 guibg=#FFFFFF ctermbg=15 +highlight CursorLine guibg=#000000 ctermbg=233 cterm=NONE + +highlight Comment guifg=#BC9458 ctermfg=180 gui=italic +highlight Constant guifg=#6D9CBE ctermfg=73 +highlight Define guifg=#CC7833 ctermfg=173 +highlight Error guifg=#FFC66D ctermfg=221 guibg=#990000 ctermbg=88 +highlight Function guifg=#FFC66D ctermfg=221 gui=NONE cterm=NONE +highlight Identifier guifg=#6D9CBE ctermfg=73 gui=NONE cterm=NONE +highlight Include guifg=#CC7833 ctermfg=173 gui=NONE cterm=NONE +highlight PreCondit guifg=#CC7833 ctermfg=173 gui=NONE cterm=NONE +highlight Keyword guifg=#CC7833 ctermfg=173 cterm=NONE +highlight LineNr guifg=#2B2B2B ctermfg=159 guibg=#C0C0FF +highlight Number guifg=#A5C261 ctermfg=107 +highlight PreProc guifg=#E6E1DC ctermfg=103 +highlight Search guifg=NONE ctermfg=NONE guibg=#2b2b2b ctermbg=235 gui=italic cterm=underline +highlight Statement guifg=#CC7833 ctermfg=173 gui=NONE cterm=NONE +highlight String guifg=#A5C261 ctermfg=107 +highlight Title guifg=#FFFFFF ctermfg=15 +highlight Type guifg=#DA4939 ctermfg=167 gui=NONE cterm=NONE +highlight Visual guibg=#5A647E ctermbg=60 + +highlight DiffAdd guifg=#E6E1DC ctermfg=7 guibg=#519F50 ctermbg=71 +highlight DiffDelete guifg=#E6E1DC ctermfg=7 guibg=#660000 ctermbg=52 +highlight Special guifg=#DA4939 ctermfg=167 + +highlight pythonBuiltin guifg=#6D9CBE ctermfg=73 gui=NONE cterm=NONE +highlight rubyBlockParameter guifg=#FFFFFF ctermfg=15 +highlight rubyClass guifg=#FFFFFF ctermfg=15 +highlight rubyConstant guifg=#DA4939 ctermfg=167 +highlight rubyInstanceVariable guifg=#D0D0FF ctermfg=189 +highlight rubyInterpolation guifg=#519F50 ctermfg=107 +highlight rubyLocalVariableOrMethod guifg=#D0D0FF ctermfg=189 +highlight rubyPredefinedConstant guifg=#DA4939 ctermfg=167 +highlight rubyPseudoVariable guifg=#FFC66D ctermfg=221 +highlight rubyStringDelimiter guifg=#A5C261 ctermfg=143 + +highlight xmlTag guifg=#E8BF6A ctermfg=179 +highlight xmlTagName guifg=#E8BF6A ctermfg=179 +highlight xmlEndTag guifg=#E8BF6A ctermfg=179 + +highlight mailSubject guifg=#A5C261 ctermfg=107 +highlight mailHeaderKey guifg=#FFC66D ctermfg=221 +highlight mailEmail guifg=#A5C261 ctermfg=107 gui=italic cterm=underline + +highlight SpellBad guifg=#D70000 ctermfg=160 ctermbg=NONE cterm=underline +highlight SpellRare guifg=#D75F87 ctermfg=168 guibg=NONE ctermbg=NONE gui=underline cterm=underline +highlight SpellCap guifg=#D0D0FF ctermfg=189 guibg=NONE ctermbg=NONE gui=underline cterm=underline +highlight MatchParen guifg=#FFFFFF ctermfg=15 guibg=#005f5f ctermbg=23 diff --git a/vim/doc/vcscommand.txt b/vim/doc/vcscommand.txt new file mode 100644 index 0000000..eaee014 --- /dev/null +++ b/vim/doc/vcscommand.txt @@ -0,0 +1,814 @@ +*vcscommand.txt* vcscommand +Copyright (c) 2007 Bob Hiestand + +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. + +For instructions on installing this file, type + :help add-local-help +inside Vim. + +Author: Bob Hiestand +Credits: Benji Fisher's excellent MatchIt documentation + +============================================================================== +1. Contents *vcscommand-contents* + + Installation : |vcscommand-install| + vcscommand Intro : |vcscommand| + vcscommand Manual : |vcscommand-manual| + Customization : |vcscommand-customize| + SSH "integration" : |vcscommand-ssh| + Changes from cvscommand : |cvscommand-changes| + Bugs : |vcscommand-bugs| + +============================================================================== + +2. vcscommand Installation *vcscommand-install* + +The vcscommand plugin comprises five files: vcscommand.vim, vcssvn.vim, +vcscvs.vim, vcssvk.vim and vcscommand.txt (this file). In order to install +the plugin, place the vcscommand.vim, vcssvn.vim, vcssvk.vim, and vcscvs.vim +files into a plugin directory in your runtime path (please see +|add-global-plugin| and |'runtimepath'|. + +This help file can be included in the VIM help system by copying it into a +'doc' directory in your runtime path and then executing the |:helptags| +command, specifying the full path of the 'doc' directory. Please see +|add-local-help| for more details. + +vcscommand may be customized by setting variables, creating maps, and +specifying event handlers. Please see |vcscommand-customize| for more +details. + +============================================================================== + +3. vcscommand Intro *vcscommand* + *vcscommand-intro* + +The vcscommand plugin provides global ex commands for manipulating +version-controlled source files, currently those controlled either by CVS or +Subversion. In general, each command operates on the current buffer and +accomplishes a separate source control function, such as update, commit, log, +and others (please see |vcscommand-commands| for a list of all available +commands). The results of each operation are displayed in a scratch buffer. +Several buffer variables are defined for those scratch buffers (please see +|vcscommand-buffer-variables|). + +The notion of "current file" means either the current buffer, or, in the case +of a directory buffer (such as Explorer or netrw buffers), the directory (and +all subdirectories) represented by the the buffer. + +For convenience, any vcscommand invoked on a vcscommand scratch buffer acts as +though it was invoked on the original file and splits the screen so that the +output appears in a new window. + +Many of the commands accept revisions as arguments. By default, most operate +on the most recent revision on the current branch if no revision is specified. + +Each vcscommand is mapped to a key sequence starting with the +keystroke. The default mappings may be overridden by supplying different +mappings before the plugin is loaded, such as in the vimrc, in the standard +fashion for plugin mappings. For examples, please see +|vcscommand-mappings-override|. + +The vcscommand plugin may be configured in several ways. For more details, +please see |vcscommand-customize|. + +============================================================================== + +4. vcscommand Manual *vcscommand-manual* + +4.1 vcscommand commands *vcscommand-commands* + +vcscommand defines the following commands: + +|:VCSAdd| +|:VCSAnnotate| +|:VCSBlame| +|:VCSCommit| +|:VCSDelete| +|:VCSDiff| +|:VCSGotoOriginal| +|:VCSLog| +|:VCSRemove| +|:VCSRevert| +|:VCSReview| +|:VCSStatus| +|:VCSUpdate| +|:VCSVimDiff| + +The following commands are specific to CVS files: + +|:CVSEdit| +|:CVSEditors| +|:CVSUnedit| +|:CVSWatch| +|:CVSWatchAdd| +|:CVSWatchOn| +|:CVSWatchOff| +|:CVSWatchRemove| +|:CVSWatchers| + +:VCSAdd *:VCSAdd* + +This command adds the current file to source control. Please note, this does +not commit the newly-added file. All parameters to the command are passed to +the underlying VCS. + +:VCSAnnotate *:VCSAnnotate* + +This command displays the current file with each line annotated with the +version in which it was most recently changed. If an argument is given, the +argument is used as a revision number to display. If not given an argument, +it uses the most recent version of the file (on the current branch, if under +CVS control). Additionally, if the current buffer is a VCSAnnotate buffer +already, the version number on the current line is used. + +For CVS buffers, the 'VCSCommandCVSAnnotateParent' option, if set to non-zero, +will cause the above behavior to change. Instead of annotating the version on +the current line, the parent revision is used instead, crossing branches if +necessary. + +The filetype of the vcscommand scratch buffer is set to one of 'CVSAnnotate', +'SVNAnnotate', or 'SVKAnnotate' as appropriate, to take advantage of the +bundled syntax files. + +:VCSBlame *:VCSBlame* + +Alias for |:VCSAnnotate|. + +:VCSCommit[!] *:VCSCommit* + +This command commits changes to the current file to source control. + +If called with arguments, the arguments are the log message. + +If '!' is used, an empty log message is committed. + +If called with no arguments, this is a two-step command. The first step opens +a buffer to accept a log message. When that buffer is written, it is +automatically closed and the file is committed using the information from that +log message. The commit can be abandoned if the log message buffer is deleted +or wiped before being written. + +Alternatively, the mapping that is used to invoke :VCSCommit (by default +cc) can be used in the log message buffer to immediately commit. This +is useful if the |VCSCommandCommitOnWrite| variable is set to 0 to disable the +normal commit-on-write behavior. + +:VCSDelete *:VCSDelete* + +Deletes the current file and removes it from source control. All parameters +to the command are passed to the underlying VCS. + +:VCSDiff *:VCSDiff* + +With no arguments, this displays the differences between the current file and +its parent version under source control in a new scratch buffer. + +With one argument, the diff is performed on the current file against the +specified revision. + +With two arguments, the diff is performed between the specified revisions of +the current file. + +For CVS, this command uses the |VCSCommandCVSDiffOpt| variable to specify diff +options. If that variable does not exist, a plugin-specific default is used. +If you wish to have no options, then set it to the empty string. + +For SVN, this command uses the |VCSCommandSVNDiffOpt| variable to specify diff +options. If that variable does not exist, the SVN default is used. +Additionally, |VCSCommandSVNDiffExt| can be used to select an external diff +application. + +:VCSGotoOriginal *:VCSGotoOriginal* + +This command jumps to the source buffer if the current buffer is a VCS scratch +buffer. + +:VCSGotoOriginal! + +Like ":VCSGotoOriginal" but also executes :bufwipeout on all VCS scrach +buffers associated with the original file. + +:VCSInfo *:VCSInfo* + +This command displays extended information about the current file in a new +scratch buffer. + +:VCSLock *:VCSLock* + +This command locks the current file in order to prevent other users from +concurrently modifying it. The exact semantics of this command depend on the +underlying VCS. This does nothing in CVS. All parameters are passed to the +underlying VCS. + +:VCSLog *:VCSLog* + +Displays the version history of the current file in a new scratch buffer. If +there is one parameter supplied, it is taken as as a revision parameters to be +passed through to the underlying VCS. Otherwise, all parameters are passed to +the underlying VCS. + +:VCSRemove *:VCSRemove* + +Alias for |:VCSDelete|. + +:VCSRevert *:VCSRevert* + +This command replaces the current file with the most recent version from the +repository in order to wipe out any undesired changes. + +:VCSReview *:VCSReview* + +Displays a particular version of the current file in a new scratch buffer. If +no argument is given, the most recent version of the file on the current +branch is retrieved. + +:VCSStatus *:VCSStatus* + +Displays versioning information about the current file in a new scratch +buffer. All parameters are passed to the underlying VCS. + + +:VCSUnlock *:VCSUnlock* + +Unlocks the current file in order to allow other users from concurrently +modifying it. The exact semantics of this command depend on the underlying +VCS. All parameters are passed to the underlying VCS. + +:VCSUpdate *:VCSUpdate* + +Updates the current file with any relevant changes from the repository. This +intentionally does not automatically reload the current buffer, though vim +should prompt the user to do so if the underlying file is altered by this +command. + +:VCSVimDiff *:VCSVimDiff* + +Uses vimdiff to display differences between versions of the current file. + +If no revision is specified, the most recent version of the file on the +current branch is used. With one argument, that argument is used as the +revision as above. With two arguments, the differences between the two +revisions is displayed using vimdiff. + +With either zero or one argument, the original buffer is used to perform the +vimdiff. When the scratch buffer is closed, the original buffer will be +returned to normal mode. + +Once vimdiff mode is started using the above methods, additional vimdiff +buffers may be added by passing a single version argument to the command. +There may be up to 4 vimdiff buffers total. + +Using the 2-argument form of the command resets the vimdiff to only those 2 +versions. Additionally, invoking the command on a different file will close +the previous vimdiff buffers. + +:CVSEdit *:CVSEdit* + +This command performs "cvs edit" on the current file. Yes, the output buffer +in this case is almost completely useless. + +:CVSEditors *:CVSEditors* + +This command performs "cvs edit" on the current file. + +:CVSUnedit *:CVSUnedit* + +Performs "cvs unedit" on the current file. Again, yes, the output buffer here +is basically useless. + +:CVSWatch *:CVSWatch* + +This command takes an argument which must be one of [on|off|add|remove]. The +command performs "cvs watch" with the given argument on the current file. + +:CVSWatchAdd *:CVSWatchAdd* + +This command is an alias for ":CVSWatch add" + +:CVSWatchOn *:CVSWatchOn* + +This command is an alias for ":CVSWatch on" + +:CVSWatchOff *:CVSWatchOff* + +This command is an alias for ":CVSWatch off" + +:CVSWatchRemove *:CVSWatchRemove* + +This command is an alias for ":CVSWatch remove" + +:CVSWatchers *:CVSWatchers* + +This command performs "cvs watchers" on the current file. + +4.2 Mappings *vcscommand-mappings* + +By default, a mapping is defined for each command. These mappings execute the +default (no-argument) form of each command. + +ca VCSAdd +cn VCSAnnotate +cc VCSCommit +cD VCSDelete +cd VCSDiff +cg VCSGotoOriginal +cG VCSGotoOriginal! +ci VCSInfo +cl VCSLog +cL VCSLock +cr VCSReview +cs VCSStatus +cu VCSUpdate +cU VCSUnlock +cv VCSVimDiff + +Only for CVS buffers: + +ce CVSEdit +cE CVSEditors +ct CVSUnedit +cwv CVSWatchers +cwa CVSWatchAdd +cwn CVSWatchOn +cwf CVSWatchOff +cwf CVSWatchRemove + + *vcscommand-mappings-override* + +The default mappings can be overridden by user-provided instead by mapping to +CommandName. This is especially useful when these mappings collide with +other existing mappings (vim will warn of this during plugin initialization, +but will not clobber the existing mappings). + +There are three methods for controlling mapping: + +First, maps can be overriden for individual commands. For instance, to +override the default mapping for :VCSAdd to set it to '\add', add the +following to the vimrc: + +nmap \add VCSAdd + +Second, the default map prefix ('c') can be overridden by defining the +|VCSCommandMapPrefix| variable. + +Third, the entire set of default maps can be overridden by defining the +|VCSCommandMappings| variable. + + +4.3 Automatic buffer variables *vcscommand-buffer-variables* + +Several buffer variables are defined in each vcscommand result buffer. These +may be useful for additional customization in callbacks defined in the event +handlers (please see |vcscommand-events|). + +The following variables are automatically defined: + +b:VCSCommandOriginalBuffer *b:VCSCommandOriginalBuffer* + +This variable is set to the buffer number of the source file. + +b:VCSCommandCommand *b:VCSCommandCommand* + +This variable is set to the name of the vcscommand that created the result +buffer. + +b:VCSCommandSourceFile *b:VCSCommandSourceFile* + +This variable is set to the name of the original file under source control. + +b:VCSCommandVCSType *b:VCSCommandVCSType* + +This variable is set to the type of the source control. This variable is also +set on the original file itself. +============================================================================== + +5. Configuration and customization *vcscommand-customize* + *vcscommand-config* + +The vcscommand plugin can be configured in several ways: by setting +configuration variables (see |vcscommand-options|) or by defining vcscommand +event handlers (see |vcscommand-events|). Additionally, the vcscommand plugin +supports a customized status line (see |vcscommand-statusline| and +|vcscommand-buffer-management|). + +5.1 vcscommand configuration variables *vcscommand-options* + +Several variables affect the plugin's behavior. These variables are checked +at time of execution, and may be defined at the window, buffer, or global +level and are checked in that order of precedence. + + +The following variables are available: + +|VCSCommandCommitOnWrite| +|VCSCommandCVSDiffOpt| +|VCSCommandCVSExec| +|VCSCommandDeleteOnHide| +|VCSCommandDiffSplit| +|VCSCommandDisableAll| +|VCSCommandDisableMappings| +|VCSCommandDisableExtensionMappings| +|VCSCommandEdit| +|VCSCommandEnableBufferSetup| +|VCSCommandMappings| +|VCSCommandMapPrefix| +|VCSCommandResultBufferNameExtension| +|VCSCommandResultBufferNameFunction| +|VCSCommandSplit| +|VCSCommandSVKExec| +|VCSCommandSVNDiffExt| +|VCSCommandSVNDiffOpt| +|VCSCommandSVNExec| +|VCSCommandVCSTypeOverride| + +VCSCommandCommitOnWrite *VCSCommandCommitOnWrite* + +This variable, if set to a non-zero value, causes the pending commit +to take place immediately as soon as the log message buffer is written. +If set to zero, only the VCSCommit mapping will cause the pending commit to +occur. If not set, it defaults to 1. + +VCSCommandCVSExec *VCSCommandCVSExec* + +This variable controls the executable used for all CVS commands If not set, +it defaults to "cvs". + +VCSCommandDeleteOnHide *VCSCommandDeleteOnHide* + +This variable, if set to a non-zero value, causes the temporary result buffers +to automatically delete themselves when hidden. + +VCSCommandCVSDiffOpt *VCSCommandCVSDiffOpt* + +This variable, if set, determines the options passed to the diff command of +CVS. If not set, it defaults to 'u'. + +VCSCommandDiffSplit *VCSCommandDiffSplit* + +This variable overrides the |VCSCommandSplit| variable, but only for buffers +created with |:VCSVimDiff|. + +VCSCommandDisableAll *VCSCommandDisableAll* + +This variable, if set, prevents the plugin or any extensions from loading at +all. This is useful when a single runtime distribution is used on multiple +systems with varying versions. + +VCSCommandDisableMappings *VCSCommandDisableMappings* + +This variable, if set to a non-zero value, prevents the default command +mappings from being set. This supercedes +|VCSCommandDisableExtensionMappings|. + +VCSCommandDisableExtensionMappings *VCSCommandDisableExtensionMappings* + +This variable, if set to a non-zero value, prevents the default command +mappings from being set for commands specific to an individual VCS. + +VCSCommandEdit *VCSCommandEdit* + +This variable controls whether the original buffer is replaced ('edit') or +split ('split'). If not set, it defaults to 'split'. + +VCSCommandEnableBufferSetup *VCSCommandEnableBufferSetup* + +This variable, if set to a non-zero value, activates VCS buffer management +mode see (|vcscommand-buffer-management|). This mode means that the +'VCSCommandBufferInfo' variable is filled with version information if the file +is VCS-controlled. This is useful for displaying version information in the +status bar. + +VCSCommandMappings *VCSCommandMappings* + +This variable, if set, overrides the default mappings used for shortcuts. It +should be a List of 2-element Lists, each containing a shortcut and function +name pair. The value of the '|VCSCommandMapPrefix|' variable will be added to +each shortcut. + +VCSCommandMapPrefix *VCSCommandMapPrefix* + +This variable, if set, overrides the default mapping prefix ('c'). +This allows customization of the mapping space used by the vcscommand +shortcuts. + +VCSCommandResultBufferNameExtension *VCSCommandResultBufferNameExtension* + +This variable, if set to a non-blank value, is appended to the name of the VCS +command output buffers. For example, '.vcs'. Using this option may help +avoid problems caused by autocommands dependent on file extension. + +VCSCommandResultBufferNameFunction *VCSCommandResultBufferNameFunction* + +This variable, if set, specifies a custom function for naming VCS command +output buffers. This function is expected to return the new buffer name, and +will be passed the following arguments: + + command - name of the VCS command being executed (such as 'Log' or + 'Diff'). + + originalBuffer - buffer number of the source file. + + vcsType - type of VCS controlling this file (such as 'CVS' or 'SVN'). + + statusText - extra text associated with the VCS action (such as version + numbers). + +VCSCommandSplit *VCSCommandSplit* + +This variable controls the orientation of the various window splits that +may occur. + +If set to 'horizontal', the resulting windows will be on stacked on top of +one another. If set to 'vertical', the resulting windows will be +side-by-side. If not set, it defaults to 'horizontal' for all but +VCSVimDiff windows. VCSVimDiff windows default to the user's 'diffopt' +setting, if set, otherwise 'vertical'. + +VCSCommandSVKExec *VCSCommandSVKExec* + +This variable controls the executable used for all SVK commands If not set, +it defaults to "svk". + +VCSCommandSVNDiffExt *VCSCommandSVNDiffExt* + +This variable, if set, is passed to SVN via the --diff-cmd command to select +an external application for performing the diff. + +VCSCommandSVNDiffOpt *VCSCommandSVNDiffOpt* + +This variable, if set, determines the options passed with the '-x' parameter +to the SVN diff command. If not set, no options are passed. + +VCSCommandSVNExec *VCSCommandSVNExec* + +This variable controls the executable used for all SVN commands If not set, +it defaults to "svn". + +VCSCommandVCSTypeOverride *VCSCommandVCSTypeOverride* + +This variable allows the VCS type detection to be overridden on a path-by-path +basis. The value of this variable is expected to be a List of Lists. Each +item in the high-level List is a List containing two elements. The first +element is a regular expression that will be matched against the full file +name of a given buffer. If it matches, the second element will be used as the +VCS type. + +5.2 VCSCommand events *vcscommand-events* + +For additional customization, vcscommand can trigger user-defined events. +Event handlers are provided by defining User event autocommands (see +|autocommand|, |User|) in the vcscommand group with patterns matching the +event name. + +For instance, the following could be added to the vimrc to provide a 'q' +mapping to quit a vcscommand scratch buffer: + +augroup VCSCommand + au User VCSBufferCreated silent! nmap q: bwipeout +augroup END + +The following hooks are available: + +VCSBufferCreated This event is fired just after a vcscommand + result buffer is created and populated. It is + executed within the context of the vcscommand + buffer. The vcscommand buffer variables may + be useful for handlers of this event (please + see |vcscommand-buffer-variables|). + +VCSBufferSetup This event is fired just after vcscommand buffer + setup occurs, if enabled. + +VCSPluginInit This event is fired when the vcscommand plugin + first loads. + +VCSPluginFinish This event is fired just after the vcscommand + plugin loads. + +VCSVimDiffFinish This event is fired just after the VCSVimDiff + command executes to allow customization of, + for instance, window placement and focus. + +Additionally, there is another hook which is used internally to handle loading +the multiple scripts in order. This hook should probably not be used by an +end user without a good idea of how it works. Among other things, any events +associated with this hook are cleared after they are executed (during +vcscommand.vim script initialization). + +VCSLoadExtensions This event is fired just before the + VCSPluginFinish. It is used internally to + execute any commands from the VCS + implementation plugins that needs to be + deferred until the primary plugin is + initialized. + +5.3 vcscommand buffer naming *vcscommand-naming* + +vcscommand result buffers use the following naming convention: +[{VCS type} {VCS command} {Source file name}] + +If additional buffers are created that would otherwise conflict, a +distinguishing number is added: + +[{VCS type} {VCS command} {Source file name}] (1,2, etc) + +5.4 vcscommand status line support *vcscommand-statusline* + +It is intended that the user will customize the |'statusline'| option to +include vcscommand result buffer attributes. A sample function that may be +used in the |'statusline'| option is provided by the plugin, +VCSCommandGetStatusLine(). In order to use that function in the status line, do +something like the following: + +set statusline=%<%f\ %{VCSCommandGetStatusLine()}\ %h%m%r%=%l,%c%V\ %P + +of which %{VCSCommandGetStatusLine()} is the relevant portion. + +The sample VCSCommandGetStatusLine() function handles both vcscommand result +buffers and VCS-managed files if vcscommand buffer management is enabled +(please see |vcscommand-buffer-management|). + +5.5 vcscommand buffer management *vcscommand-buffer-management* + +The vcscommand plugin can operate in buffer management mode, which means that +it attempts to set a buffer variable ('VCSCommandBufferInfo') upon entry into +a buffer. This is rather slow because it means that the VCS will be invoked +at each entry into a buffer (during the |BufEnter| autocommand). + +This mode is disabled by default. In order to enable it, set the +|VCSCommandEnableBufferSetup| variable to a true (non-zero) value. Enabling +this mode simply provides the buffer variable mentioned above. The user must +explicitly include information from the variable in the |'statusline'| option +if they are to appear in the status line (but see |vcscommand-statusline| for +a simple way to do that). + +The 'VCSCommandBufferInfo' variable is a list which contains, in order, the +revision of the current file, the latest revision of the file in the +repository, and (for CVS) the name of the branch. If those values cannot be +determined, the list is a single element: 'Unknown'. + +============================================================================== + +6. SSH "integration" *vcscommand-ssh* + +The following instructions are intended for use in integrating the +vcscommand.vim plugin with an SSH-based CVS environment. + +Familiarity with SSH and CVS are assumed. + +These instructions assume that the intent is to have a message box pop up in +order to allow the user to enter a passphrase. If, instead, the user is +comfortable using certificate-based authentication, then only instructions +6.1.1 and 6.1.2 (and optionally 6.1.4) need to be followed; ssh should then +work transparently. + +6.1 Environment settings *vcscommand-ssh-env* + +6.1.1 CVSROOT should be set to something like: + + :ext:user@host:/path_to_repository + +6.1.2 CVS_RSH should be set to: + + ssh + + Together, those settings tell CVS to use ssh as the transport when + performing CVS calls. + +6.1.3 SSH_ASKPASS should be set to the password-dialog program. In my case, + running gnome, it's set to: + + /usr/libexec/openssh/gnome-ssh-askpass + + This tells SSH how to get passwords if no input is available. + +6.1.4 OPTIONAL. You may need to set SSH_SERVER to the location of the cvs + executable on the remote (server) machine. + +6.2 CVS wrapper program *vcscommand-ssh-wrapper* + +Now you need to convince SSH to use the password-dialog program. This means +you need to execute SSH (and therefore CVS) without standard input. The +following script is a simple perl wrapper that dissasociates the CVS command +from the current terminal. Specific steps to do this may vary from system to +system; the following example works for me on linux. + +#!/usr/bin/perl -w +use strict; +use POSIX qw(setsid); +open STDIN, '/dev/null'; +fork and do {wait; exit;}; +setsid; +exec('cvs', @ARGV); + +6.3 Configuring vcscommand.vim *vcscommand-ssh-config* + +At this point, you should be able to use your wrapper script to invoke CVS with +various commands, and get the password dialog. All that's left is to make CVS +use your newly-created wrapper script. + +6.3.1 Tell vcscommand.vim what CVS executable to use. The easiest way to do this + is globally, by putting the following in your .vimrc: + + let VCSCommandCVSExec=/path/to/cvs/wrapper/script + +6.4 Where to go from here *vcscommand-ssh-other* + +The script given above works even when non-SSH CVS connections are used, +except possibly when interactively entering the message for CVS commit log +(depending on the editor you use... VIM works fine). Since the vcscommand.vim +plugin handles that message without a terminal, the wrapper script can be used +all the time. + +This allows mixed-mode operation, where some work is done with SSH-based CVS +repositories, and others with pserver or local access. + +It is possible, though beyond the scope of the plugin, to dynamically set the +CVS executable based on the CVSROOT for the file being edited. The user +events provided (such as VCSBufferCreated and VCSBufferSetup) can be used to +set a buffer-local value (b:VCSCommandCVSExec) to override the CVS executable +on a file-by-file basis. Alternatively, much the same can be done (less +automatically) by the various project-oriented plugins out there. + +It is highly recommended for ease-of-use that certificates with no passphrase +or ssh-agent are employed so that the user is not given the password prompt +too often. + +============================================================================== + +7. Changes from cvscommand *cvscommand-changes* + +1. Require Vim 7 in order to leverage several convenient features; also +because I wanted to play with Vim 7. + +2. Renamed commands to start with 'VCS' instead of 'CVS'. The exceptions are +the 'CVSEdit' and 'CVSWatch' family of commands, which are specific to CVS. + +3. Renamed options, events to start with 'VCSCommand'. + +4. Removed option to jump to the parent version of the current line in an +annotated buffer, as opposed to the version on the current line. This made +little sense in the branching scheme used by subversion, where jumping to a +parent branch required finding a different location in the repository. It +didn't work consistently in CVS anyway. + +5. Removed option to have nameless scratch buffers. + +6. Changed default behavior of scratch buffers to split the window instead of +displaying in the current window. This may still be overridden using the +'VCSCommandEdit' option. + +7. Split plugin into multiple plugins. + +8. Added 'VCSLock' and 'VCSUnlock' commands. These are implemented for +subversion but not for CVS. These were not kept specific to subversion as they +seemed more general in nature and more likely to be supported by any future VCS +supported by this plugin. + +9. Changed name of buffer variables set by commands. + +'b:cvsOrigBuffNR' became 'b:VCSCommandOriginalBuffer' +'b:cvscmd' became 'b:VCSCommandCommand' + +10. Added new automatic variables to command result buffers. + +'b:VCSCommandSourceFile' +'b:VCSCommandVCSType' + +============================================================================== + +8. Known bugs *vcscommand-bugs* + +Please let me know if you run across any. + +CVSUnedit may, if a file is changed from the repository, provide prompt text +to determine whether the changes should be thrown away. Currently, that text +shows up in the CVS result buffer as information; there is no way for the user +to actually respond to the prompt and the CVS unedit command does nothing. If +this really bothers anyone, please let me know. + +VCSVimDiff, when using the original (real) source buffer as one of the diff +buffers, uses some hacks to try to restore the state of the original buffer +when the scratch buffer containing the other version is destroyed. There may +still be bugs in here, depending on many configuration details. + +vim:tw=78:ts=8:ft=help diff --git a/vim/gvimrc b/vim/gvimrc index 57958c5..ce5c981 100644 --- a/vim/gvimrc +++ b/vim/gvimrc @@ -4,10 +4,9 @@ " $Id$ set guifont=Monaco:h13 set anti -set lines=65 -set columns=150 -set nomousefocus -set ruler +set lines=50 +set columns=132 +set mousefocus set errorbells set visualbell set showtabline=2 @@ -28,3 +27,7 @@ endif "colorscheme desert "colorscheme macvim colorscheme inkpot + +" Emacs like indenting. Pressing Tab indents line +" set indentkeys=0{,0},0),:,0#,!^F,o,O,e,!,!^F +" set cinkeys=0{,0},0),:,0#,!^F,o,O,e,!,!^F diff --git a/vim/indent/python.vim b/vim/indent/python.vim index 32c773c..8843179 100644 --- a/vim/indent/python.vim +++ b/vim/indent/python.vim @@ -1,196 +1,193 @@ -" Python indent file -" Language: Python -" Maintainer: Eric Mc Sween -" Original Author: David Bustos -" Last Change: 2004 Jun 07 +" Vim indent file +" Language: Python +" Maintainer: Bram Moolenaar +" Original Author: David Bustos +" Last Change: 2006 Jun 18 " Only load this indent file when no other was loaded. if exists("b:did_indent") - finish + finish endif let b:did_indent = 1 -setlocal expandtab -setlocal nolisp -setlocal autoindent +" Some preliminary settings +setlocal nolisp " Make sure lisp indenting doesn't supersede us +setlocal autoindent " indentexpr isn't much help otherwise + setlocal indentexpr=GetPythonIndent(v:lnum) -setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif,=except +setlocal indentkeys+=<:>,=elif,=except,0# -let s:maxoff = 50 +" Only define the function once. +if exists("*GetPythonIndent") + finish +endif -" Find backwards the closest open parenthesis/bracket/brace. -function! s:SearchParensPair() - let line = line('.') - let col = col('.') - - " Skip strings and comments and don't look too far - let skip = "line('.') < " . (line - s:maxoff) . " ? dummy :" . - \ 'synIDattr(synID(line("."), col("."), 0), "name") =~? ' . - \ '"string\\|comment"' +" Come here when loading the script the first time. - " Search for parentheses - call cursor(line, col) - let parlnum = searchpair('(', '', ')', 'bW', skip) - let parcol = col('.') +let s:maxoff = 50 " maximum number of lines to look backwards for () - " Search for brackets - call cursor(line, col) - let par2lnum = searchpair('\[', '', '\]', 'bW', skip) - let par2col = col('.') +function GetPythonIndent(lnum) - " Search for braces - call cursor(line, col) - let par3lnum = searchpair('{', '', '}', 'bW', skip) - let par3col = col('.') - - " Get the closest match - if par2lnum > parlnum || (par2lnum == parlnum && par2col > parcol) - let parlnum = par2lnum - let parcol = par2col + " If this line is explicitly joined: If the previous line was also joined, + " line it up with that one, otherwise add two 'shiftwidth' + if getline(a:lnum - 1) =~ '\\$' + if a:lnum > 1 && getline(a:lnum - 2) =~ '\\$' + return indent(a:lnum - 1) endif - if par3lnum > parlnum || (par3lnum == parlnum && par3col > parcol) - let parlnum = par3lnum - let parcol = par3col - endif + return indent(a:lnum - 1) + (exists("g:pyindent_continue") ? eval(g:pyindent_continue) : (&sw * 2)) + endif - " Put the cursor on the match - if parlnum > 0 - call cursor(parlnum, parcol) - endif - return parlnum -endfunction - -" Find the start of a multi-line statement -function! s:StatementStart(lnum) - let lnum = a:lnum - while 1 - if getline(lnum - 1) =~ '\\$' - let lnum = lnum - 1 - else - call cursor(lnum, 1) - let maybe_lnum = s:SearchParensPair() - if maybe_lnum < 1 - return lnum - else - let lnum = maybe_lnum - endif - endif - endwhile -endfunction - -" Find the block starter that matches the current line -function! s:BlockStarter(lnum, block_start_re) - let lnum = a:lnum - let maxindent = 10000 " whatever - while lnum > 1 - let lnum = prevnonblank(lnum - 1) - if indent(lnum) < maxindent - if getline(lnum) =~ a:block_start_re - return lnum - else - let maxindent = indent(lnum) - " It's not worth going further if we reached the top level - if maxindent == 0 - return -1 - endif - endif - endif - endwhile + " If the start of the line is in a string don't change the indent. + if has('syntax_items') + \ && synIDattr(synID(a:lnum, 1, 1), "name") =~ "String$" return -1 + endif + + " Search backwards for the previous non-empty line. + let plnum = prevnonblank(v:lnum - 1) + + if plnum == 0 + " This is the first non-empty line, use zero indent. + return 0 + endif + + " If the previous line is inside parenthesis, use the indent of the starting + " line. + " Trick: use the non-existing "dummy" variable to break out of the loop when + " going too far back. + call cursor(plnum, 1) + let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW', + \ "line('.') < " . (plnum - s:maxoff) . " ? dummy :" + \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" + \ . " =~ '\\(Comment\\|String\\)$'") + if parlnum > 0 + let plindent = indent(parlnum) + let plnumstart = parlnum + else + let plindent = indent(plnum) + let plnumstart = plnum + endif + + + " When inside parenthesis: If at the first line below the parenthesis add + " two 'shiftwidth', otherwise same as previous line. + " i = (a + " + b + " + c) + call cursor(a:lnum, 1) + let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', + \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" + \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" + \ . " =~ '\\(Comment\\|String\\)$'") + if p > 0 + if p == plnum + " When the start is inside parenthesis, only indent one 'shiftwidth'. + let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', + \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" + \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" + \ . " =~ '\\(Comment\\|String\\)$'") + if pp > 0 + return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : &sw) + endif + return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : (&sw * 2)) + endif + if plnumstart == p + return indent(plnum) + endif + return plindent + endif + + + " Get the line and remove a trailing comment. + " Use syntax highlighting attributes when possible. + let pline = getline(plnum) + let pline_len = strlen(pline) + if has('syntax_items') + " If the last character in the line is a comment, do a binary search for + " the start of the comment. synID() is slow, a linear search would take + " too long on a long line. + if synIDattr(synID(plnum, pline_len, 1), "name") =~ "Comment$" + let min = 1 + let max = pline_len + while min < max + let col = (min + max) / 2 + if synIDattr(synID(plnum, col, 1), "name") =~ "Comment$" + let max = col + else + let min = col + 1 + endif + endwhile + let pline = strpart(pline, 0, min - 1) + endif + else + let col = 0 + while col < pline_len + if pline[col] == '#' + let pline = strpart(pline, 0, col) + break + endif + let col = col + 1 + endwhile + endif + + " If the previous line ended with a colon, indent this line + if pline =~ ':\s*$' + return plindent + &sw + endif + + " If the previous line was a stop-execution statement... + if getline(plnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>' + " See if the user has already dedented + if indent(a:lnum) > indent(plnum) - &sw + " If not, recommend one dedent + return indent(plnum) - &sw + endif + " Otherwise, trust the user + return -1 + endif + + " If the current line begins with a keyword that lines up with "try" + if getline(a:lnum) =~ '^\s*\(except\|finally\)\>' + let lnum = a:lnum - 1 + while lnum >= 1 + if getline(lnum) =~ '^\s*\(try\|except\)\>' + let ind = indent(lnum) + if ind >= indent(a:lnum) + return -1 " indent is already less than this + endif + return ind " line up with previous try or except + endif + let lnum = lnum - 1 + endwhile + return -1 " no matching "try"! + endif + + " If the current line begins with a header keyword, dedent + if getline(a:lnum) =~ '^\s*\(elif\|else\)\>' + + " Unless the previous line was a one-liner + if getline(plnumstart) =~ '^\s*\(for\|if\|try\)\>' + return plindent + endif + + " Or the user has already dedented + if indent(a:lnum) <= plindent - &sw + return -1 + endif + + return plindent - &sw + endif + + " When after a () construct we probably want to go back to the start line. + " a = (b + " + c) + " here + if parlnum > 0 + return plindent + endif + + return -1 + endfunction - -function! GetPythonIndent(lnum) - " First line has indent 0 - if a:lnum == 1 - return 0 - endif - - " If we can find an open parenthesis/bracket/brace, line up with it. - call cursor(a:lnum, 1) - let parlnum = s:SearchParensPair() - if parlnum > 0 - let parcol = col('.') - let closing_paren = match(getline(a:lnum), '^\s*[])}]') != -1 - if match(getline(parlnum), '[([{]\s*$', parcol - 1) != -1 - if closing_paren - return indent(parlnum) - else - return indent(parlnum) + &shiftwidth - endif - else - if closing_paren - return parcol - 1 - else - return parcol - endif - endif - endif - - " Examine this line - let thisline = getline(a:lnum) - let thisindent = indent(a:lnum) - - " If the line starts with 'elif' or 'else', line up with 'if' or 'elif' - if thisline =~ '^\s*\(elif\|else\)\>' - let bslnum = s:BlockStarter(a:lnum, '^\s*\(if\|elif\)\>') - if bslnum > 0 - return indent(bslnum) - else - return -1 - endif - endif - - " If the line starts with 'except' or 'finally', line up with 'try' - " or 'except' - if thisline =~ '^\s*\(except\|finally\)\>' - let bslnum = s:BlockStarter(a:lnum, '^\s*\(try\|except\)\>') - if bslnum > 0 - return indent(bslnum) - else - return -1 - endif - endif - - " Examine previous line - let plnum = a:lnum - 1 - let pline = getline(plnum) - let sslnum = s:StatementStart(plnum) - - " If the previous line is blank, keep the same indentation - if pline =~ '^\s*$' - return -1 - endif - - " If this line is explicitly joined, try to find an indentation that looks - " good. - if pline =~ '\\$' - let compound_statement = '^\s*\(if\|while\|for\s.*\sin\|except\)\s*' - let maybe_indent = matchend(getline(sslnum), compound_statement) - if maybe_indent != -1 - return maybe_indent - else - return indent(sslnum) + &sw * 2 - endif - endif - - " If the previous line ended with a colon, indent relative to - " statement start. - if pline =~ ':\s*$' - return indent(sslnum) + &sw - endif - - " If the previous line was a stop-execution statement or a pass - if getline(sslnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>' - " See if the user has already dedented - if indent(a:lnum) > indent(sslnum) - &sw - " If not, recommend one dedent - return indent(sslnum) - &sw - endif - " Otherwise, trust the user - return -1 - endif - - " In all other cases, line up with the start of the previous statement. - return indent(sslnum) -endfunction +" vim:sw=2 diff --git a/vim/indent/python_i.vim b/vim/indent/python_i.vim new file mode 100644 index 0000000..a2969d6 --- /dev/null +++ b/vim/indent/python_i.vim @@ -0,0 +1 @@ +setlocal indentkeys+=0# diff --git a/vim/menu.vim.old b/vim/menu.vim.old new file mode 100644 index 0000000..65dcb93 --- /dev/null +++ b/vim/menu.vim.old @@ -0,0 +1,982 @@ +" Vim support file to define the default menus +" You can also use this as a start for your own set of menus. +" +" Maintainer: Bram Moolenaar +" Last Change: 2004 May 26 + +" Note that ":an" (short for ":anoremenu") is often used to make a menu work +" in all modes and avoid side effects from mappings defined by the user. + +" Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise +" would not be recognized. See ":help 'cpoptions'". +let s:cpo_save = &cpo +set cpo&vim + +" Avoid installing the menus twice +if !exists("did_install_default_menus") +let did_install_default_menus = 1 + + +if exists("v:lang") || &langmenu != "" + " Try to find a menu translation file for the current language. + if &langmenu != "" + if &langmenu =~ "none" + let s:lang = "" + else + let s:lang = &langmenu + endif + else + let s:lang = v:lang + endif + " A language name must be at least two characters, don't accept "C" + if strlen(s:lang) > 1 + " When the language does not include the charset add 'encoding' + if s:lang =~ '^\a\a$\|^\a\a_\a\a$' + let s:lang = s:lang . '.' . &enc + endif + + " We always use a lowercase name. + " Change "iso-8859" to "iso_8859" and "iso8859" to "iso_8859", some + " systems appear to use this. + " Change spaces to underscores. + let s:lang = substitute(tolower(s:lang), '\.iso-', ".iso_", "") + let s:lang = substitute(s:lang, '\.iso8859', ".iso_8859", "") + let s:lang = substitute(s:lang, " ", "_", "g") + " Remove "@euro", otherwise "LC_ALL=de_DE@euro gvim" will show English menus + let s:lang = substitute(s:lang, "@euro", "", "") + " Change "iso_8859-1" and "iso_8859-15" to "latin1", we always use the + " same menu file for them. + let s:lang = substitute(s:lang, 'iso_8859-15\=$', "latin1", "") + menutrans clear + exe "runtime! lang/menu_" . s:lang . ".vim" + + if !exists("did_menu_trans") + " There is no exact match, try matching with a wildcard added + " (e.g. find menu_de_de.iso_8859-1.vim if s:lang == de_DE). + let s:lang = substitute(s:lang, '\.[^.]*', "", "") + exe "runtime! lang/menu_" . s:lang . "*.vim" + + if !exists("did_menu_trans") && strlen($LANG) > 1 + " On windows locale names are complicated, try using $LANG, it might + " have been set by set_init_1(). + exe "runtime! lang/menu_" . tolower($LANG) . "*.vim" + endif + endif + endif +endif + + +" Help menu +an 9999.10 &Help.&Overview :help +an 9999.20 &Help.&User\ Manual :help usr_toc +an 9999.30 &Help.&How-to\ links :help how-to +an 9999.40 &Help.&Find\.\.\. :call Helpfind() +an 9999.45 &Help.-sep1- +an 9999.50 &Help.&Credits :help credits +an 9999.60 &Help.Co&pying :help copying +an 9999.70 &Help.&Sponsor/Register :help sponsor +an 9999.70 &Help.O&rphans :help kcc +an 9999.75 &Help.-sep2- +an 9999.80 &Help.&Version :version +an 9999.90 &Help.&About :intro + +fun! s:Helpfind() + if !exists("g:menutrans_help_dialog") + let g:menutrans_help_dialog = "Enter a command or word to find help on:\n\nPrepend i_ for Input mode commands (e.g.: i_CTRL-X)\nPrepend c_ for command-line editing commands (e.g.: c_)\nPrepend ' for an option name (e.g.: 'shiftwidth')" + endif + let h = inputdialog(g:menutrans_help_dialog) + if h != "" + let v:errmsg = "" + silent! exe "help " . h + if v:errmsg != "" + echo v:errmsg + endif + endif +endfun + +" File menu +an 10.310 &File.&Open\.\.\.:e :browse confirm e +an 10.320 &File.Sp&lit-Open\.\.\.:sp :browse sp +an 10.325 &File.&New:enew :confirm enew +an 10.330 &File.&Close:close + \ :if winheight(2) < 0 + \ confirm enew + \ else + \ confirm close + \ endif +an 10.335 &File.-SEP1- +an 10.340 &File.&Save:w :if expand("%") == ""browse confirm welseconfirm wendif +an 10.350 &File.Save\ &As\.\.\.:sav :browse confirm saveas + +if has("diff") + an 10.400 &File.-SEP2- + an 10.410 &File.Split\ &Diff\ with\.\.\. :browse vert diffsplit + an 10.420 &File.Split\ Patched\ &By\.\.\. :browse vert diffpatch +endif + +if has("printer") + an 10.500 &File.-SEP3- + an 10.510 &File.&Print :hardcopy + vunmenu &File.&Print + vnoremenu &File.&Print :hardcopy + an 10.520 &File.-SEP3- + an 10.530 &File.&ToPDF :call ToPDF() + vunmenu &File.&ToPDF + vnoremenu &File.&ToPDF :call ToPDF() +elseif has("unix") + an 10.500 &File.-SEP3- + an 10.510 &File.&Print :w !lpr + vunmenu &File.&Print + vnoremenu &File.&Print :w !lpr + an 10.520 &File.-SEP3- + an 10.530 &File.&ToPDF :call ToPDF() + vunmenu &File.&ToPDF + vnoremenu &File.&ToPDF :call ToPDF() +endif +an 10.600 &File.-SEP4- +an 10.610 &File.Sa&ve-Exit:wqa :confirm wqa +an 10.620 &File.E&xit:qa :confirm qa + +" Pasting blockwise and linewise selections is not possible in Insert and +" Visual mode without the +virtualedit feature. They are pasted as if they +" were characterwise instead. Add to that some tricks to leave the cursor in +" the right position, also for "gi". +" Note: the same stuff appears in mswin.vim. +if has("virtualedit") + nnoremap