Permalink
Browse files

Merge branch 'master' of github.com:lilydjwg/dotvim

  • Loading branch information...
2 parents ed6bc43 + 0df6cdd commit b4449ecdb33c4a06dd5d8c85eff17202c3185fb7 @lilydjwg committed Oct 23, 2012
Showing with 60 additions and 31 deletions.
  1. +23 −3 autoload/gundo.vim
  2. +33 −20 doc/gundo.txt
  3. +1 −0 doc/tags
  4. +1 −6 ftplugin/c/candcpp.vim
  5. +2 −2 plugin/pushpop.vim
View
@@ -46,6 +46,9 @@ endif"}}}
if !exists("g:gundo_prefer_python3")"{{{
let g:gundo_prefer_python3 = 0
endif"}}}
+if !exists("g:gundo_auto_preview")"{{{
+ let g:gundo_auto_preview = 1
+endif"}}}
let s:has_supported_python = 0
if g:gundo_prefer_python3 && has('python3')"{{{
@@ -111,6 +114,7 @@ function! s:GundoMapGraph()"{{{
nnoremap <script> <silent> <buffer> gg gg:call <sid>GundoMove(1)<CR>
nnoremap <script> <silent> <buffer> P :call <sid>GundoPlayTo()<CR>
nnoremap <script> <silent> <buffer> p :call <sid>GundoRenderChangePreview()<CR>
+ nnoremap <script> <silent> <buffer> r :call <sid>GundoRenderPreview()<CR>
nnoremap <script> <silent> <buffer> q :call <sid>GundoClose()<CR>
cabbrev <script> <silent> <buffer> q call <sid>GundoClose()
cabbrev <script> <silent> <buffer> quit call <sid>GundoClose()
@@ -318,11 +322,17 @@ function! s:GundoToggle()"{{{
endfunction"}}}
function! s:GundoShow()"{{{
- call s:GundoOpen()
+ if !s:GundoIsVisible()
+ let g:gundo_target_n = bufnr('')
+ let g:gundo_target_f = @%
+ call s:GundoOpen()
+ endif
endfunction"}}}
function! s:GundoHide()"{{{
- call s:GundoClose()
+ if s:GundoIsVisible()
+ call s:GundoClose()
+ endif
endfunction"}}}
"}}}
@@ -377,7 +387,9 @@ function! s:GundoMove(direction) range"{{{
call cursor(0, idx2 + 1)
endif
- call s:GundoRenderPreview()
+ if g:gundo_auto_preview == 1
+ call s:GundoRenderPreview()
+ endif
endfunction"}}}
"}}}
@@ -436,6 +448,14 @@ function! gundo#GundoToggle()"{{{
call s:GundoToggle()
endfunction"}}}
+function! gundo#GundoShow()"{{{
+ call s:GundoShow()
+endfunction"}}}
+
+function! gundo#GundoHide()"{{{
+ call s:GundoHide()
+endfunction"}}}
+
function! gundo#GundoRenderGraph()"{{{
call s:GundoRenderGraph()
endfunction"}}}
View
@@ -5,25 +5,26 @@ Making Vim's undo tree usable by humans.
==============================================================================
CONTENTS *Gundo-contents*
- 1. Intro .......................... |GundoIntro|
- 2. Usage .......................... |GundoUsage|
- 3. Configuration .................. |GundoConfig|
- 3.1 gundo_width ............... |gundo_width|
- 3.2 gundo_preview_height ...... |gundo_preview_height|
- 3.3 gundo_preview_bottom ...... |gundo_preview_bottom|
- 3.4 gundo_right ............... |gundo_right|
- 3.5 gundo_help ................ |gundo_help|
- 3.6 gundo_disable ............. |gundo_disable|
- 3.7 gundo_map_move_older ...... |gundo_map_move_older|
- gundo_map_move_newer ...... |gundo_map_move_newer|
- 3.8 gundo_close_on_revert ..... |gundo_close_on_revert|
- 3.9 gundo_preview_statusline .. |gundo_preview_statusline|
- gundo_tree_statusline ..... |gundo_tree_statusline|
- 4. License ........................ |GundoLicense|
- 5. Bugs ........................... |GundoBugs|
- 6. Contributing ................... |GundoContributing|
- 7. Changelog ...................... |GundoChangelog|
- 8. Credits ........................ |GundoCredits|
+ 1. Intro ........................... |GundoIntro|
+ 2. Usage ........................... |GundoUsage|
+ 3. Configuration ................... |GundoConfig|
+ 3.1 gundo_width ............... |gundo_width|
+ 3.2 gundo_preview_height ...... |gundo_preview_height|
+ 3.3 gundo_preview_bottom ...... |gundo_preview_bottom|
+ 3.4 gundo_right ............... |gundo_right|
+ 3.5 gundo_help ................ |gundo_help|
+ 3.6 gundo_disable ............. |gundo_disable|
+ 3.7 gundo_map_move_older ...... |gundo_map_move_older|
+ gundo_map_move_newer ...... |gundo_map_move_newer|
+ 3.8 gundo_close_on_revert ..... |gundo_close_on_revert|
+ 3.9 gundo_preview_statusline .. |gundo_preview_statusline|
+ gundo_tree_statusline ..... |gundo_tree_statusline|
+ 3.10 gundo_auto_preview ........ |gundo_auto_preview|
+ 4. License ......................... |GundoLicense|
+ 5. Bugs ............................ |GundoBugs|
+ 6. Contributing .................... |GundoContributing|
+ 7. Changelog ....................... |GundoChangelog|
+ 8. Credits ......................... |GundoCredits|
==============================================================================
1. Intro *GundoIntro*
@@ -206,6 +207,15 @@ Set these to a string to display it as the status line for each Gundo window.
Default: unset (windows use the default statusline)
+------------------------------------------------------------------------------
+3.10 g:gundo_auto_preview *gundo_auto_preview*
+
+Set this to 0 to disable automatically rendering preview diffs as you move
+through the undo tree (you can still render a specific diff with r). This can
+be useful on large files and undo trees to speed up Gundo.
+
+Default: 1 (automatically preview diffs)
+
==============================================================================
4. License *GundoLicense*
@@ -228,7 +238,10 @@ GitHub: http://github.com/sjl/gundo.vim/
==============================================================================
7. Changelog *GundoChangelog*
-
+v2.4.0
+ * Add auto preview option.
+ * Add 'r' mapping to preview current state.
+ * Add public gundo#GundoShow() and gundo#GundoHide() functions.
v2.3.0
* Add statusline configuration.
v2.2.2
View
@@ -1015,6 +1015,7 @@ g:vimwiki_w32_dir_enc vimwiki.txt /*g:vimwiki_w32_dir_enc*
g:visincr_datedivset visincr.txt /*g:visincr_datedivset*
global_markfilelist pi_netrw.txt /*global_markfilelist*
gundo.txt gundo.txt /*gundo.txt*
+gundo_auto_preview gundo.txt /*gundo_auto_preview*
gundo_close_on_revert gundo.txt /*gundo_close_on_revert*
gundo_disable gundo.txt /*gundo_disable*
gundo_help gundo.txt /*gundo_help*
View
@@ -39,13 +39,8 @@ endfunction
function! Lilydjwg_c_noCStyle()
let pos = getpos('.')
" 将 C 风格的代码改成我喜欢的样式
- let f = tempname()
- sil exe "w ".f
- call system("indent -bap -br -brf -brs -ce -cdw -nlp -ci4 -nss -npcs -ncss -nsaf -npsl -nsai -nsaw -nprs -ppi 3 -sc ".f)
- %d
- sil exe 'r '.f
+ %!indent -bap -br -brf -brs -ce -cdw -nlp -ci4 -nss -npcs -ncss -nsaf -npsl -nsai -nsaw -nprs -ppi 3 -sc
setlocal nofoldenable
- 1d
sil %s/)\s\+{/){/ge
sil %s/\v\}\s+else(\s|\{|)@=/}else/ge
sil %s/\v(\s|}|)@<=else\s+\{/else{/ge
View
@@ -37,11 +37,11 @@ function s:pop()
endfunction
function s:pplist()
if len(g:stack) == 0
- echohl WarningMsg | echo "Nothing in poppush stack yet." | echohl None
+ echohl WarningMsg | echo "Nothing in pushpop stack yet." | echohl None
return
endif
- echohl PreProc | echo "Current poppush stack:"
+ echohl PreProc | echo "Current pushpop stack:"
echohl Title | echo "#\t line\tbuf\n" | echohl None
let i = 1
for posinfo in g:stack

0 comments on commit b4449ec

Please sign in to comment.