mirror of
https://github.com/gryf/.vim.git
synced 2025-12-17 11:30:29 +01:00
Update of plugins DirDiff, gundo and buffergator, update colorscheme lucius.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
" -*- vim -*-
|
||||
" FILE: "/home/wlee/.vim/plugin/DirDiff.vim" {{{
|
||||
" LAST MODIFICATION: "Mon, 20 Oct 2008 09:04:59 -0500 (wlee)"
|
||||
" LAST MODIFICATION: "Fri, 29 Jul 2011 08:30:07 -0500 (wlee)"
|
||||
" HEADER MAINTAINED BY: N/A
|
||||
" VERSION: 1.1.3
|
||||
" (C) 2001-2010 by William Lee, <wl1012@yahoo.com>
|
||||
" VERSION: 1.1.4
|
||||
" (C) 2001-2011 by William Lee, <wl1012@yahoo.com>
|
||||
" }}}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
" William Lee <wl1012@yahoo.com>
|
||||
"
|
||||
" LICENSE:
|
||||
" Copyright (c) 2001-2006 William Lee
|
||||
" Copyright (c) 2001-2011 William Lee
|
||||
" All rights reserved.
|
||||
"
|
||||
" Redistribution and use in source and binary forms, with or without
|
||||
@@ -151,6 +151,7 @@
|
||||
" Salman Halim, Yosuke Kimura, and others for their suggestions
|
||||
"
|
||||
" HISTORY:
|
||||
" 1.1.4 - Fixed split windows problems caused by some .vimrc settings.
|
||||
" 1.1.3 - Applied the patch to 1.1.2 by Wu WeiWei in order to make diff
|
||||
" that's localized in Chinese work.
|
||||
" 1.1.2 - Applied the patch to 1.1.0 instead of 1.0.2. Please do not use
|
||||
@@ -386,7 +387,7 @@ function! <SID>DirDiff(srcA, srcB)
|
||||
echo "Diffing directories, it may take a while..."
|
||||
let error = <SID>DirDiffExec(cmd, 0)
|
||||
if (error == 0)
|
||||
echo "There is no diff here."
|
||||
redraw | echom "diff found no differences - directories match."
|
||||
return
|
||||
endif
|
||||
silent exe "edit ".DiffBuffer
|
||||
@@ -513,6 +514,17 @@ function! <SID>CloseDiffWindows()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! <SID>EscapeFileName(path)
|
||||
if (v:version >= 702)
|
||||
return fnameescape(a:path)
|
||||
else
|
||||
" This is not a complete list of escaped character, so it's
|
||||
" not as sophisicated as the fnameescape, but this should
|
||||
" cover most of the cases and should work for Vim version <
|
||||
" 7.2
|
||||
return escape(a:path, " \t\n*?[{`$\\%#'\"|!<")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! <SID>DirDiffOpen()
|
||||
" First dehighlight the last marked
|
||||
@@ -526,8 +538,15 @@ function! <SID>DirDiffOpen()
|
||||
let dirA = <SID>GetBaseDir("A")
|
||||
let dirB = <SID>GetBaseDir("B")
|
||||
|
||||
" Save the number of this window, to which we wish to return
|
||||
" This is required in case there are other windows open
|
||||
let thisWindow = winnr()
|
||||
|
||||
call <SID>CloseDiffWindows()
|
||||
|
||||
" Ensure we're in the right window
|
||||
exec thisWindow.'wincmd w'
|
||||
|
||||
let line = getline(".")
|
||||
" Parse the line and see whether it's a "Only in" or "Files Differ"
|
||||
call <SID>HighlightLine()
|
||||
@@ -543,7 +562,7 @@ function! <SID>DirDiffOpen()
|
||||
endif
|
||||
split
|
||||
wincmd k
|
||||
silent exec "edit ".fnameescape(fileToOpen)
|
||||
silent exec "edit ". <SID>EscapeFileName(fileToOpen)
|
||||
" Fool the window saying that this is diff
|
||||
diffthis
|
||||
wincmd j
|
||||
@@ -554,8 +573,15 @@ function! <SID>DirDiffOpen()
|
||||
"Open the diff windows
|
||||
split
|
||||
wincmd k
|
||||
silent exec "edit ".fnameescape(fileB)
|
||||
silent exec "vert diffsplit ".fnameescape(fileA)
|
||||
silent exec "edit ".<SID>EscapeFileName(fileB)
|
||||
|
||||
" To ensure that A is on the left and B on the right, splitright must be off
|
||||
" let saved_splitright = &splitright
|
||||
" set nosplitright
|
||||
" silent exec "vert diffsplit ".<SID>EscapeFileName(fileA)
|
||||
" let &splitright = saved_splitright
|
||||
silent exec "leftabove vert diffsplit ".<SID>EscapeFileName(fileA)
|
||||
|
||||
" Go back to the diff window
|
||||
wincmd j
|
||||
" Resize the window
|
||||
|
||||
@@ -772,7 +772,7 @@ function! s:NewCatalogViewer()
|
||||
let b:buffergator_last_render_time = localtime()
|
||||
try
|
||||
" remove extra last line
|
||||
execute("normal! GVX")
|
||||
execute('normal! GV"_X')
|
||||
catch //
|
||||
endtry
|
||||
setlocal nomodifiable
|
||||
|
||||
@@ -14,7 +14,8 @@ import sys
|
||||
import time
|
||||
import vim
|
||||
|
||||
# Mercurial's graphlog code
|
||||
|
||||
# Mercurial's graphlog code --------------------------------------------------------
|
||||
def asciiedges(seen, rev, parents):
|
||||
"""adds edge info to changelog DAG walk suitable for ascii()"""
|
||||
if rev not in seen:
|
||||
@@ -193,8 +194,8 @@ def generate(dag, edgefn, current):
|
||||
ascii(buf, state, 'C', char, [line], edgefn(seen, node, parents))
|
||||
return buf.b
|
||||
|
||||
# Mercurial age function
|
||||
|
||||
# Mercurial age function -----------------------------------------------------------
|
||||
agescales = [("year", 3600 * 24 * 365),
|
||||
("month", 3600 * 24 * 30),
|
||||
("week", 3600 * 24 * 7),
|
||||
@@ -227,8 +228,8 @@ def age(ts):
|
||||
if n >= 2 or s == 1:
|
||||
return '%s ago' % fmt(t, n)
|
||||
|
||||
# Python Vim utility functions
|
||||
|
||||
# Python Vim utility functions -----------------------------------------------------
|
||||
normal = lambda s: vim.command('normal %s' % s)
|
||||
|
||||
MISSING_BUFFER = "Cannot find Gundo's target buffer (%s)"
|
||||
@@ -278,8 +279,8 @@ INLINE_HELP = '''\
|
||||
|
||||
'''
|
||||
|
||||
# Python undo tree data structures and functions
|
||||
|
||||
# Python undo tree data structures and functions -----------------------------------
|
||||
class Buffer(object):
|
||||
def __init__(self):
|
||||
self.b = ''
|
||||
@@ -325,10 +326,10 @@ def changenr(nodes):
|
||||
current = int(vim.eval('changenr()'))
|
||||
return current
|
||||
|
||||
# Gundo rendering
|
||||
|
||||
# Gundo rendering ------------------------------------------------------------------
|
||||
|
||||
# Rendering utility functions
|
||||
|
||||
def _fmt_time(t):
|
||||
return time.strftime('%Y-%m-%d %I:%M:%S %p', time.localtime(float(t)))
|
||||
|
||||
@@ -499,8 +500,8 @@ def GundoRenderChangePreview():
|
||||
|
||||
_goto_window_for_buffer_name('__Gundo__')
|
||||
|
||||
# Gundo undo/redo
|
||||
|
||||
# Gundo undo/redo
|
||||
def GundoRevert():
|
||||
if not _check_sanity():
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user