From 0c4856935d3b9667ac60e06d3d64dd4430051a9d Mon Sep 17 00:00:00 2001 From: yan Date: Wed, 7 Dec 2011 00:32:08 -0800 Subject: [PATCH] Installed latest showmarks plugin, forked solarized color scheme and improved on marks color --- .gitmodules | 9 +- README.md | 12 +- vim/bundle/garbas-vim-showmarks | 1 + vim/bundle/showmarks/autoload/showmarks.vim | 351 -------------------- vim/bundle/showmarks/plugin/showmarks.vim | 73 ---- vim/bundle/skwp-vim-colors-solarized | 1 + vim/bundle/vim-colors-solarized | 1 - vimrc | 87 +++-- 8 files changed, 69 insertions(+), 466 deletions(-) create mode 160000 vim/bundle/garbas-vim-showmarks delete mode 100644 vim/bundle/showmarks/autoload/showmarks.vim delete mode 100644 vim/bundle/showmarks/plugin/showmarks.vim create mode 160000 vim/bundle/skwp-vim-colors-solarized delete mode 160000 vim/bundle/vim-colors-solarized diff --git a/.gitmodules b/.gitmodules index ad5c4a3..f6b0e94 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,9 +4,6 @@ [submodule "vim/bundle/fugitive"] path = vim/bundle/tpope-fugitive url = http://github.com/tpope/vim-fugitive.git -[submodule "vim/bundle/vim-colors-solarized"] - path = vim/bundle/vim-colors-solarized - url = https://github.com/altercation/vim-colors-solarized [submodule "vim/bundle/vim-ruby-conque"] path = vim/bundle/vim-ruby-conque url = https://github.com/skwp/vim-ruby-conque @@ -22,3 +19,9 @@ [submodule "vim/bundle/vim-scripts-AnsiEsc"] path = vim/bundle/vim-scripts-AnsiEsc url = https://github.com/vim-scripts/AnsiEsc.vim.git +[submodule "vim/bundle/garbas-vim-showmarks"] + path = vim/bundle/garbas-vim-showmarks + url = https://github.com/garbas/vim-showmarks +[submodule "vim/bundle/skwp-vim-colors-solarized"] + path = vim/bundle/skwp-vim-colors-solarized + url = https://github.com/skwp/vim-colors-solarized diff --git a/README.md b/README.md index 06db7d2..c8f09f7 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Some of the vim customizations include: * T - Tag list (list of methods in a class) * K - git grep for the Kurrent word under the cursor * O - Open a GitGrep command line with a quote pretyped (close the quote yourself) - * \m - show my Marks (set a mark with mX where X is a letter, navigate to mark using 'X). Uppercase marks to mark files, lowercase marks to use within a file. + * \mm - show my Marks (set a mark with mX where X is a letter, navigate to mark using 'X). Uppercase marks to mark files, lowercase marks to use within a file. * Z - jump back and forth between last two buffers * Q - Quit a window (normally Ctrl-w,c) * \Q - Kill a buffer completely (normally :bw) @@ -136,10 +136,14 @@ Some of the vim customizations include: Included vim plugins --- - * fugitive - "a git wrapper so awesome, it should be illegal.." - * Try Gstatus and hit '-' on the screen to toggle files. Hit 'd' on the same screen for a diff. - * Watch: http://vimcasts.org/blog/2011/05/the-fugitive-series/ + * fugitive - "a git wrapper so awesome, it should be illegal..". Try Gstatus and hit '-' to toggle files. Git 'd' to see a diff. Learn more: http://vimcasts.org/blog/2011/05/the-fugitive-series/ * GitGrep - much better than the grep provided with fugitive; use :GitGrep or hit K to grep current word + * showmarks - creates a visual gutter to the left of the number column showing you your bookmarks. use \mt to toggle it, \mm to place the next available mark, \mh to delete, \ma to clear all. Use standard vim mark navigation ('X) for mark named X. + * delimitMate - automatically closes quotes + * solarized - a color scheme scientifically calibrated for awesomeness + * ConqueTerm - embedded fully colorful shell inside your vim + * vim-ruby-conque - helpers to run ruby,rspec,rake within ConqueTerm - use \rr (ruby), \ss (rspec), \ll (rspec line), \RR (rake) + * AnsiEsc - inteprets ansi color codes inside log files. great for looking at Rails logs * ruby-debug-ide - not quite working for me, but maybe it will for you. supposedly a graphical debugger you can step through Adding your own vim plugins diff --git a/vim/bundle/garbas-vim-showmarks b/vim/bundle/garbas-vim-showmarks new file mode 160000 index 0000000..11d9fb0 --- /dev/null +++ b/vim/bundle/garbas-vim-showmarks @@ -0,0 +1 @@ +Subproject commit 11d9fb0e38a3894f23b9de69aa3e3990a685d73c diff --git a/vim/bundle/showmarks/autoload/showmarks.vim b/vim/bundle/showmarks/autoload/showmarks.vim deleted file mode 100644 index 9188b54..0000000 --- a/vim/bundle/showmarks/autoload/showmarks.vim +++ /dev/null @@ -1,351 +0,0 @@ -" Display marks in the signs column -" Maintainer: A. Politz -" Last change: 2008-02-06 -" v0.1 - -let s:marks = 'abcdefghijklmnopqrstuvwxyz' .'ABCDEFGHIJKLMNOPQRSTUVWXYZ' .'<>' -let s:all_marks = split(s:marks . '0123456789(){}''^."','\ze') - -"Hlgroup for signs -:highlight default link hlShowMarks Question -"Which buffers have the plugin activated ? -let s:handled_buffers = [] -"Prefix for the signname -let s:sign_prefix = 'showmarks-' -"Undef signs, if plugin is inactive -let s:have_signs_defined = 0 -"Try to avoid id-conflicts -let s:sign_id_incr = 947380 -"ids for top and bottom signs -let s:top_sign_id = s:sign_id_incr - 1 -let s:bot_sign_id = s:sign_id_incr - 2 - - -"public interface -func! showmarks#ShowMarks( cmd, ... ) - let to = a:0 ? a:1 : 1 - let to = to >= 0 ? to : 1 - if a:cmd =~ 'once' - "Disable afterwards regardless of current state - let force_disable = a:0 > 1 && a:2 - call s:EnableLocalOneTime(to,force_disable) - elseif a:cmd =~ 'preview' - :call s:PreviewMarks(to) - else - let enable = a:cmd =~ 'enable' - let global = a:cmd =~ 'global' - if enable - if global - call s:EnableGlobal() - else - call s:EnableLocal() - endif - else - if global - call s:DisableGlobal() - else - call s:DisableLocal() - endif - endif - endif -endfun - - -func! s:GetWantedMarks() - if !exists('g:showmarks_marks') - let g:showmarks_marks=s:marks - return g:showmarks_marks - elseif type(g:showmarks_marks) != type('string') - return s:marks - else - return g:showmarks_marks - endif -endfun - - -func! s:UpdateSigns( ) - if !exists('b:showmarks') - "Remeber which id is displayed in which lnum. - let b:showmarks = {} - let b:showmarks.topline = 0 - let b:showmarks.botline = 0 - endif - "Find the first and last nonfolded line in the window. - let top = line('w0') - let bot = line('w$') - while foldclosed(top) >= 0 && top < bot - let top = foldclosedend(top)+1 - endwhile - if top >= bot - let top = 0 - let bot = 0 - let b:showmarks.topline = 0 - let b:showmarks.botline = 0 - else - for l in range(top+1,bot) - if foldclosed(l) < 0 - let bot=l - endif - endfor - endif - "Figure out if the windows top and bottom lines have changed. If - "not don't bother with updating the top/bot markers. - if b:showmarks.topline == top && b:showmarks.botline == bot - let do_bottop_signs = 0 - else - let b:showmarks.topline = top - let b:showmarks.botline = bot - let do_bottop_signs = 1 - endif - - if do_bottop_signs - let topsign = { 'lnum' : 1, 'mark' : '' , 'ok' : 1} - let botsign = { 'lnum' : line('$') , 'mark' : '' , 'ok' : 1} - endif - - for id in range(len(s:all_marks)) - let mark = s:all_marks[id] - "At least try! to avoid id-conflicts - let id += s:sign_id_incr "Some random value - let [ bnr, lnum ] = getpos("'".mark)[0:1] - "Sort out file and global marks ( '0-9 'A-Z ) from another - "buffer - if bnr && bnr != bufnr('%') - continue - endif - - let want_mark = s:GetWantedMarks() =~ '\V'.mark - if !lnum || !want_mark - "Mark not set, or don't want it anymore. Remove it from - "b:showmarks and undisplay the sign - if has_key(b:showmarks,id) - call remove(b:showmarks,id) - silent exec 'sign unplace '.id.' buffer='.bufnr('%') - endif - else "if lnum && want_mark - "Found a valid mark and want it. - if do_bottop_signs - "Check for a candidate for the bot and top marks - if lnum < top && lnum >= topsign.lnum - let topsign.mark = mark - let topsign.lnum = lnum - elseif lnum > bot && lnum <= botsign.lnum - let botsign.mark = mark - let botsign.lnum = lnum - elseif lnum == top - "Don't overrule real marks at this position. - let topsign.ok = 0 - elseif lnum == bot - let botsign.ok = 0 - endif - endif - - if !has_key(b:showmarks,id) - let b:showmarks[id]= 0 - endif - "Show the sign, if it's not already displayed where it - "belongs. - if b:showmarks[id] != lnum - silent! exec 'sign unplace '.id.' buffer='.bufnr('%') - silent! exec 'sign place '.id.' line='.lnum.' name='.s:sign_prefix.mark.' buffer='.bufnr('%') - let b:showmarks[id]=lnum - endif - endif - endfor - if do_bottop_signs - "Unplace,undef,def and place the top and bottom signs, if necessary. - silent! exec 'sign unplace '.s:top_sign_id.' buffer='.bufnr('%') - silent! exec 'sign undefine '.s:sign_prefix.'topline' - if topsign.ok && !empty(topsign.mark) - silent exec 'sign define '.s:sign_prefix.'topsign text=/'.(topsign.mark).' texthl=hlShowMarks' - silent exec 'sign place '.s:top_sign_id.' line='.top.' name='.s:sign_prefix.'topsign buffer='.bufnr('%') - endif - - silent! exec 'sign unplace '.s:bot_sign_id.' buffer='.bufnr('%') - silent! exec 'sign undefine '.s:sign_prefix.'botline' - if botsign.ok && !empty(botsign.mark) - silent exec 'sign define '.s:sign_prefix.'botsign text=\'.(botsign.mark).' texthl=hlShowMarks' - silent exec 'sign place '.s:bot_sign_id.' line='.bot.' name='.s:sign_prefix.'botsign buffer='.bufnr('%') - endif - endif -endfun - -func! s:PreviewMarks( ... ) " autoclose - if !exists('s:preview_tmp') - let s:preview_tmp = tempname() - endif - - let curbuf_marks = [] - let foreign_marks = [] - for mark in s:all_marks - if s:GetWantedMarks() !~ '\V'.mark - continue - endif - let [ bnr, lnum ] = getpos("'".mark)[0:1] - if !lnum - continue - endif - if !bnr || bnr == bufnr('%') - let line = ' '.mark.' ' - let line .= printf('%'.strlen(line('$')).'d',lnum).' ' - let line .= getline(lnum) - call add(curbuf_marks,{ 'mark' : mark, 'line' : line, 'lnum' : lnum }) - else - let line = ' '.mark.' ' - let line .= repeat(' ',strlen(line('$'))-1).'> ' - let line .= bufname(bnr) - call add(foreign_marks,line) - endif - endfor - - if !empty(curbuf_marks) || !empty(foreign_marks) - if a:0 && a:1 - let s:showmarks_pvw_timeout = a:1 - "autoclose - augroup showmarks-PreviewMarks - au! - au CursorHold * let s:showmarks_pvw_timeout-=1 | if s:showmarks_pvw_timeout<=0| wincmd z | exec 'au! showmarks-PreviewMarks' | unlet s:showmarks_pvw_timeout | endif - augroup END - endif - - let syntax=&syntax - silent! exec 'ped '.s:preview_tmp - wincmd P - if &previewwindow - silent %d _ - "Better than no color at all ? - exec 'set syntax='.syntax - - setl nobuflisted buftype=nofile nonu nofoldenable nowrap - setl noscrollbind stl=[Preview]ShowMarks nodiff - silent exec ':resize '.min([ &lines/2 , len(curbuf_marks)+len(foreign_marks) ]) - call sort(curbuf_marks,'s:ComparePVWLines') - call setline(1,map(curbuf_marks,'v:val.line')) - call setline(line('$')+1,foreign_marks) - call matchadd('hlShowMarks','^\s\zs.') - call matchadd('LineNr','^\s.\s*\zs\d\+') - call matchadd('Special','^\s*\S\s*\zs>\s*.*') - wincmd p - else - echohl Error | echo "Can't open the previewwindow (ShowMarks) !" | echohl None - endif - endif -endfun - -func! s:EnableLocal() - "echo 'EL in' string(s:handled_buffers) - if index(s:handled_buffers,bufnr('%')) < 0 - call add(s:handled_buffers,bufnr('%')) - if !s:have_signs_defined - call s:DefSigns() - let s:have_signs_defined = 1 - endif - augroup showmarks - au CursorHold :call s:UpdateSigns() - augroup END - endif - call s:UpdateSigns() - "echo 'EL out' string(s:handled_buffers) -endfun - -"Enable the plugin locally for the duration of timeout CursorHold -"events. Disable it, if it was not active or if force is 1. -func! s:EnableLocalOneTime( timeout, force ) - let idx = index(s:handled_buffers,bufnr('%')) - call s:EnableLocal() - if a:force || idx < 0 - let b:showmarks.timeout = a:timeout - augroup showmarks - au CursorHold let b:showmarks.timeout-=1 | if b:showmarks.timeout<=0 | exec 'silent! au! showmarks CursorHold '|call s:DisableLocal() | endif - augroup END - endif -endfun - - -func! s:DisableLocal() - "echo 'DL in' string(s:handled_buffers) - let idx = index(s:handled_buffers,bufnr('%')) - if idx >= 0 - silent! au! showmarks CursorHold - for id in filter(range(s:sign_id_incr,s:sign_id_incr+len(s:all_marks)-1),'has_key(b:showmarks,v:val)') - silent exec 'sign unplace '.id.' buffer='.bufnr('%') - endfor - silent! exec 'sign unplace '.s:bot_sign_id.' buffer='.bufnr('%') - silent! exec 'sign unplace '.s:top_sign_id.' buffer='.bufnr('%') - call remove(s:handled_buffers,idx) - unlet! b:showmarks - "if empty(s:handled_buffers) - " call s:DelSigns() - " let s:have_signs_defined = 0 - "endif - endif - "echo 'DL out' string(s:handled_buffers) -endfun - -func! s:EnableGlobal() - - silent! au! showmarks-DisableGlobal - augroup showmarks-EnableGlobal - au! - au BufRead,BufNewFile * :call s:EnableLocal() - for b in range(1,bufnr('$')) - if index(tabpagebuflist(),b) < 0 && buflisted(b) - exec 'au BufEnter :call s:EnableLocal()|au! showmarks-EnableGlobal BufEnter ' - endif - endfor - augroup END - - let win = winnr() - silent windo call s:EnableLocal() - exec win.'wincmd w' -endfun - -func! s:DisableGlobal() - - silent! au! showmarks-EnableGlobal - augroup showmarks-DisableGlobal - au! - for b in range(1,bufnr('$')) - if index(tabpagebuflist(),b) < 0 && buflisted(b) - exec 'au BufEnter :call s:DisableLocal()|au! showmarks-DisableGlobal BufEnter ' - endif - endfor - augroup END - - let win = winnr() - silent windo call s:DisableLocal() - exec win.'wincmd w' -endfun - - -func! s:ComparePVWLines( i1, i2 ) - "if a:i1.mark =~ '[A-Z0-9]' && a:i2.mark !~ '[A-Z0-9]' - " return 1 - "elseif a:i1.mark !~ '[A-Z0-9]' && a:i2.mark =~ '[A-Z0-9]' - " return -1 - "endif - return a:i1.lnum < a:i2.lnum ? -1 : a:i1.lnum > a:i2.lnum -endfun - - -func! s:DefSigns() - for m in s:all_marks - exec 'sign define '.s:sign_prefix.m.' text='.m.' texthl=hlShowMarks' - endfor -endfun - -func! s:DelSigns() - for m in s:all_marks - exec 'sign undefine '.s:sign_prefix.m - endfor - silent! exec 'sign undefine '.s:sign_prefix.'topline' - silent! exec 'sign undefine '.s:sign_prefix.'botline' -endfun - -finish -""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -map :DoShowMarks -map :NoShowMarks -map :DoShowMarks! -map :NoShowMarks! diff --git a/vim/bundle/showmarks/plugin/showmarks.vim b/vim/bundle/showmarks/plugin/showmarks.vim deleted file mode 100644 index 140ae10..0000000 --- a/vim/bundle/showmarks/plugin/showmarks.vim +++ /dev/null @@ -1,73 +0,0 @@ -" Display marks in the signs column -" Maintainer: A. Politz -" Last change: 2008-02-06 -" v0.1 -" -"ShowMarks -" -"Give a visual aid to navigate marks, by displaying them as signs -"(obviously needs the +signs feature). -" -"commands -"-------- -" -":DoShowMarks -" show marks for current buffer -":DoShowMarks! -" show marks for all buffers -":NoShowMarks -" disable it for current buffer -":NoShowMarks! -" disable it for all buffers -" -":[count]ShowMarksOnce -" Display marks for [count] Cursorhold -" events. Mostly for mapping it like : -" nnoremap ` :ShowMarksOnce` -" -":[count]PreviewMarks -" Display marks of current buffer in pvw. -" Like ':marks', but at the top of the window ;-). -" [count] is the same sa above. -" -"variables -"-------- -" -"let g:showmarks_marks = "abcdef...." -" the marks you want to have displayed. -"hlShowMarks -" the highlight color - -"I suggest to lower the value of 'updatetime'. - -if exists('loaded_showmarks') - finish -endif - -let s:cpo=&cpo -set cpo&vim - -let loaded_showmarks = 1 - -if version < 700 - com DoShowMarks echohl Error | echo "Sorry, you need vim7 for this plugin (Showmarks)." | echohl None | delc DoShowMarks - finish -endif - -if !has('signs') - com DoShowMarks - \echohl Error - \| echo "Sorry, your version does not support signs (Showmarks). You may still use the PreviewMarks command." - \| echohl None | delc DoShowMarks -else - com -bar -bang DoShowMarks - \if 0 | call showmarks#ShowMarks('global,enable') | else | call showmarks#ShowMarks('enable,local') | endif - com -bar -bang NoShowMarks - \if 0 | call showmarks#ShowMarks('global') | else | call showmarks#ShowMarks('') | endif - com -bar -bang -count=1 ShowMarksOnce call showmarks#ShowMarks('once',,0) -endif - -com! -bar -bang -count=0 PreviewMarks call showmarks#ShowMarks('preview',) - -let &cpo=s:cpo -unlet s:cpo diff --git a/vim/bundle/skwp-vim-colors-solarized b/vim/bundle/skwp-vim-colors-solarized new file mode 160000 index 0000000..864d3aa --- /dev/null +++ b/vim/bundle/skwp-vim-colors-solarized @@ -0,0 +1 @@ +Subproject commit 864d3aa422dbbcf5eb00b09edb003728e2da8ae1 diff --git a/vim/bundle/vim-colors-solarized b/vim/bundle/vim-colors-solarized deleted file mode 160000 index 528a59f..0000000 --- a/vim/bundle/vim-colors-solarized +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 528a59f26d12278698bb946f8fb82a63711eec21 diff --git a/vimrc b/vimrc index 68c1b8c..d9006ec 100644 --- a/vimrc +++ b/vimrc @@ -325,37 +325,25 @@ nnoremap ; : "Clear current search highlight by double tapping // nmap // :nohlsearch -" Use EasyMotion by double tapping comma -nmap ,, \\w -" Use EasyMotion backwards by z,, -nmap z,, \\b -" User LustyJuggler buffer switcher by hitting S -" and then using the homerow keys to select the file -" double tap the home row key to go to the file or hit -" once to just select it in the juggler -nmap S \lj -let g:LustyJugglerSuppressRubyWarning = 1 -let g:LustyJugglerAltTabMode = 1 -" Show me all my marks (using showmarks plugin) using \m -nnoremap m :PreviewMarks " copy current filename into system clipboard - mnemonic: (c)urrent(f)ilename " this is helpful to paste someone the path you're looking at nnoremap cf :let @* = expand("%:p") -" For fugitive.git, dp means :diffput. Define dg to mean :diffget -nnoremap dg :diffget - -" alias W to write the file instead of :w -nnoremap W :w +" General vim sanity improvements +" ======================================== " alias yw to yank the entire word even if the " cursor is inside the word nnoremap yw yaw +" alias W to write the file instead of :w +nnoremap W :w +" RSI Prevention - keyboard remaps +" ======================================== " in code, undescores and dashes are very commmon, but " the key is really far away. remap Apple-k to give us " underscores and Apple-Shift-K to give dashes. @@ -363,6 +351,15 @@ nnoremap yw yaw imap _ imap - + +" fugitive.git +" ======================================== +" For fugitive.git, dp means :diffput. Define dg to mean :diffget +nnoremap dg :diffget + + +" tComment +" ======================================== " extensions for tComment plugin. Normally " tComment maps 'gcc' to comment current line " this adds 'gcp' comment current paragraph (block) @@ -370,6 +367,32 @@ imap - nmap gcp p +" LustyJuggler +" ======================================== +" User LustyJuggler buffer switcher by hitting S +" and then using the homerow keys to select the file +" double tap the home row key to go to the file or hit +" once to just select it in the juggler +nmap S \lj +let g:LustyJugglerSuppressRubyWarning = 1 +let g:LustyJugglerAltTabMode = 1 +" Colors to make LustyJuggler more usable +" the Question color in LustyJuggler is mapped to +" the currently selected buffer. +hi clear Question +hi! Question guifg=yellow + + +" EasyMotion +" ======================================== +" Use EasyMotion by double tapping comma +nmap ,, \\w +" Use EasyMotion backwards by z,, +nmap z,, \\b +" Make EasyMotion more yellow, less red +hi clear EasyMotionTarget +hi! EasyMotionTarget guifg=yellow + " This remaps easymotion to show us only the left " hand home row keys as navigation options which " may mean more typing to get to a particular spot @@ -385,20 +408,16 @@ call EasyMotion#InitOptions({ \ , 'hl_group_shade' : 'EasyMotionShade' \ }) - -" FIXME: the color mods below do not properly -" load when solarized color scheme is used. They -" must be run individually (put cursor on line and -" hit Cc to run the command) -" -" Designed to make LustyJuggler more usable -" This affects the currently selected buffer -" unless run by itself (put cursor over these lines and hit Cc) -hi clear Question -hi! Question guifg=yellow - -" Make EasyMotion more yellow, less red -hi clear EasyMotionTarget -hi! EasyMotionTarget guifg=yellow - +" vim-ruby-conque +" ======================================== let g:ruby_conque_rspec_command='spec' + + +" ShowMarks +" ======================================== +" Tell showmarks to not include the various brace marks (),{}, etc +let g:showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY" + +" Tell showmarks to stop using the '>' indicator for marks +let g:showmarks_textlower="\t" +let g:showmarks_textupper="\t"