From 45daf726c92f69a7d0ea9c17bfc5ff9202ec3350 Mon Sep 17 00:00:00 2001 From: Richard Harding Date: Tue, 13 Oct 2009 13:36:36 -0400 Subject: [PATCH] * updates to the vim config, updated tComment, bufexplorer, etc --- vim/.VimballRecord | 1 + vim/autoload/tcomment.vim | 35 +- vim/colors/darkdevel.vim | 6 +- vim/colors/darkspectrum.vim | 1 + vim/colors/lucius.vim | 244 +++++++---- vim/doc/tags | 50 --- vim/plugin/bufexplorer.vim | 2 +- vim/plugin/lusty-juggler.vim | 749 +++++++++++++++++++++++++++++++++ vim/plugin/php-codesniffer.vim | 1 + vim/plugin/tComment.vim | 13 +- vim/snippets/php.snippets | 13 +- vimrc | 48 ++- 12 files changed, 1004 insertions(+), 159 deletions(-) create mode 100644 vim/plugin/lusty-juggler.vim create mode 100644 vim/plugin/php-codesniffer.vim diff --git a/vim/.VimballRecord b/vim/.VimballRecord index 703b19d..09398f8 100644 --- a/vim/.VimballRecord +++ b/vim/.VimballRecord @@ -2,3 +2,4 @@ snippy_plugin.vba: call delete('/home/rharding/.vim/plugin/snippetsEmu.vim')|cal tComment.vba: call delete('/home/rharding/.vim/doc/tComment.txt')|call delete('/home/rharding/.vim/plugin/tComment.vim')|call delete('/home/rharding/.vim/autoload/tcomment.vim') toggle_unit_tests.vba: call delete('/home/rharding/.vim/plugin/toggle_unit_tests.vim')|call delete('/home/rharding/.vim/doc/toggle_unit_tests.txt') twitvim-0.4.1.vba: call delete('/home/rharding/.vim/plugin/twitvim.vim')|call delete('/home/rharding/.vim/doc/twitvim.txt') +tComment.vba: call delete('/home/rharding/.vim/doc/tComment.txt')|call delete('/home/rharding/.vim/plugin/tComment.vim')|call delete('/home/rharding/.vim/autoload/tcomment.vim') diff --git a/vim/autoload/tcomment.vim b/vim/autoload/tcomment.vim index 3fbe817..75ac268 100644 --- a/vim/autoload/tcomment.vim +++ b/vim/autoload/tcomment.vim @@ -1,10 +1,10 @@ " tcomment.vim -" @Author: Thomas Link (mailto:micathom AT gmail com?subject=[vim]) +" @Author: Tom Link (mailto:micathom AT gmail com?subject=[vim]) " @Website: http://www.vim.org/account/profile.php?user_id=4037 " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 2007-09-17. -" @Last Change: 2008-05-07. -" @Revision: 0.0.46 +" @Last Change: 2009-02-15. +" @Revision: 0.0.66 if &cp || exists("loaded_tcomment_autoload") finish @@ -90,6 +90,7 @@ function! tcomment#Comment(beg, end, ...) " We want a comment block call s:CommentBlock(a:beg, a:end, uncomment, cmtCheck, cms, indentStr) else + " call s:CommentLines(a:beg, a:end, cstart, cend, uncomment, cmtCheck, cms0, indentStr) " We want commented lines " final search pattern for uncommenting let cmtCheck = escape('\V\^\(\s\{-}\)'. cmtCheck .'\$', '"/\') @@ -109,10 +110,12 @@ function! tcomment#Comment(beg, end, ...) endif endf - function! tcomment#Operator(type, ...) "{{{3 let commentMode = a:0 >= 1 ? a:1 : '' let bang = a:0 >= 2 ? a:2 : '' + if !exists('w:tcommentPos') + let w:tcommentPos = getpos(".") + endif let sel_save = &selection let &selection = "inclusive" let reg_save = @@ @@ -384,6 +387,17 @@ function! s:ProcessedLine(uncomment, match, checkRx, replace) return rv endf +function! s:CommentLines(beg, end, cstart, cend, uncomment, cmtCheck, cms0, indentStr) "{{{3 + " We want commented lines + " final search pattern for uncommenting + let cmtCheck = escape('\V\^\(\s\{-}\)'. a:cmtCheck .'\$', '"/\') + " final pattern for commenting + let cmtReplace = escape(a:cms0, '"/') + silent exec a:beg .','. a:end .'s/\V'. + \ s:StartRx(a:cstart) . a:indentStr .'\zs\(\.\{-}\)'. s:EndRx(a:cend) .'/'. + \ '\=s:ProcessedLine('. a:uncomment .', submatch(0), "'. a:cmtCheck .'", "'. cmtReplace .'")/ge' +endf + function! s:CommentBlock(beg, end, uncomment, checkRx, replace, indentStr) let t = @t try @@ -428,28 +442,33 @@ function! s:GuessFileType(beg, end, commentMode, filetype, ...) let cms = s:GuessCurrentCommentString(0) endif let n = a:beg + " TLogVAR n, a:beg, a:end while n <= a:end let m = indent(n) + 1 - let le = col('$') + let le = len(getline(n)) + " TLogVAR m, le while m < le let syntaxName = synIDattr(synID(n, m, 1), 'name') + " TLogVAR syntaxName, n, m let ftypeMap = get(g:tcommentSyntaxMap, syntaxName) if !empty(ftypeMap) + " TLogVAR ftypeMap return s:GetCustomCommentString(ftypeMap, a:commentMode, cms) elseif syntaxName =~ g:tcommentFileTypesRx let ft = substitute(syntaxName, g:tcommentFileTypesRx, '\1', '') + " TLogVAR ft if exists('g:tcommentIgnoreTypes_'. a:filetype) && g:tcommentIgnoreTypes_{a:filetype} =~ '\<'.ft.'\>' - let m = m + 1 + let m += 1 else return s:GetCustomCommentString(ft, a:commentMode, cms) endif elseif syntaxName == '' || syntaxName == 'None' || syntaxName =~ '^\u\+$' || syntaxName =~ '^\u\U*$' - let m = m + 1 + let m += 1 else break endif endwh - let n = n + 1 + let n += 1 endwh return [cms, commentMode] endf diff --git a/vim/colors/darkdevel.vim b/vim/colors/darkdevel.vim index b0d819a..02a506f 100644 --- a/vim/colors/darkdevel.vim +++ b/vim/colors/darkdevel.vim @@ -50,8 +50,8 @@ set cursorline "highlight MatchParen "highlight ModeMsg "highlight MoreMsg - highlight NonText ctermfg=Gray guifg=#777777 ctermbg=NONE guibg=#000000 - highlight Normal ctermfg=Gray guifg=#CCCCCC ctermbg=NONE guibg=#000000 + highlight NonText ctermfg=Gray guifg=#777777 ctermbg=NONE guibg=#111111 + highlight Normal ctermfg=Gray guifg=#CCCCCC ctermbg=NONE guibg=#111111 " Popup menu style " ================ @@ -138,7 +138,7 @@ set cursorline highlight link Typedef Type - highlight Error guifg=#FFFFFF guibg=#990000 + highlight Error guifg=#000000 guibg=#FF0000 highlight Search guibg=#FFFF00 " Style for special symbols diff --git a/vim/colors/darkspectrum.vim b/vim/colors/darkspectrum.vim index 4e02c9b..c79252f 100644 --- a/vim/colors/darkspectrum.vim +++ b/vim/colors/darkspectrum.vim @@ -65,6 +65,7 @@ hi Visual guifg=#FFFFFF guibg=#333333 gui=none "hi Visual guifg=#FFFFFF guibg=#4e5456 gui=none hi IncSearch guibg=#FFFFFF guifg=#ef5939 hi Search guibg=#ad7fa8 guifg=#FFFFFF +hi Search guibg=#990000 guifg=#FFFFFF hi SpecialKey guifg=#888a85 hi Title guifg=#ef5939 diff --git a/vim/colors/lucius.vim b/vim/colors/lucius.vim index 05aec70..2fbcd60 100644 --- a/vim/colors/lucius.vim +++ b/vim/colors/lucius.vim @@ -1,9 +1,9 @@ " Vim color file " Maintainer: Jonathan Filip -" Last Change: 2/4/2009 -" Version: 1.0 +" Last Modified: Mon Sep 28, 2009 08:55AM +" Version: 3.0 " -" GUI only +" GUI / 256 color terminal " " I started out trying to combine my favorite parts of other schemes and ended " up with this (oceandeep, moria, peaksea, wombat, zenburn). @@ -11,254 +11,336 @@ " This file also tries to have descriptive comments for each higlighting group " so it is easy to understand what each part does. + set background=dark -hi clear +hi clear if exists("syntax_on") syntax reset endif -let g:colors_name="lucius" +let colors_name="lucius" -" Random color notes +" Some other colors to save " blue: 3eb8e5 " green: 92d400 +" c green: d5f876, cae682 +" new blue: 002D62 +" new gray: CCCCCC + + +" Base color +" ---------- +hi Normal guifg=#e0e0e0 guibg=#202020 +hi Normal ctermfg=253 ctermbg=235 + " Comment Group " ------------- " any comment -hi Comment guifg=#808080 +hi Comment guifg=#606060 gui=none +hi Comment ctermfg=240 cterm=none " Constant Group " -------------- " any constant -hi Constant guifg=#50d6de gui=none +hi Constant guifg=#8cd0d3 gui=none +hi Constant ctermfg=116 cterm=none " strings -hi String guifg=#8ad6f2 gui=none +hi String guifg=#80c0d9 gui=none +hi String ctermfg=110 cterm=none " character constant -hi Character guifg=#8ad6f2 gui=none +hi Character guifg=#80c0d9 gui=none +hi Character ctermfg=110 cterm=none " numbers decimal/hex -hi Number guifg=#50d6de gui=none +hi Number guifg=#8cd0d3 gui=none +hi Number ctermfg=116 cterm=none " true, false -hi Boolean guifg=#50d6de gui=none +hi Boolean guifg=#8cd0d3 gui=none +hi Boolean ctermfg=116 cterm=none " float -hi Float guifg=#50d6de gui=none +hi Float guifg=#8cd0d3 gui=none +hi Float ctermfg=116 cterm=none " Identifier Group " ---------------- " any variable name -hi Identifier guifg=#d0b666 gui=none +hi Identifier guifg=#efaf7f gui=none +hi Identifier ctermfg=216 cterm=none " function, method, class -hi Function guifg=#fcb666 gui=none +hi Function guifg=#efaf7f gui=none +hi Function ctermfg=216 cterm=none " Statement Group " --------------- " any statement -hi Statement guifg=#bae682 gui=none +hi Statement guifg=#b3d38c gui=none +hi Statement ctermfg=150 cterm=none " if, then, else -hi Conditional guifg=#bae682 +hi Conditional guifg=#b3d38c gui=none +hi Conditional ctermfg=150 cterm=none " try, catch, throw, raise -hi Exception guifg=#bae682 +hi Exception guifg=#b3d38c gui=none +hi Exception ctermfg=150 cterm=none " for, while, do -hi Repeat guifg=#bae682 +hi Repeat guifg=#b3d38c gui=none +hi Repeat ctermfg=150 cterm=none " case, default -hi Label guifg=#bae682 +hi Label guifg=#b3d38c gui=none +hi Label ctermfg=150 cterm=none " sizeof, +, * -hi Operator guifg=#bae682 gui=none +hi Operator guifg=#b3d38c gui=none +hi Operator ctermfg=150 cterm=none " any other keyword -hi Keyword guifg=#bae682 gui=none +hi Keyword guifg=#b3d38c gui=none +hi Keyword ctermfg=150 cterm=none " Preprocessor Group " ------------------ " generic preprocessor -hi PreProc guifg=#efefaf gui=none +hi PreProc guifg=#f0dfaf gui=none +hi PreProc ctermfg=223 cterm=none " #include -hi Include guifg=#efefaf gui=none +hi Include guifg=#f0dfaf gui=none +hi Include ctermfg=223 cterm=none " #define -hi Define guifg=#efefaf gui=none +hi Define guifg=#f0dfaf gui=none +hi Define ctermfg=223 cterm=none " same as define -hi Macro guifg=#efefaf gui=none +hi Macro guifg=#f0dfaf gui=none +hi Macro ctermfg=223 cterm=none " #if, #else, #endif -hi PreCondit guifg=#efefaf gui=none +hi PreCondit guifg=#f0dfaf gui=none +hi PreCondit ctermfg=223 cterm=none " Type Group " ---------- " int, long, char -hi Type guifg=#93e690 gui=none +hi Type guifg=#93d6a9 gui=none +hi Type ctermfg=115 cterm=none " static, register, volative -hi StorageClass guifg=#93e690 gui=none +hi StorageClass guifg=#93d6a9 gui=none +hi StorageClass ctermfg=115 cterm=none " struct, union, enum -hi Structure guifg=#93e690 gui=none +hi Structure guifg=#93d6a9 gui=none +hi Structure ctermfg=115 cterm=none " typedef -hi Typedef guifg=#93e690 gui=none +hi Typedef guifg=#93d6a9 gui=none +hi Typedef ctermfg=115 cterm=none " Special Group " ------------- " any special symbol -hi Special guifg=#cfafcf gui=none +hi Special guifg=#cca3b3 gui=none +hi Special ctermfg=181 cterm=none " special character in a constant -hi SpecialChar guifg=#cfafcf gui=none +hi SpecialChar guifg=#cca3b3 gui=none +hi SpecialChar ctermfg=181 cterm=none " things you can CTRL-] -hi Tag guifg=#cfafcf gui=none +hi Tag guifg=#cca3b3 gui=none +hi Tag ctermfg=181 cterm=none " character that needs attention -hi Delimiter guifg=#cfafcf gui=none +hi Delimiter guifg=#cca3b3 gui=none +hi Delimiter ctermfg=181 cterm=none " special things inside a comment -hi SpecialComment guifg=#cfafcf gui=none +hi SpecialComment guifg=#cca3b3 gui=none +hi SpecialComment ctermfg=181 cterm=none " debugging statements -hi Debug guifg=#cfafcf guibg=NONE gui=none +hi Debug guifg=#cca3b3 guibg=NONE gui=none +hi Debug ctermfg=181 ctermbg=NONE cterm=none " Underlined Group " ---------------- " text that stands out, html links hi Underlined guifg=fg gui=underline +hi Underlined ctermfg=fg cterm=underline " Ignore Group " ------------ " left blank, hidden hi Ignore guifg=bg +hi Ignore ctermfg=bg " Error Group " ----------- " any erroneous construct -hi Error guifg=#dd4040 guibg=NONE gui=none +hi Error guifg=#e37170 guibg=#432323 gui=none +hi Error ctermfg=167 ctermbg=52 cterm=none " Todo Group " ---------- " todo, fixme, note, xxx -hi Todo guifg=#deee33 guibg=NONE gui=underline +hi Todo guifg=#efef8f guibg=NONE gui=underline +hi Todo ctermfg=228 ctermbg=NONE cterm=underline " Spelling " -------- " word not recognized hi SpellBad guisp=#ee0000 gui=undercurl +hi SpellBad ctermbg=9 cterm=undercurl " word not capitalized hi SpellCap guisp=#eeee00 gui=undercurl +hi SpellCap ctermbg=12 cterm=undercurl " rare word hi SpellRare guisp=#ffa500 gui=undercurl +hi SpellRare ctermbg=13 cterm=undercurl " wrong spelling for selected region hi SpellLocal guisp=#ffa500 gui=undercurl +hi SpellLocal ctermbg=14 cterm=undercurl " Cursor " ------ " character under the cursor -hi Cursor guifg=bg guibg=#8ac6f2 +hi Cursor guifg=bg guibg=#a3e3ed +hi Cursor ctermfg=bg ctermbg=153 " like cursor, but used when in IME mode -hi CursorIM guibg=#96cdcd +hi CursorIM guifg=bg guibg=#96cdcd +hi CursorIM ctermfg=bg ctermbg=116 " cursor column -hi CursorColumn guibg=#2d2d2d +hi CursorColumn guifg=NONE guibg=#202438 gui=none +hi CursorColumn ctermfg=NONE ctermbg=236 cterm=none " cursor line/row -hi CursorLine guibg=#2d2d2d +hi CursorLine gui=NONE guibg=#202438 gui=bold +hi CursorLine cterm=NONE ctermbg=236 cterm=bold " Misc " ---- " directory names and other special names in listings -hi Directory guifg=#95e494 gui=none +hi Directory guifg=#c0e0b0 gui=none +hi Directory ctermfg=151 cterm=none " error messages on the command line hi ErrorMsg guifg=#ee0000 guibg=NONE gui=none +hi ErrorMsg ctermfg=196 ctermbg=NONE cterm=none " column separating vertically split windows -hi VertSplit guifg=#444444 guibg=#444444 +hi VertSplit guifg=#777777 guibg=#363946 gui=none +hi VertSplit ctermfg=242 ctermbg=237 cterm=none " columns where signs are displayed (used in IDEs) hi SignColumn guifg=#9fafaf guibg=#181818 gui=none +hi SignColumn ctermfg=145 ctermbg=233 cterm=none " line numbers -hi LineNr guifg=#857b6f guibg=#444444 +hi LineNr guifg=#818698 guibg=#363946 +hi LineNr ctermfg=102 ctermbg=237 " match parenthesis, brackets -hi MatchParen guifg=#00ff00 guibg=NONE gui=none -" text showing what mode you are in +hi MatchParen guifg=#00ff00 guibg=NONE gui=bold +hi MatchParen ctermfg=46 ctermbg=NONE cterm=bold +" the 'more' prompt when output takes more than one line hi MoreMsg guifg=#2e8b57 gui=none +hi MoreMsg ctermfg=29 cterm=none +" text showing what mode you are in +hi ModeMsg guifg=#76d5f8 guibg=NONE gui=none +hi ModeMsg ctermfg=117 ctermbg=NONE cterm=none " the '~' and '@' and showbreak, '>' double wide char doesn't fit on line -hi ModeMsg guifg=#90ee90 guibg=NONE gui=none -" the 'more' prompt when output takes more than one line -hi NonText guifg=#857b6f gui=none -" normal text -"hi Normal guifg=#f6f3e8 guibg=#242424 -"hi Normal guifg=#f0f0f0 guibg=#252520 -"hi Normal guifg=#f0ede2 guibg=#142434 -"hi Normal guifg=#dcdccc guibg=#242424 -hi Normal guifg=#ececdc guibg=#242424 -"hi Normal guifg=#eae7dc guibg=#1f1f1f +hi NonText guifg=#343434 gui=none +hi NonText ctermfg=235 cterm=none " the hit-enter prompt (show more output) and yes/no questions -hi Question guifg=fg gui=none +hi Question guifg=fg gui=none +hi Question ctermfg=fg cterm=none " meta and special keys used with map, unprintable characters -hi SpecialKey guifg=#505050 +hi SpecialKey guifg=#505050 +hi SpecialKey ctermfg=237 " titles for output from :set all, :autocmd, etc -hi Title guifg=#3eb8e5 gui=none +hi Title guifg=#62bdde gui=none +hi Title ctermfg=74 cterm=none "hi Title guifg=#5ec8e5 gui=none " warning messages hi WarningMsg guifg=#e5786d gui=none +hi WarningMsg ctermfg=173 cterm=none " current match in the wildmenu completion -hi WildMenu guifg=#000000 guibg=#cae682 +hi WildMenu guifg=#cae682 guibg=#363946 gui=bold,underline +hi WildMenu ctermfg=16 ctermbg=186 cterm=bold " Diff " ---- " added line -hi DiffAdd guifg=fg guibg=#008b8b +hi DiffAdd guifg=#80a090 guibg=#313c36 gui=none +hi DiffAdd ctermfg=108 ctermbg=22 cterm=none " changed line -hi DiffChange guifg=fg guibg=#008b00 +hi DiffChange guifg=NONE guibg=#4a343a gui=none +hi DiffChange ctermfg=fg ctermbg=52 cterm=none " deleted line -hi DiffDelete guifg=fg guibg=#000000 +hi DiffDelete guifg=#6c6661 guibg=#3c3631 gui=none +hi DiffDelete ctermfg=59 ctermbg=58 cterm=none " changed text within line -hi DiffText guifg=fg +hi DiffText guifg=#f05060 guibg=#4a343a gui=bold +hi DiffText ctermfg=203 ctermbg=52 cterm=bold " Folds " ----- " line used for closed folds -hi Folded guifg=#a0a8b0 guibg=#404040 gui=none +hi Folded guifg=#91d6f8 guibg=#363946 gui=none +hi Folded ctermfg=117 ctermbg=238 cterm=none " column on side used to indicated open and closed folds -hi FoldColumn guifg=#b0d0e0 guibg=#305060 gui=none +hi FoldColumn guifg=#91d6f8 guibg=#363946 gui=none +hi FoldColumn ctermfg=117 ctermbg=238 cterm=none + " Search " ------ " highlight incremental search text; also highlight text replaced with :s///c hi IncSearch guifg=#66ffff gui=reverse +hi IncSearch ctermfg=87 cterm=reverse " hlsearch (last search pattern), also used for quickfix -hi Search guibg=#607b8b gui=none +hi Search guibg=#ffaa33 gui=none +hi Search ctermbg=214 cterm=none + " Popup Menu " ---------- " normal item in popup -hi Pmenu guifg=#f6f3e8 guibg=#444444 gui=none +hi Pmenu guifg=#e0e0e0 guibg=#303840 gui=none +hi Pmenu ctermfg=253 ctermbg=233 cterm=none " selected item in popup -hi PmenuSel guifg=#000000 guibg=#cae682 gui=none +hi PmenuSel guifg=#cae682 guibg=#303840 gui=bold +hi PmenuSel ctermfg=186 ctermbg=237 cterm=bold " scrollbar in popup -hi PMenuSbar guibg=#607b8b gui=none +hi PMenuSbar guibg=#505860 gui=none +hi PMenuSbar ctermbg=59 cterm=none " thumb of the scrollbar in the popup -hi PMenuThumb guibg=#aaaaaa gui=none +hi PMenuThumb guibg=#808890 gui=none +hi PMenuThumb ctermbg=102 cterm=none " Status Line " ----------- " status line for current window -hi StatusLine guifg=#f6f3e8 guibg=#444444 gui=none +hi StatusLine guifg=#e0e0e0 guibg=#363946 gui=bold +hi StatusLine ctermfg=254 ctermbg=237 cterm=bold " status line for non-current windows -hi StatusLineNC guifg=#857b6f guibg=#444444 gui=none +hi StatusLineNC guifg=#767986 guibg=#363946 gui=none +hi StatusLineNC ctermfg=244 ctermbg=237 cterm=none " Tab Lines " --------- " tab pages line, not active tab page label -hi TabLine guifg=#b6bf98 guibg=#181818 gui=none +hi TabLine guifg=#b6bf98 guibg=#363946 gui=none +hi TabLine ctermfg=244 ctermbg=236 cterm=none " tab pages line, where there are no labels -hi TabLineFill guifg=#cfcfaf guibg=#181818 gui=none +hi TabLineFill guifg=#cfcfaf guibg=#363946 gui=none +hi TabLineFill ctermfg=187 ctermbg=236 cterm=none " tab pages line, active tab page label -hi TabLineSel guifg=#efefef guibg=#1c1c1b gui=none +hi TabLineSel guifg=#efefef guibg=#414658 gui=bold +hi TabLineSel ctermfg=254 ctermbg=236 cterm=bold + " Visual " ------ " visual mode selection -hi Visual guibg=#445566 -" visual mode selection when vim is 'not owning the selection' (x11 only) +hi Visual guifg=NONE guibg=#364458 +hi Visual ctermfg=NONE ctermbg=24 +" visual mode selection when vim is not owning the selection (x11 only) hi VisualNOS guifg=fg gui=underline - +hi VisualNOS ctermfg=fg cterm=underline diff --git a/vim/doc/tags b/vim/doc/tags index 1aa4ef4..cf3f9ab 100644 --- a/vim/doc/tags +++ b/vim/doc/tags @@ -21,7 +21,6 @@ :FriendsTwitter twitvim.txt /*:FriendsTwitter* :IsGd twitvim.txt /*:IsGd* :LocationTwitter twitvim.txt /*:LocationTwitter* -:MatchDebug matchit.txt /*:MatchDebug* :Metamark twitvim.txt /*:Metamark* :NextTwitter twitvim.txt /*:NextTwitter* :PBitLy twitvim.txt /*:PBitLy* @@ -56,7 +55,6 @@ ExtractSnips() snipMate.txt /*ExtractSnips()* ExtractSnipsFile() snipMate.txt /*ExtractSnipsFile()* Filename() snipMate.txt /*Filename()* -MatchError matchit.txt /*MatchError* Perldoc perl_doc.txt /*Perldoc* ResetSnippets() snipMate.txt /*ResetSnippets()* TCommentDefineType() tComment.txt /*TCommentDefineType()* @@ -114,22 +112,6 @@ TwitVim-timeline-commands twitvim.txt /*TwitVim-timeline-commands* TwitVim-tips twitvim.txt /*TwitVim-tips* TwitVim-update-commands twitvim.txt /*TwitVim-update-commands* TwitVim-utility twitvim.txt /*TwitVim-utility* -[% matchit.txt /*[%* -]% matchit.txt /*]%* -b:match_col matchit.txt /*b:match_col* -b:match_debug matchit.txt /*b:match_debug* -b:match_ignorecase matchit.txt /*b:match_ignorecase* -b:match_ini matchit.txt /*b:match_ini* -b:match_iniBR matchit.txt /*b:match_iniBR* -b:match_match matchit.txt /*b:match_match* -b:match_pat matchit.txt /*b:match_pat* -b:match_skip matchit.txt /*b:match_skip* -b:match_table matchit.txt /*b:match_table* -b:match_tail matchit.txt /*b:match_tail* -b:match_wholeBR matchit.txt /*b:match_wholeBR* -b:match_word matchit.txt /*b:match_word* -b:match_words matchit.txt /*b:match_words* -g% matchit.txt /*g%* g:perldoc_flags perl_doc.txt /*g:perldoc_flags* g:perldoc_program perl_doc.txt /*g:perldoc_program* g:snippets_dir snipMate.txt /*g:snippets_dir* @@ -146,35 +128,7 @@ hl-twitterTitle twitvim.txt /*hl-twitterTitle* hl-twitterUser twitvim.txt /*hl-twitterUser* i_CTRL-R_ snipMate.txt /*i_CTRL-R_* list-snippets snipMate.txt /*list-snippets* -matchit matchit.txt /*matchit* -matchit-% matchit.txt /*matchit-%* -matchit-\1 matchit.txt /*matchit-\\1* -matchit-activate matchit.txt /*matchit-activate* -matchit-backref matchit.txt /*matchit-backref* -matchit-bugs matchit.txt /*matchit-bugs* -matchit-choose matchit.txt /*matchit-choose* -matchit-configure matchit.txt /*matchit-configure* -matchit-debug matchit.txt /*matchit-debug* -matchit-details matchit.txt /*matchit-details* -matchit-highlight matchit.txt /*matchit-highlight* -matchit-hl matchit.txt /*matchit-hl* -matchit-intro matchit.txt /*matchit-intro* -matchit-languages matchit.txt /*matchit-languages* -matchit-modes matchit.txt /*matchit-modes* -matchit-newlang matchit.txt /*matchit-newlang* -matchit-o_% matchit.txt /*matchit-o_%* -matchit-parse matchit.txt /*matchit-parse* -matchit-s:notend matchit.txt /*matchit-s:notend* -matchit-s:sol matchit.txt /*matchit-s:sol* -matchit-spaces matchit.txt /*matchit-spaces* -matchit-troubleshoot matchit.txt /*matchit-troubleshoot* -matchit-v_% matchit.txt /*matchit-v_%* -matchit.txt matchit.txt /*matchit.txt* -matchit.vim matchit.txt /*matchit.vim* multi_snip snipMate.txt /*multi_snip* -o_[% matchit.txt /*o_[%* -o_]% matchit.txt /*o_]%* -o_g% matchit.txt /*o_g%* perldoc-commands perl_doc.txt /*perldoc-commands* perldoc-info perl_doc.txt /*perldoc-info* perldoc-matches perl_doc.txt /*perldoc-matches* @@ -262,7 +216,3 @@ twitvim_proxy_login_b64 twitvim.txt /*twitvim_proxy_login_b64* twitvim_retweet_format twitvim.txt /*twitvim_retweet_format* twitvim_trim_login twitvim.txt /*twitvim_trim_login* twitvim_urlborg_key twitvim.txt /*twitvim_urlborg_key* -v_[% matchit.txt /*v_[%* -v_]% matchit.txt /*v_]%* -v_a% matchit.txt /*v_a%* -v_g% matchit.txt /*v_g%* diff --git a/vim/plugin/bufexplorer.vim b/vim/plugin/bufexplorer.vim index 1e7f50b..c7e34bc 100644 --- a/vim/plugin/bufexplorer.vim +++ b/vim/plugin/bufexplorer.vim @@ -43,7 +43,7 @@ if v:version < 700 endif " Public Interface {{{1 -nmap b :BufExplorer +"nmap b :BufExplorer " Create commands {{{1 command BufExplorer :call StartBufExplorer(has ("gui") ? "drop" : "hide edit") diff --git a/vim/plugin/lusty-juggler.vim b/vim/plugin/lusty-juggler.vim new file mode 100644 index 0000000..b29c000 --- /dev/null +++ b/vim/plugin/lusty-juggler.vim @@ -0,0 +1,749 @@ +" Copyright: Copyright (C) 2008 Stephen Bach +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" lusty-juggler.vim is provided *as is* and comes with no +" warranty of any kind, either expressed or implied. In no +" event will the copyright holder be liable for any damages +" resulting from the use of this software. +" +" Name Of File: lusty-juggler.vim +" Description: Dynamic Buffer Switcher Vim Plugin +" Maintainer: Stephen Bach +" Contributors: Juan Frias, Bartosz Leper +" +" Release Date: July 16, 2009 +" Version: 1.1.2 +" +" Usage: To launch the juggler: +" +" lj +" or +" lg +" +" You can also use this command: +" +" ":LustyJuggler" +" +" (Personally, I map this to ,g) +" +" When the juggler launches, the command bar at bottom is +" replaced with a new bar showing the names of your currently +" opened buffers in most-recently-used order. +" +" The buffer names are mapped to these keys: +" +" 1st|2nd|3rd|4th|5th|6th|7th|8th|9th|10th +" ---------------------------------------- +" a s d f g h j k l ; +" 1 2 3 4 5 6 7 8 9 0 +" +" So if you type "f" or "4", the fourth buffer name will be +" highlighted and the bar will shift to center it as necessary +" (and show more of the buffer names on the right). +" +" If you want to switch to that buffer, press "f" or "4" again +" or press "". Alternatively, press one of the other +" mapped keys to highlight another buffer. +" +" To display the key before the name of the buffer, add one of +" the following lines to your .vimrc: +" +" let g:LustyJugglerShowKeys = 'a' (for alpha characters) +" let g:LustyJugglerShowKeys = 1 (for digits) +" +" To cancel the juggler, press any of "q", "", "", "", or "". +" +" +" Bonus: This plugin also includes the following command, which will +" immediately switch to your previously used buffer: +" +" ":JugglePrevious" +" +" This is similar to the :b# command, but accounts for the +" common situation where your previously used buffer (#) has +" been killed and is thus inaccessible. In that case, it will +" instead switch to the buffer used previous to the killed +" buffer (and on down the line). +" +" +" Install Details: +" +" Copy this file into your $HOME/.vim/plugin directory so that it will be +" sourced on startup automatically. +" +" Note! This plugin requires Vim be compiled with Ruby interpretation. If you +" don't know if your build of Vim has this functionality, you can check by +" running "vim --version" from the command line and looking for "+ruby". +" Alternatively, just try sourcing this script. +" +" If your version of Vim does not have "+ruby" but you would still like to +" use this plugin, you can fix it. See the "Check for Ruby functionality" +" comment below for instructions. +" +" If you are using the same Vim configuration and plugins for multiple +" machines, some of which have Ruby and some of which don't, you may want to +" turn off the "Sorry, LustyJuggler requires ruby" warning. You can do so +" like this (in .vimrc): +" +" let g:LustyJugglerSuppressRubyWarning = 1 +" +" GetLatestVimScripts: 2050 1 :AutoInstall: lusty-juggler.vim +" +" TODO: +" - save and restore mappings +" - Add TAB recognition back. +" - Add option to open buffer immediately when mapping is pressed (but not +" release the juggler until the confirmation press). +" - Have the delimiter character settable. +" - have colours settable? + +" Exit quickly when already loaded. +if exists("g:loaded_lustyjuggler") + finish +endif + +" Check for Ruby functionality. +if !has("ruby") + if !exists("g:LustyExplorerSuppressRubyWarning") || + \ g:LustyExplorerSuppressRubyWarning == "0" + if !exists("g:LustyJugglerSuppressRubyWarning") || + \ g:LustyJugglerSuppressRubyWarning == "0" + echohl ErrorMsg + echon "Sorry, LustyJuggler requires ruby. " + echon "Here are some tips for adding it:\n" + + echo "Debian / Ubuntu:" + echo " # apt-get install vim-ruby\n" + + echo "Fedora:" + echo " # yum install vim-enhanced\n" + + echo "Gentoo:" + echo " # USE=\"ruby\" emerge vim\n" + + echo "FreeBSD:" + echo " # pkg_add -r vim+ruby\n" + + echo "Windows:" + echo " 1. Download and install Ruby from here:" + echo " http://www.ruby-lang.org/" + echo " 2. Install a Vim binary with Ruby support:" + echo " http://segfault.hasno.info/vim/gvim72.zip\n" + + echo "Manually (including Cygwin):" + echo " 1. Install Ruby." + echo " 2. Download the Vim source package (say, vim-7.0.tar.bz2)" + echo " 3. Build and install:" + echo " # tar -xvjf vim-7.0.tar.bz2" + echo " # ./configure --enable-rubyinterp" + echo " # make && make install\n" + + echo "(If you just wish to stifle this message, set the following option:" + echo " let g:LustyJugglerSuppressRubyWarning = 1)" + echohl none + endif + endif + finish +endif + +let g:loaded_lustyjuggler = "yep" + +" Commands. +if !exists(":LustyJuggler") + command LustyJuggler :call LustyJugglerStart() + command JugglePrevious :call JugglePreviousRun() +endif + +" Default mappings. +nmap lg :LustyJuggler +nmap lj :LustyJuggler + +" Vim-to-ruby function calls. +function! s:LustyJugglerStart() + ruby $lusty_juggler.run +endfunction + +function! LustyJugglerKeyPressed(code_arg) + ruby $lusty_juggler.key_pressed +endfunction + +function! LustyJugglerCancel() + ruby $lusty_juggler.cleanup +endfunction + +function! s:JugglePreviousRun() + ruby juggle_previous() +endfunction + +" Setup the autocommands that handle buffer MRU ordering. +augroup LustyJuggler + autocmd! + autocmd BufEnter * ruby $buffer_stack.push + autocmd BufDelete * ruby $buffer_stack.pop + autocmd BufWipeout * ruby $buffer_stack.pop +augroup End + +ruby << EOF + +require 'pathname' + +class LustyJuggler + private + @@KEYS = { "a" => 1, + "s" => 2, + "d" => 3, + "f" => 4, + "g" => 5, + "h" => 6, + "j" => 7, + "k" => 8, + "l" => 9, + ";" => 10, + "1" => 1, + "2" => 2, + "3" => 3, + "4" => 4, + "5" => 5, + "6" => 6, + "7" => 7, + "8" => 8, + "9" => 9, + "0" => 10 } + + public + def initialize + @running = false + @last_pressed = nil + @name_bar = NameBar.new + end + + def run + return if @running + + if $buffer_stack.length <= 1 + pretty_msg("PreProc", "No other buffers") + return + end + + @running = true + + # Need to zero the timeout length or pressing 'g' will hang. + @ruler = (eva("&ruler") != "0") + @showcmd = (eva("&showcmd") != "0") + @showmode = (eva("&showmode") != "0") + @timeoutlen = eva "&timeoutlen" + set 'timeoutlen=0' + set 'noruler' + set 'noshowcmd' + set 'noshowmode' + + # Selection keys. + @@KEYS.keys.each do |c| + exe "noremap #{c} :call LustyJugglerKeyPressed('#{c}')" + end + # Can't use '' as an argument to :call func for some reason. + exe "noremap :call LustyJugglerKeyPressed('ENTER')" + #exe "noremap :call LustyJugglerKeyPressed('TAB')" + + # Cancel keys. + exe "noremap q :call LustyJugglerCancel()" + exe "noremap :call LustyJugglerCancel()" + exe "noremap :call LustyJugglerCancel()" + exe "noremap :call LustyJugglerCancel()" + exe "noremap :call LustyJugglerCancel()" + exe "noremap :call LustyJugglerCancel()" + + print_buffer_list() + end + + def key_pressed() + c = eva("a:code_arg") + + if (c == @last_pressed) or \ + (@last_pressed and c == 'ENTER') + choose(@@KEYS[@last_pressed]) + cleanup() + else + print_buffer_list(@@KEYS[c]) + @last_pressed = c + end + end + + # Restore settings, mostly. + def cleanup + @last_pressed = nil + + set "timeoutlen=#{@timeoutlen}" + set "ruler" if @ruler + set "showcmd" if @showcmd + set "showmode" if @showmode + + @@KEYS.keys.each do |c| + exe "unmap #{c}" + end + exe "unmap " + #exe "unmap " + + exe "unmap q" + exe "unmap " + exe "unmap " + exe "unmap " + exe "unmap " + exe "unmap " + + @running = false + msg "" + end + + private + def print_buffer_list(highlighted_entry=0) + # If the user pressed a key higher than the number of open buffers, + # highlight the highest (see also BufferStack.num_at_pos()). + @name_bar.active = [highlighted_entry, $buffer_stack.length].min + + @name_bar.print + end + + def choose(i) + buf = $buffer_stack.num_at_pos(i) + exe "b #{buf}" + end +end + + +# An item (delimiter/separator or buffer name) on the NameBar. +class BarItem + def initialize(str, color) + @str = str + @color = color + end + + def length + @str.length + end + + def pretty_print_input + [@color, @str] + end + + def [](*rest) + return BarItem.new(@str[*rest], @color) + end + + def self.full_length(array) + if array + array.inject(0) { |sum, el| sum + el.length } + else + 0 + end + end +end + +class Buffer < BarItem + def initialize(str, active) + @str = str + @active = active + destructure() + end + + def [](*rest) + return Buffer.new(@str[*rest], @active) + end + + def pretty_print_input + @array + end + + private + @@BUFFER_COLOR = "PreProc" + #@@BUFFER_COLOR = "None" + @@DIR_COLOR = "Directory" + @@SLASH_COLOR = "Function" + @@ACTIVE_COLOR = "Question" + + # Breakdown the string to colourize each part. + def destructure + if @active + buf_color = @@ACTIVE_COLOR + dir_color = @@ACTIVE_COLOR + slash_color = @@ACTIVE_COLOR + else + buf_color = @@BUFFER_COLOR + dir_color = @@DIR_COLOR + slash_color = @@SLASH_COLOR + end + + pieces = @str.split(File::SEPARATOR, -1) + + @array = [] + @array << dir_color + @array << pieces.shift + pieces.each { |piece| + @array << slash_color + @array << File::SEPARATOR + @array << dir_color + @array << piece + } + + # Last piece is the actual name. + @array[-2] = buf_color + end +end + +class Separator < BarItem + public + def initialize + super(@@TEXT, @@COLOR) + end + + private + @@TEXT = "|" + #@@COLOR = "NonText" + @@COLOR = "None" +end + +class LeftContinuer < BarItem + public + def initialize + super(@@TEXT, @@COLOR) + end + + def self.length + @@TEXT.length + end + + private + @@TEXT = "<" + @@COLOR = "NonText" +end + +class RightContinuer < BarItem + public + def initialize + super(@@TEXT, @@COLOR) + end + + def self.length + @@TEXT.length + end + + private + @@TEXT = ">" + @@COLOR = "NonText" +end + + +# A one-line display of the open buffers, appearing in the command display. +class NameBar + public + def initialize + @active = nil + end + + def active=(i) + # Correct for zero-based array. + @active = (i > 0) ? i - 1 : nil + end + + def print + items = create_items() + clipped = clip(items) + NameBar.do_pretty_print(clipped) + end + + private + @@LETTERS = ["a", "s", "d", "f", "g", "h", "j", "k", "l", ";"] + + + def create_items + names = $buffer_stack.names + + items = names.inject([]) { |array, name| + key = if exists?("g:LustyJugglerShowKeys") + case eva("g:LustyJugglerShowKeys") + when /[[:alpha:]]/ + @@LETTERS[array.size / 2] + ":" + when /[[:digit:]]/ + "#{((array.size / 2) + 1) % 10}:" + else + "" + end + else + "" + end + + array << Buffer.new("#{key}#{name}", + (@active and name == names[@active])) + array << Separator.new + } + items.pop # Remove last separator. + + # Account for the separators. + @active and @active = [@active * 2, (items.length - 1)].min + + return items + end + + # Clip the given array of items to the available display width. + def clip(items) + @active = 0 if @active.nil? + + half_displayable_len = columns() / 2 + + # The active buffer is excluded since it's basically split between + # the sides. + left_len = BarItem.full_length items[0, @active - 1] + right_len = BarItem.full_length items[@active + 1, items.length - 1] + + right_justify = (left_len > half_displayable_len) and \ + (right_len < half_displayable_len) + + active_str_half_len = (items[@active].length / 2) + \ + (items[@active].length % 2 == 0 ? 0 : 1) + + if right_justify + # Right justify the bar. + first_layout = self.method :layout_right + second_layout = self.method :layout_left + first_adjustment = active_str_half_len + second_adjustment = -active_str_half_len + else + # Left justify (sort-of more likely). + first_layout = self.method :layout_left + second_layout = self.method :layout_right + first_adjustment = -active_str_half_len + second_adjustment = active_str_half_len + end + + # Layout the first side. + allocation = half_displayable_len + first_adjustment + first_side, remainder = first_layout.call(items, allocation) + + # Then layout the second side, also grabbing any unused space. + allocation = half_displayable_len + \ + second_adjustment + \ + remainder + second_side, remainder = second_layout.call(items, allocation) + + if right_justify + second_side + first_side + else + first_side + second_side + end + end + + # Clip the given array of items to the given space, counting downwards. + def layout_left(items, space) + trimmed = [] + + i = @active - 1 + while i >= 0 + m = items[i] + if space > m.length + trimmed << m + space -= m.length + elsif space > 0 + trimmed << m[m.length - (space - LeftContinuer.length), \ + space - LeftContinuer.length] + trimmed << LeftContinuer.new + space = 0 + else + break + end + i -= 1 + end + + return trimmed.reverse, space + end + + # Clip the given array of items to the given space, counting upwards. + def layout_right(items, space) + trimmed = [] + + i = @active + while i < items.length + m = items[i] + if space > m.length + trimmed << m + space -= m.length + elsif space > 0 + trimmed << m[0, space - RightContinuer.length] + trimmed << RightContinuer.new + space = 0 + else + break + end + i += 1 + end + + return trimmed, space + end + + def NameBar.do_pretty_print(items) + args = items.inject([]) { |array, item| + array = array + item.pretty_print_input + } + + pretty_msg *args + end +end + + +# Maintain MRU ordering. +# A little bit different than the LustyExplorer version -- probably they +# should be unified. +class BufferStack + public + def initialize + @stack = [] + + (0..VIM::Buffer.count-1).each do |i| + @stack << VIM::Buffer[i].number + end + end + + def names + # Get the last 10 buffer names by MRU. Show only as much of + # the name as necessary to differentiate between buffers of + # the same name. + cull! + names = @stack.collect { |i| buf_name(i) }.reverse[0,10] + shorten_paths(names) + end + + def num_at_pos(i) + cull! + return @stack[-i] ? @stack[-i] : @stack.first + end + + def length + cull! + return @stack.length + end + + def push + @stack.delete $curbuf.number + @stack << $curbuf.number + end + + def pop + number = eva 'bufnr(expand(""))' + @stack.delete number + end + + private + def cull! + # Remove empty buffers. + @stack.delete_if { |x| eva("bufexists(#{x})") == "0" } + end + + def buf_name(i) + eva("bufname(#{i})") + end + + def shorten_paths(buffer_names) + # Shorten each buffer name by removing all path elements which are not + # needed to differentiate a given name from other names. This usually + # results in only the basename shown, but if several buffers of the + # same basename are opened, there will be more. + + # Group the buffers by common basename + common_base = Hash.new { |hash, k| hash[k] = [] } + buffer_names.each do |name| + basename = Pathname.new(name).basename.to_s + common_base[basename] << name + end + + # Determine the longest common prefix for each basename group. + basename_to_prefix = {} + common_base.each do |k, names| + if names.length > 1 + basename_to_prefix[k] = common_prefix(names) + end + end + + # Shorten each buffer_name by removing the prefix. + buffer_names.map { |name| + base = Pathname.new(name).basename.to_s + prefix = basename_to_prefix[base] + prefix ? name[prefix.length..-1] \ + : base + } + end + + def common_prefix(paths) + prefix = paths[0] + for path in paths + for i in 0...prefix.length + if path.length <= i or prefix[i] != path[i] + prefix = prefix[0...i] + prefix = prefix[0..(prefix.rindex('/') or -1)] + break + end + end + end + return prefix + end +end + + +# Switch to the previous buffer (the one you were using before the current +# one). This is basically a smarter replacement for :b#, accounting for +# the situation where your previous buffer no longer exists. +def juggle_previous + buf = $buffer_stack.num_at_pos(2) + exe "b #{buf}" +end + +# Simple mappings to decrease typing. +def exe(s) + VIM.command s +end + +def eva(s) + VIM.evaluate s +end + +def set(s) + VIM.set_option s +end + +def msg(s) + VIM.message s +end + +def exists?(s) + VIM.evaluate("exists('#{s}')") != "0" +end + +def columns + # Vim gives the annoying "Press ENTER to continue" message if we use the + # full width. + eva("&columns").to_i - 1 +end + +def pretty_msg(*rest) + return if rest.length == 0 + return if rest.length % 2 != 0 + + #exe "redraw" + + i = 0 + while i < rest.length do + exe "echohl #{rest[i]}" + exe "echon '#{rest[i+1]}'" + i += 2 + end + + exe 'echohl None' +end + + +$lusty_juggler = LustyJuggler.new +$buffer_stack = BufferStack.new + + +EOF + diff --git a/vim/plugin/php-codesniffer.vim b/vim/plugin/php-codesniffer.vim new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/vim/plugin/php-codesniffer.vim @@ -0,0 +1 @@ + diff --git a/vim/plugin/tComment.vim b/vim/plugin/tComment.vim index 2eba17a..dc0c676 100644 --- a/vim/plugin/tComment.vim +++ b/vim/plugin/tComment.vim @@ -1,9 +1,9 @@ " tComment.vim -- An easily extensible & universal comment plugin -" @Author: Thomas Link (micathom AT gmail com) +" @Author: Tom Link (micathom AT gmail com) " @License: GPL (see http://www.gnu.org/licenses/gpl.txt) " @Created: 27-Dez-2004. -" @Last Change: 2008-05-15. -" @Revision: 1.9.664 +" @Last Change: 2009-08-07. +" @Revision: 1.9.671 " " GetLatestVimScripts: 1173 1 tComment.vim @@ -129,6 +129,7 @@ call TCommentDefineType('c_inline', g:tcommentInlineC ) call TCommentDefineType('c_block', g:tcommentBlockC ) call TCommentDefineType('cfg', '# %s' ) call TCommentDefineType('conf', '# %s' ) +call TCommentDefineType('crontab', '# %s' ) call TCommentDefineType('desktop', '# %s' ) call TCommentDefineType('docbk', '' ) call TCommentDefineType('docbk_inline', g:tcommentInlineXML) @@ -158,7 +159,9 @@ call TCommentDefineType('java', '/* %s */' ) call TCommentDefineType('java_inline', g:tcommentInlineC ) call TCommentDefineType('java_block', g:tcommentBlockC ) call TCommentDefineType('java_doc_block', g:tcommentBlockC2 ) +call TCommentDefineType('jproperties', '# %s' ) call TCommentDefineType('lisp', '; %s' ) +call TCommentDefineType('lynx', '# %s' ) call TCommentDefineType('m4', 'dnl %s' ) call TCommentDefineType('mail', '> %s' ) call TCommentDefineType('msidl', '// %s' ) @@ -376,3 +379,7 @@ new: >) 1.9 - Fix left offset for inline comments (via operator binding) +1.10 +- tcomment#Operator defines w:tcommentPos if invoked repeatedly +- s:GuessFileType: use len(getline()) instead of col() + diff --git a/vim/snippets/php.snippets b/vim/snippets/php.snippets index 36a8925..4216628 100644 --- a/vim/snippets/php.snippets +++ b/vim/snippets/php.snippets @@ -216,8 +216,19 @@ snippet array $${1:arrayName} = array('${2}' => ${3});${4} # var_dump( ... ) +# tmp override dmp for firephp +#snippet dmp +# var_dump( $${1:var} ); snippet dmp - var_dump( $${1:var} ); + FB::log( $${1:var} ); +# firephp dumping( ... ) +snippet fd + FB::dump( '${1:key}', $${2:var} ); +snippet fl + FB::log( ${1:var} ); + + + # check if allowed to edit object/subject snippet isauth diff --git a/vimrc b/vimrc index 3fbabac..1aa5267 100644 --- a/vimrc +++ b/vimrc @@ -104,7 +104,7 @@ set ls=2 " allways show status line set tabstop=4 " numbers of spaces of tab character set shiftwidth=4 " numbers of spaces to (auto)indent set scrolloff=3 " keep 3 lines when scrolling -"set cursorline " have a line indicate the cursor location +set nocursorline " have a line indicate the cursor location set cindent " cindent set autoindent " always set autoindenting on set showcmd " display incomplete commands @@ -178,6 +178,10 @@ imap map v :sp ~/.vimrc_ map V :source ~/.vimrc:filetype detect:exe ":echo 'vimrc reloaded'" +nmap b :LustyJuggler + + + " shortcuts for saving with ctrl-s nmap :w vmap @@ -273,24 +277,24 @@ if version>=600 "---- Options for Windows if has("gui_running") - set guifont=Liberation\ Mono\ 7" use this font + set guifont=Liberation\ Mono\ 8" use this font set lines=75 " height = 50 lines set columns=180 " width = 100 columns set background=dark " adapt colors for background set keymodel= set mousehide "colorscheme tango2 - "colorscheme lucius - colorscheme darkburn - + colorscheme lucius + "colorscheme darkburn + "colorscheme darkspectrum " To set the toolbars off (icons on top of the screen) set guioptions-=T else set background=dark " adapt colors for dark background - " colorscheme tango2 " use this color scheme - "colorscheme lucius - colorscheme darkburn + "colorscheme tango2 " use this color scheme + colorscheme lucius + "colorscheme darkburn endif endif " }}} @@ -335,10 +339,23 @@ source ~/.vim/php/php-doc.vim source ~/.vim/php/phpfolding.vim autocmd FileType php set omnifunc=phpcomplete#CompletePHP +autocmd BufRead *.php let php_folding=0 autocmd BufRead *.php map :set paste:call PhpDoc():set nopastei autocmd BufRead *.php set makeprg=php\ -l\ % -autocmd BufRead *.php set errorformat=%m\ in\ %f\ on\ line\ %l -autocmd BufRead *.php let php_folding=0 +"autocmd BufRead *.php set makeprg=php\ -l\ % +"autocmd BufRead *.php set errorformat=%m\ in\ %f\ on\ line\ %l + +function! RunPhpcs() + let l:filename=@% + let l:phpcs_output=system('phpcs --report=csv --standard=Zend '.l:filename) + let l:phpcs_list=split(l:phpcs_output, "\n") + unlet l:phpcs_list[0] + cexpr l:phpcs_list + cwindow +endfunction +autocmd BufRead *.php set errorformat=\"%f\"\\,%l\\,%c\\,%t%*[a-zA-Z]\\,\"%m\",%m\ in\ %f\ on\ line\ %l +command! Phpcs execute RunPhpcs() +autocmd BufRead *.php map M :execute RunPhpcs() " HTML Stuff au FileType javascript set omnifunc=javascriptcomplete#CompleteJS @@ -350,8 +367,15 @@ au FileType css set omnifunc=csscomplete#CompleteCSS " automatically minimize .js files if we can " requires the jsmin.pl script and install in CPAN of " MINIFY::Javascript and MINIFY::CSS -au BufWritePost *.js silent !jsmin.pl % -au BufWritePost *.css silent !jsmin.pl % +"au BufWritePost *.js silent !jsmin.pl % +"au BufWritePost *.css silent !jsmin.pl % + +" Build the JS/CSS files for the project based on the workit postactivate +" functions +nmap jb :!jsbuild.sh :!cssbuild.sh + +autocmd BufRead *.js set makeprg=jslint\ % +"autocmd BufRead *.js set errorformat= " PYTHON Stuff " plugin that adds support for pdb from within vim