mirror of
https://github.com/gryf/.vim.git
synced 2025-12-18 03:50:30 +01:00
Removed unnecessary OverLength highlight
Added ColorColumn definition to wombat256grf colorscheme Added definition of ColorColumn for python filetype Downgrade pyflakes, because I don't want to have the errors in QF Wrapped substitutions with try: except blok in reST function blogify() Updated GetLatestVimScripts data file Updated plugins: vimwiki and vcscommand Removed pythoncomplete.vim since it is the same as the default form vim Removed colorschemes: lettuce and wombat256
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"
|
||||
" Maintainer: Bob Hiestand <bob.hiestand@gmail.com>
|
||||
" License:
|
||||
" Copyright (c) 2008 Bob Hiestand
|
||||
" Copyright (c) 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
|
||||
@@ -204,6 +204,10 @@
|
||||
" This variable, if set to a non-zero value, prevents the default command
|
||||
" mappings from being set for commands specific to an individual VCS.
|
||||
"
|
||||
" VCSCommandDisableMenu
|
||||
" This variable, if set to a non-zero value, prevents the default command
|
||||
" menu from being set.
|
||||
"
|
||||
" VCSCommandEdit
|
||||
" This variable controls whether to split the current window to display a
|
||||
" scratch buffer ('split'), or to display it in the current buffer ('edit').
|
||||
@@ -226,6 +230,12 @@
|
||||
" This allows customization of the mapping space used by the vcscommand
|
||||
" shortcuts.
|
||||
"
|
||||
" VCSCommandMenuPriority
|
||||
" This variable, if set, overrides the default menu priority '' (empty)
|
||||
"
|
||||
" VCSCommandMenuRoot
|
||||
" This variable, if set, overrides the default menu root 'Plugin.VCS'
|
||||
"
|
||||
" 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
|
||||
@@ -346,15 +356,6 @@ let s:optionOverrides = {}
|
||||
" state flag used to vary behavior of certain automated actions
|
||||
let s:isEditFileRunning = 0
|
||||
|
||||
" commands needed to restore diff buffers to their original state
|
||||
unlet! s:vimDiffRestoreCmd
|
||||
|
||||
" original buffer currently reflected in vimdiff windows
|
||||
unlet! s:vimDiffSourceBuffer
|
||||
|
||||
"
|
||||
unlet! s:vimDiffScratchList
|
||||
|
||||
" Section: Utility functions {{{1
|
||||
|
||||
" Function: s:ReportError(mapping) {{{2
|
||||
@@ -365,7 +366,7 @@ function! s:ReportError(error)
|
||||
echohl WarningMsg|echomsg 'VCSCommand: ' . a:error|echohl None
|
||||
endfunction
|
||||
|
||||
" Function s:VCSCommandUtility.system(...) {{{2
|
||||
" Function: s:VCSCommandUtility.system(...) {{{2
|
||||
" Replacement for system() function. This version protects the quoting in the
|
||||
" command line on Windows systems.
|
||||
|
||||
@@ -383,6 +384,23 @@ function! s:VCSCommandUtility.system(...)
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Function: s:VCSCommandUtility.addMenuItem(shortcut, command) {{{2
|
||||
" Adds the given menu item.
|
||||
|
||||
function! s:VCSCommandUtility.addMenuItem(shortcut, command)
|
||||
if s:menuEnabled
|
||||
exe 'amenu <silent> '.s:menuPriority.' '.s:menuRoot.'.'.a:shortcut.' '.a:command
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Function: s:ClearMenu() {{{2
|
||||
" Removes all VCSCommand menu items
|
||||
function! s:ClearMenu()
|
||||
if s:menuEnabled
|
||||
execute 'aunmenu' s:menuRoot
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Function: s:CreateMapping(shortcut, expansion, display) {{{2
|
||||
" Creates the given mapping by prepending the contents of
|
||||
" 'VCSCommandMapPrefix' (by default '<Leader>c') to the given shortcut and
|
||||
@@ -642,30 +660,30 @@ endfunction
|
||||
function! s:VimDiffRestore(vimDiffBuff)
|
||||
let s:isEditFileRunning += 1
|
||||
try
|
||||
if exists('s:vimDiffSourceBuffer')
|
||||
if a:vimDiffBuff == s:vimDiffSourceBuffer
|
||||
if exists('t:vcsCommandVimDiffSourceBuffer')
|
||||
if a:vimDiffBuff == t:vcsCommandVimDiffSourceBuffer
|
||||
" Original file is being removed.
|
||||
unlet! s:vimDiffSourceBuffer
|
||||
unlet! s:vimDiffRestoreCmd
|
||||
unlet! s:vimDiffScratchList
|
||||
unlet! t:vcsCommandVimDiffSourceBuffer
|
||||
unlet! t:vcsCommandVimDiffRestoreCmd
|
||||
unlet! t:vcsCommandVimDiffScratchList
|
||||
else
|
||||
let index = index(s:vimDiffScratchList, a:vimDiffBuff)
|
||||
let index = index(t:vcsCommandVimDiffScratchList, a:vimDiffBuff)
|
||||
if index >= 0
|
||||
call remove(s:vimDiffScratchList, index)
|
||||
if len(s:vimDiffScratchList) == 0
|
||||
if exists('s:vimDiffRestoreCmd')
|
||||
call remove(t:vcsCommandVimDiffScratchList, index)
|
||||
if len(t:vcsCommandVimDiffScratchList) == 0
|
||||
if exists('t:vcsCommandVimDiffRestoreCmd')
|
||||
" All scratch buffers are gone, reset the original.
|
||||
" Only restore if the source buffer is still in Diff mode
|
||||
|
||||
let sourceWinNR = bufwinnr(s:vimDiffSourceBuffer)
|
||||
let sourceWinNR = bufwinnr(t:vcsCommandVimDiffSourceBuffer)
|
||||
if sourceWinNR != -1
|
||||
" The buffer is visible in at least one window
|
||||
let currentWinNR = winnr()
|
||||
while winbufnr(sourceWinNR) != -1
|
||||
if winbufnr(sourceWinNR) == s:vimDiffSourceBuffer
|
||||
if winbufnr(sourceWinNR) == t:vcsCommandVimDiffSourceBuffer
|
||||
execute sourceWinNR . 'wincmd w'
|
||||
if getwinvar(0, '&diff')
|
||||
execute s:vimDiffRestoreCmd
|
||||
execute t:vcsCommandVimDiffRestoreCmd
|
||||
endif
|
||||
endif
|
||||
let sourceWinNR = sourceWinNR + 1
|
||||
@@ -675,18 +693,18 @@ function! s:VimDiffRestore(vimDiffBuff)
|
||||
" The buffer is hidden. It must be visible in order to set the
|
||||
" diff option.
|
||||
let currentBufNR = bufnr('')
|
||||
execute 'hide buffer' s:vimDiffSourceBuffer
|
||||
execute 'hide buffer' t:vcsCommandVimDiffSourceBuffer
|
||||
if getwinvar(0, '&diff')
|
||||
execute s:vimDiffRestoreCmd
|
||||
execute t:vcsCommandVimDiffRestoreCmd
|
||||
endif
|
||||
execute 'hide buffer' currentBufNR
|
||||
endif
|
||||
|
||||
unlet s:vimDiffRestoreCmd
|
||||
unlet t:vcsCommandVimDiffRestoreCmd
|
||||
endif
|
||||
" All buffers are gone.
|
||||
unlet s:vimDiffSourceBuffer
|
||||
unlet s:vimDiffScratchList
|
||||
unlet t:vcsCommandVimDiffSourceBuffer
|
||||
unlet t:vcsCommandVimDiffScratchList
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -886,9 +904,9 @@ function! s:VCSVimDiff(...)
|
||||
" If there's already a VimDiff'ed window, restore it.
|
||||
" There may only be one VCSVimDiff original window at a time.
|
||||
|
||||
if exists('s:vimDiffSourceBuffer') && s:vimDiffSourceBuffer != originalBuffer
|
||||
if exists('t:vcsCommandVimDiffSourceBuffer') && t:vcsCommandVimDiffSourceBuffer != originalBuffer
|
||||
" Clear the existing vimdiff setup by removing the result buffers.
|
||||
call s:WipeoutCommandBuffers(s:vimDiffSourceBuffer, 'vimdiff')
|
||||
call s:WipeoutCommandBuffers(t:vcsCommandVimDiffSourceBuffer, 'vimdiff')
|
||||
endif
|
||||
|
||||
let orientation = &diffopt =~ 'horizontal' ? 'horizontal' : 'vertical'
|
||||
@@ -898,8 +916,8 @@ function! s:VCSVimDiff(...)
|
||||
" Split and diff
|
||||
if(a:0 == 2)
|
||||
" Reset the vimdiff system, as 2 explicit versions were provided.
|
||||
if exists('s:vimDiffSourceBuffer')
|
||||
call s:WipeoutCommandBuffers(s:vimDiffSourceBuffer, 'vimdiff')
|
||||
if exists('t:vcsCommandVimDiffSourceBuffer')
|
||||
call s:WipeoutCommandBuffers(t:vcsCommandVimDiffSourceBuffer, 'vimdiff')
|
||||
endif
|
||||
let resultBuffer = s:VCSReview(a:1)
|
||||
if resultBuffer < 0
|
||||
@@ -908,7 +926,7 @@ function! s:VCSVimDiff(...)
|
||||
endif
|
||||
let b:VCSCommandCommand = 'vimdiff'
|
||||
diffthis
|
||||
let s:vimDiffScratchList = [resultBuffer]
|
||||
let t:vcsCommandVimDiffScratchList = [resultBuffer]
|
||||
" If no split method is defined, cheat, and set it to vertical.
|
||||
try
|
||||
call s:OverrideOption('VCSCommandSplit', orientation)
|
||||
@@ -922,7 +940,7 @@ function! s:VCSVimDiff(...)
|
||||
endif
|
||||
let b:VCSCommandCommand = 'vimdiff'
|
||||
diffthis
|
||||
let s:vimDiffScratchList += [resultBuffer]
|
||||
let t:vcsCommandVimDiffScratchList += [resultBuffer]
|
||||
else
|
||||
" Add new buffer
|
||||
call s:OverrideOption('VCSCommandEdit', 'split')
|
||||
@@ -948,16 +966,16 @@ function! s:VCSVimDiff(...)
|
||||
let b:VCSCommandCommand = 'vimdiff'
|
||||
diffthis
|
||||
|
||||
if !exists('s:vimDiffSourceBuffer')
|
||||
if !exists('t:vcsCommandVimDiffSourceBuffer')
|
||||
" New instance of vimdiff.
|
||||
let s:vimDiffScratchList = [resultBuffer]
|
||||
let t:vcsCommandVimDiffScratchList = [resultBuffer]
|
||||
|
||||
" This could have been invoked on a VCS result buffer, not the
|
||||
" original buffer.
|
||||
wincmd W
|
||||
execute 'buffer' originalBuffer
|
||||
" Store info for later original buffer restore
|
||||
let s:vimDiffRestoreCmd =
|
||||
let t:vcsCommandVimDiffRestoreCmd =
|
||||
\ 'call setbufvar('.originalBuffer.', ''&diff'', '.getbufvar(originalBuffer, '&diff').')'
|
||||
\ . '|call setbufvar('.originalBuffer.', ''&foldcolumn'', '.getbufvar(originalBuffer, '&foldcolumn').')'
|
||||
\ . '|call setbufvar('.originalBuffer.', ''&foldenable'', '.getbufvar(originalBuffer, '&foldenable').')'
|
||||
@@ -970,11 +988,11 @@ function! s:VCSVimDiff(...)
|
||||
wincmd w
|
||||
else
|
||||
" Adding a window to an existing vimdiff
|
||||
let s:vimDiffScratchList += [resultBuffer]
|
||||
let t:vcsCommandVimDiffScratchList += [resultBuffer]
|
||||
endif
|
||||
endif
|
||||
|
||||
let s:vimDiffSourceBuffer = originalBuffer
|
||||
let t:vcsCommandVimDiffSourceBuffer = originalBuffer
|
||||
|
||||
" Avoid executing the modeline in the current buffer after the autocommand.
|
||||
|
||||
@@ -1288,7 +1306,7 @@ com! VCSCommandDisableBufferSetup call VCSCommandDisableBufferSetup()
|
||||
com! VCSCommandEnableBufferSetup call VCSCommandEnableBufferSetup()
|
||||
|
||||
" Allow reloading VCSCommand.vim
|
||||
com! VCSReload let savedPlugins = s:plugins|let s:plugins = {}|aunmenu Plugin.VCS|unlet! g:loaded_VCSCommand|runtime plugin/vcscommand.vim|for plugin in values(savedPlugins)|execute 'source' plugin[0]|endfor|unlet savedPlugins
|
||||
com! VCSReload let savedPlugins = s:plugins|let s:plugins = {}|call s:ClearMenu()|unlet! g:loaded_VCSCommand|runtime plugin/vcscommand.vim|for plugin in values(savedPlugins)|execute 'source' plugin[0]|endfor|unlet savedPlugins
|
||||
|
||||
" Section: Plugin command mappings {{{1
|
||||
nnoremap <silent> <Plug>VCSAdd :VCSAdd<CR>
|
||||
@@ -1332,24 +1350,36 @@ let s:defaultMappings = [
|
||||
\]
|
||||
|
||||
if !VCSCommandGetOption('VCSCommandDisableMappings', 0)
|
||||
for [shortcut, vcsFunction] in VCSCommandGetOption('VCSCommandMappings', s:defaultMappings)
|
||||
call s:CreateMapping(shortcut, '<Plug>' . vcsFunction, '''' . vcsFunction . '''')
|
||||
for [s:shortcut, s:vcsFunction] in VCSCommandGetOption('VCSCommandMappings', s:defaultMappings)
|
||||
call s:CreateMapping(s:shortcut, '<Plug>' . s:vcsFunction, '''' . s:vcsFunction . '''')
|
||||
endfor
|
||||
unlet s:shortcut s:vcsFunction
|
||||
endif
|
||||
unlet s:defaultMappings
|
||||
|
||||
" Section: Menu items {{{1
|
||||
amenu <silent> &Plugin.VCS.&Add <Plug>VCSAdd
|
||||
amenu <silent> &Plugin.VCS.A&nnotate <Plug>VCSAnnotate
|
||||
amenu <silent> &Plugin.VCS.&Commit <Plug>VCSCommit
|
||||
amenu <silent> &Plugin.VCS.Delete <Plug>VCSDelete
|
||||
amenu <silent> &Plugin.VCS.&Diff <Plug>VCSDiff
|
||||
amenu <silent> &Plugin.VCS.&Info <Plug>VCSInfo
|
||||
amenu <silent> &Plugin.VCS.&Log <Plug>VCSLog
|
||||
amenu <silent> &Plugin.VCS.Revert <Plug>VCSRevert
|
||||
amenu <silent> &Plugin.VCS.&Review <Plug>VCSReview
|
||||
amenu <silent> &Plugin.VCS.&Status <Plug>VCSStatus
|
||||
amenu <silent> &Plugin.VCS.&Update <Plug>VCSUpdate
|
||||
amenu <silent> &Plugin.VCS.&VimDiff <Plug>VCSVimDiff
|
||||
|
||||
let s:menuEnabled = !VCSCommandGetOption('VCSCommandDisableMenu', 0)
|
||||
let s:menuRoot = VCSCommandGetOption('VCSCommandMenuRoot', '&Plugin.VCS')
|
||||
let s:menuPriority = VCSCommandGetOption('VCSCommandMenuPriority', '')
|
||||
|
||||
for [s:shortcut, s:command] in [
|
||||
\['&Add', '<Plug>VCSAdd'],
|
||||
\['A&nnotate', '<Plug>VCSAnnotate'],
|
||||
\['&Commit', '<Plug>VCSCommit'],
|
||||
\['Delete', '<Plug>VCSDelete'],
|
||||
\['&Diff', '<Plug>VCSDiff'],
|
||||
\['&Info', '<Plug>VCSInfo'],
|
||||
\['&Log', '<Plug>VCSLog'],
|
||||
\['Revert', '<Plug>VCSRevert'],
|
||||
\['&Review', '<Plug>VCSReview'],
|
||||
\['&Status', '<Plug>VCSStatus'],
|
||||
\['&Update', '<Plug>VCSUpdate'],
|
||||
\['&VimDiff', '<Plug>VCSVimDiff']
|
||||
\]
|
||||
call s:VCSCommandUtility.addMenuItem(s:shortcut, s:command)
|
||||
endfor
|
||||
unlet s:shortcut s:command
|
||||
|
||||
" Section: Autocommands to restore vimdiff state {{{1
|
||||
augroup VimDiffRestore
|
||||
|
||||
Reference in New Issue
Block a user