mirror of
https://github.com/vim/vim
synced 2025-07-15 16:51:57 +00:00
Update runtime files.
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Perform Ada specific completion & tagging.
|
||||
" Language: Ada (2005)
|
||||
" $Id$
|
||||
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
|
||||
" Taylor Venable <taylor@metasyntax.net>
|
||||
" Neil Bird <neil@fnxweb.com>
|
||||
" Ned Okie <nokie@radford.edu>
|
||||
" $Author$
|
||||
" $Date$
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6
|
||||
" $Revision$
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $
|
||||
" History: 24.05.2006 MK Unified Headers
|
||||
" 26.05.2006 MK ' should not be in iskeyword.
|
||||
|
@ -1,12 +1,12 @@
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Vim Ada omnicompletion file
|
||||
" Language: Ada (2005)
|
||||
" $Id$
|
||||
" $Id: adacomplete.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Maintainer: Martin Krischik
|
||||
" $Author$
|
||||
" $Date$
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6
|
||||
" $Revision$
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/adacomplete.vim $
|
||||
" History: 24.05.2006 MK Unified Headers
|
||||
" 26.05.2006 MK improved search for begin of word.
|
||||
|
@ -1,13 +1,13 @@
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Vim Ada/Dec Ada compiler file
|
||||
" Language: Ada (Dec Ada)
|
||||
" $Id$
|
||||
" $Id: decada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Copyright: Copyright (C) 2006 Martin Krischik
|
||||
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
|
||||
" $Author$
|
||||
" $Date$
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6
|
||||
" $Revision$
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $
|
||||
" History: 21.07.2006 MK New Dec Ada
|
||||
" 15.10.2006 MK Bram's suggestion for runtime integration
|
||||
|
@ -1,8 +1,8 @@
|
||||
" ---------------------------------------------------------------------
|
||||
" getscript.vim
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: Jul 10, 2008
|
||||
" Version: 31
|
||||
" Date: Dec 28, 2009
|
||||
" Version: 32
|
||||
" Installing: :help glvs-install
|
||||
" Usage: :help glvs
|
||||
"
|
||||
@ -12,19 +12,24 @@
|
||||
" Initialization: {{{1
|
||||
" if you're sourcing this file, surely you can't be
|
||||
" expecting vim to be in its vi-compatible mode!
|
||||
if exists("g:loaded_getscript")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_getscript= "v32"
|
||||
if &cp
|
||||
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
|
||||
finish
|
||||
endif
|
||||
if v:version < 702
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of getscript needs vim 7.2"
|
||||
echohl Normal
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
"DechoTabOn
|
||||
|
||||
if exists("g:loaded_getscript")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_getscript= "v31"
|
||||
|
||||
" ---------------------------
|
||||
" Global Variables: {{{1
|
||||
" ---------------------------
|
||||
@ -40,25 +45,6 @@ if !exists("g:getscript_cygwin")
|
||||
let g:getscript_cygwin= 0
|
||||
endif
|
||||
endif
|
||||
" shell quoting character {{{2
|
||||
if exists("g:netrw_shq") && !exists("g:getscript_shq")
|
||||
let g:getscript_shq= g:netrw_shq
|
||||
elseif !exists("g:getscript_shq")
|
||||
if exists("&shq") && &shq != ""
|
||||
let g:getscript_shq= &shq
|
||||
elseif exists("&sxq") && &sxq != ""
|
||||
let g:getscript_shq= &sxq
|
||||
elseif has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if g:getscript_cygwin
|
||||
let g:getscript_shq= "'"
|
||||
else
|
||||
let g:getscript_shq= '"'
|
||||
endif
|
||||
else
|
||||
let g:getscript_shq= "'"
|
||||
endif
|
||||
" call Decho("g:getscript_shq<".g:getscript_shq.">")
|
||||
endif
|
||||
|
||||
" wget vs curl {{{2
|
||||
if !exists("g:GetLatestVimScripts_wget")
|
||||
@ -112,7 +98,9 @@ if g:GetLatestVimScripts_allowautoinstall
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
|
||||
if exists("g:GetLatestVimScripts_autoinstalldir") && isdirectory(g:GetLatestVimScripts_autoinstalldir)
|
||||
let s:autoinstall= g:GetLatestVimScripts_autoinstalldir"
|
||||
elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
|
||||
let s:autoinstall= $HOME."/".s:dotvim
|
||||
endif
|
||||
" call Decho("s:autoinstall<".s:autoinstall.">")
|
||||
@ -165,7 +153,6 @@ fun! getscript#GetLatestVimScripts()
|
||||
" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory")
|
||||
return
|
||||
endif
|
||||
|
||||
if filewritable(datadir) != 2
|
||||
echoerr "(getLatestVimScripts) Your ".datadir." isn't writable"
|
||||
" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">")
|
||||
@ -182,21 +169,29 @@ fun! getscript#GetLatestVimScripts()
|
||||
" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">")
|
||||
return
|
||||
endif
|
||||
" --------------------
|
||||
" Passed sanity checks
|
||||
" --------------------
|
||||
|
||||
" call Decho("datadir <".datadir.">")
|
||||
" call Decho("datafile <".datafile.">")
|
||||
|
||||
" don't let any events interfere (like winmanager's, taglist's, etc)
|
||||
let eikeep= &ei
|
||||
let hlskeep= &hls
|
||||
set ei=all hls&vim
|
||||
" don't let any event handlers interfere (like winmanager's, taglist's, etc)
|
||||
let eikeep = &ei
|
||||
let hlskeep = &hls
|
||||
let acdkeep = &acd
|
||||
set ei=all hls&vim noacd
|
||||
|
||||
" record current directory, change to datadir, open split window with
|
||||
" datafile
|
||||
" Edit the datafile (ie. GetLatestVimScripts.dat):
|
||||
" 1. record current directory (origdir),
|
||||
" 2. change directory to datadir,
|
||||
" 3. split window
|
||||
" 4. edit datafile
|
||||
let origdir= getcwd()
|
||||
" call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge')))
|
||||
exe "cd ".fnameescape(substitute(datadir,'\','/','ge'))
|
||||
split
|
||||
" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge')))
|
||||
" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge')))
|
||||
exe "e ".fnameescape(substitute(datafile,'\','/','ge'))
|
||||
res 1000
|
||||
let s:downloads = 0
|
||||
@ -207,69 +202,68 @@ fun! getscript#GetLatestVimScripts()
|
||||
" call Decho("searching plugins for GetLatestVimScripts dependencies")
|
||||
let lastline = line("$")
|
||||
" call Decho("lastline#".lastline)
|
||||
let plugins = split(globpath(&rtp,"plugin/*.vim"),'\n')
|
||||
let firstdir = substitute(&rtp,',.*$','','')
|
||||
let plugins = split(globpath(firstdir,"plugin/*.vim"),'\n')
|
||||
let plugins = plugins + split(globpath(firstdir,"AsNeeded/*.vim"),'\n')
|
||||
let foundscript = 0
|
||||
let firstdir= ""
|
||||
|
||||
" this loop updates the GetLatestVimScripts.dat file
|
||||
" with dependencies explicitly mentioned in the plugins
|
||||
" via GetLatestVimScripts: ... lines
|
||||
" It reads the plugin script at the end of the GetLatestVimScripts.dat
|
||||
" file, examines it, and then removes it.
|
||||
for plugin in plugins
|
||||
" call Decho(" ")
|
||||
" call Decho("plugin<".plugin.">")
|
||||
|
||||
" don't process plugins in system directories
|
||||
if firstdir == ""
|
||||
let firstdir= substitute(plugin,'[/\\][^/\\]\+$','','')
|
||||
" call Decho("setting firstdir<".firstdir.">")
|
||||
else
|
||||
let curdir= substitute(plugin,'[/\\][^/\\]\+$','','')
|
||||
" call Decho("curdir<".curdir.">")
|
||||
if curdir != firstdir
|
||||
" call Decho("skipping subsequent plugins: curdir<".curdir."> != firstdir<".firstdir.">")
|
||||
break
|
||||
endif
|
||||
endif
|
||||
|
||||
" read plugin in
|
||||
" evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it
|
||||
$
|
||||
" call Decho(" ")
|
||||
" call Decho(".dependency checking<".plugin."> line$=".line("$"))
|
||||
" call Decho("exe silent r ".fnameescape(plugin))
|
||||
" call Decho("..exe silent r ".fnameescape(plugin))
|
||||
exe "silent r ".fnameescape(plugin)
|
||||
exe "silent bwipe ".bufnr("#")
|
||||
|
||||
while search('^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+','W') != 0
|
||||
let newscript= substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e')
|
||||
let llp1 = lastline+1
|
||||
" call Decho("..newscript<".newscript.">")
|
||||
let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e')
|
||||
let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','')
|
||||
let llp1 = lastline+1
|
||||
" call Decho("..depscript<".depscript.">")
|
||||
|
||||
" don't process ""GetLatestVimScripts lines -- those that have been doubly-commented out
|
||||
if newscript !~ '^"'
|
||||
" found a "GetLatestVimScripts: # #" line in the script; check if its already in the datafile
|
||||
let curline = line(".")
|
||||
let noai_script = substitute(newscript,'\s*:AutoInstall:\s*','','e')
|
||||
exe llp1
|
||||
let srchline = search('\<'.noai_script.'\>','bW')
|
||||
" call Decho("..noai_script<".noai_script."> srch=".srchline."curline#".line(".")." lastline#".lastline)
|
||||
|
||||
if srchline == 0
|
||||
" found a new script to permanently include in the datafile
|
||||
let keep_rega = @a
|
||||
let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','')
|
||||
exe lastline."put a"
|
||||
echomsg "Appending <".@a."> to ".datafile." for ".newscript
|
||||
" call Decho("..APPEND (".noai_script.")<".@a."> to GetLatestVimScripts.dat")
|
||||
let @a = keep_rega
|
||||
let lastline = llp1
|
||||
let curline = curline + 1
|
||||
let foundscript = foundscript + 1
|
||||
" else " Decho
|
||||
" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")")
|
||||
endif
|
||||
|
||||
let curline = curline + 1
|
||||
exe curline
|
||||
" found a "GetLatestVimScripts: # #" line in the script;
|
||||
" check if its already in the datafile by searching backwards from llp1,
|
||||
" the (prior to reading in the plugin script) last line plus one of the GetLatestVimScripts.dat file,
|
||||
" for the script-id with no wrapping allowed.
|
||||
let curline = line(".")
|
||||
let noai_script = substitute(depscript,'\s*:AutoInstall:\s*','','e')
|
||||
exe llp1
|
||||
let srchline = search('^\s*'.depscriptid.'\s\+\d\+\s\+.*$','bW')
|
||||
if srchline == 0
|
||||
" this second search is taken when, for example, a 0 0 scriptname is to be skipped over
|
||||
let srchline= search('\<'.noai_script.'\>','bW')
|
||||
endif
|
||||
" call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline)
|
||||
|
||||
if srchline == 0
|
||||
" found a new script to permanently include in the datafile
|
||||
let keep_rega = @a
|
||||
let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','')
|
||||
echomsg "Appending <".@a."> to ".datafile." for ".depscript
|
||||
" call Decho("..Appending <".@a."> to ".datafile." for ".depscript)
|
||||
exe lastline."put a"
|
||||
let @a = keep_rega
|
||||
let lastline = llp1
|
||||
let curline = curline + 1
|
||||
let foundscript = foundscript + 1
|
||||
" else " Decho
|
||||
" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")")
|
||||
endif
|
||||
|
||||
let curline = curline + 1
|
||||
exe curline
|
||||
endwhile
|
||||
|
||||
" llp1: last line plus one
|
||||
let llp1= lastline + 1
|
||||
" call Decho(".deleting lines: ".llp1.",$d")
|
||||
exe "silent! ".llp1.",$d"
|
||||
@ -282,7 +276,9 @@ fun! getscript#GetLatestVimScripts()
|
||||
setlocal nomod
|
||||
endif
|
||||
|
||||
" --------------------------------------------------------------------
|
||||
" Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat
|
||||
" --------------------------------------------------------------------
|
||||
" call Decho("begin: checking out-of-date scripts using datafile<".datafile.">")
|
||||
setlocal lz
|
||||
1
|
||||
@ -322,8 +318,9 @@ fun! getscript#GetLatestVimScripts()
|
||||
|
||||
" restore events and current directory
|
||||
exe "cd ".fnameescape(substitute(origdir,'\','/','ge'))
|
||||
let &ei= eikeep
|
||||
let &hls= hlskeep
|
||||
let &ei = eikeep
|
||||
let &hls = hlskeep
|
||||
let &acd = acdkeep
|
||||
setlocal nolz
|
||||
" call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!")
|
||||
" call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
|
||||
@ -333,7 +330,7 @@ endfun
|
||||
" GetOneScript: (Get Latest Vim Script) this function operates {{{1
|
||||
" on the current line, interpreting two numbers and text as
|
||||
" ScriptID, SourceID, and Filename.
|
||||
" It downloads any scripts that have newer versions from vim.sf.net.
|
||||
" It downloads any scripts that have newer versions from vim.sourceforge.net.
|
||||
fun! s:GetOneScript(...)
|
||||
" call Dfunc("GetOneScript()")
|
||||
|
||||
@ -391,6 +388,7 @@ fun! s:GetOneScript(...)
|
||||
" call Decho("fname <".fname.">")
|
||||
endif
|
||||
|
||||
" plugin author protection from downloading his/her own scripts atop their latest work
|
||||
if scriptid == 0 || srcid == 0
|
||||
" When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname
|
||||
let @a= rega
|
||||
@ -416,21 +414,21 @@ fun! s:GetOneScript(...)
|
||||
" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid)
|
||||
echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid
|
||||
|
||||
" grab a copy of the plugin's vim.sf.net webpage
|
||||
let scriptaddr = 'http://vim.sf.net/script.php?script_id='.scriptid
|
||||
" grab a copy of the plugin's vim.sourceforge.net webpage
|
||||
let scriptaddr = 'http://vim.sourceforge.net/script.php?script_id='.scriptid
|
||||
let tmpfile = tempname()
|
||||
let v:errmsg = ""
|
||||
|
||||
" make up to three tries at downloading the description
|
||||
let itry= 1
|
||||
while itry <= 3
|
||||
" call Decho("try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
|
||||
" call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
|
||||
if has("win32") || has("win16") || has("win95")
|
||||
" call Decho("new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile).' '.s:Escape(scriptaddr)."|bw!")
|
||||
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile).' '.s:Escape(scriptaddr)|bw!
|
||||
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!")
|
||||
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw!
|
||||
else
|
||||
" call Decho("exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile)." ".s:Escape(scriptaddr))
|
||||
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(tmpfile)." ".s:Escape(scriptaddr)
|
||||
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr))
|
||||
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)
|
||||
endif
|
||||
if itry == 1
|
||||
exe "silent vsplit ".fnameescape(tmpfile)
|
||||
@ -495,8 +493,7 @@ fun! s:GetOneScript(...)
|
||||
let latestsrcid = latestsrcid + 0
|
||||
" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">")
|
||||
|
||||
" has the plugin's most-recent srcid increased, which indicates
|
||||
" that it has been updated
|
||||
" has the plugin's most-recent srcid increased, which indicates that it has been updated
|
||||
if latestsrcid > srcid
|
||||
" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">")
|
||||
|
||||
@ -506,65 +503,103 @@ fun! s:GetOneScript(...)
|
||||
let sname= "NEW_".sname
|
||||
endif
|
||||
|
||||
" -----------------------------------------------------------------------------
|
||||
" the plugin has been updated since we last obtained it, so download a new copy
|
||||
" call Decho("...downloading new <".sname.">")
|
||||
echomsg "...downloading new <".sname.">"
|
||||
" -----------------------------------------------------------------------------
|
||||
" call Decho(".downloading new <".sname.">")
|
||||
echomsg ".downloading new <".sname.">"
|
||||
if has("win32") || has("win16") || has("win95")
|
||||
" call Decho("new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid)."|q")
|
||||
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid)|q
|
||||
" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)."|q")
|
||||
new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='.latestsrcid)|q
|
||||
else
|
||||
" call Decho("exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id='))
|
||||
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".s:Escape(sname)." ".s:Escape('http://vim.sf.net/scripts/download_script.php?src_id=').latestsrcid
|
||||
" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id='))
|
||||
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape('http://vim.sourceforge.net/scripts/download_script.php?src_id=').latestsrcid
|
||||
endif
|
||||
|
||||
" --------------------------------------------------------------------------
|
||||
" AutoInstall: only if doautoinstall has been requested by the plugin itself
|
||||
" --------------------------------------------------------------------------
|
||||
if doautoinstall
|
||||
" call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
|
||||
" call Decho(" ")
|
||||
" call Decho("Autoinstall: getcwd<".getcwd()."> filereadable(".sname.")=".filereadable(sname))
|
||||
if filereadable(sname)
|
||||
" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall))
|
||||
exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".s:Escape(s:autoinstall)
|
||||
" call Decho("<".sname."> is readable")
|
||||
" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall))
|
||||
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall)
|
||||
let curdir = escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #")
|
||||
let installdir= curdir."/Installed"
|
||||
if !isdirectory(installdir)
|
||||
call mkdir(installdir)
|
||||
endif
|
||||
" call Decho("exe cd ".fnameescape(s:autoinstall))
|
||||
" call Decho("curdir<".curdir."> installdir<".installdir.">")
|
||||
" call Decho("exe cd ".fnameescape(s:autoinstall))
|
||||
exe "cd ".fnameescape(s:autoinstall)
|
||||
|
||||
" determine target directory for moves
|
||||
let firstdir= substitute(&rtp,',.*$','','')
|
||||
let pname = substitute(sname,'\..*','.vim','')
|
||||
" call Decho("determine tgtdir: is <".firstdir.'/AsNeeded/'.pname." readable?")
|
||||
if filereadable(firstdir.'/AsNeeded/'.pname)
|
||||
let tgtdir= "AsNeeded"
|
||||
else
|
||||
let tgtdir= "plugin"
|
||||
endif
|
||||
" call Decho("tgtdir<".tgtdir."> pname<".pname.">")
|
||||
|
||||
" decompress
|
||||
if sname =~ '\.bz2$'
|
||||
" call Decho("decompress: attempt to bunzip2 ".sname)
|
||||
exe "silent !bunzip2 ".s:Escape(sname)
|
||||
exe "silent !bunzip2 ".shellescape(sname)
|
||||
let sname= substitute(sname,'\.bz2$','','')
|
||||
" call Decho("decompress: new sname<".sname."> after bunzip2")
|
||||
elseif sname =~ '\.gz$'
|
||||
" call Decho("decompress: attempt to gunzip ".sname)
|
||||
exe "silent !gunzip ".s:Escape(sname)
|
||||
exe "silent !gunzip ".shellescape(sname)
|
||||
let sname= substitute(sname,'\.gz$','','')
|
||||
" call Decho("decompress: new sname<".sname."> after gunzip")
|
||||
else
|
||||
" call Decho("no decompression needed")
|
||||
endif
|
||||
|
||||
" distribute archive(.zip, .tar, .vba) contents
|
||||
if sname =~ '\.zip$'
|
||||
" call Decho("dearchive: attempt to unzip ".sname)
|
||||
exe "silent !unzip -o ".s:Escape(sname)
|
||||
exe "silent !unzip -o ".shellescape(sname)
|
||||
elseif sname =~ '\.tar$'
|
||||
" call Decho("dearchive: attempt to untar ".sname)
|
||||
exe "silent !tar -xvf ".s:Escape(sname)
|
||||
exe "silent !tar -xvf ".shellescape(sname)
|
||||
elseif sname =~ '\.vba$'
|
||||
" call Decho("dearchive: attempt to handle a vimball: ".sname)
|
||||
silent 1split
|
||||
if exists("g:vimball_home")
|
||||
let oldvimballhome= g:vimball_home
|
||||
endif
|
||||
let g:vimball_home= s:autoinstall
|
||||
exe "silent e ".fnameescape(sname)
|
||||
silent so %
|
||||
silent q
|
||||
if exists("oldvimballhome")
|
||||
let g:vimball_home= oldvimballhome
|
||||
else
|
||||
unlet g:vimball_home
|
||||
endif
|
||||
else
|
||||
" call Decho("no dearchiving needed")
|
||||
endif
|
||||
|
||||
" ---------------------------------------------
|
||||
" move plugin to plugin/ or AsNeeded/ directory
|
||||
" ---------------------------------------------
|
||||
if sname =~ '.vim$'
|
||||
" call Decho("dearchive: attempt to simply move ".sname." to plugin")
|
||||
exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." plugin"
|
||||
" call Decho("dearchive: attempt to simply move ".sname." to ".tgtdir)
|
||||
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".tgtdir
|
||||
else
|
||||
" call Decho("dearchive: move <".sname."> to installdir<".installdir.">")
|
||||
exe "silent !".g:GetLatestVimScripts_mv." ".s:Escape(sname)." ".installdir
|
||||
exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir
|
||||
endif
|
||||
if tgtdir != "plugin"
|
||||
" call Decho("exe silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir)
|
||||
exe "silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir
|
||||
endif
|
||||
|
||||
" helptags step
|
||||
@ -599,20 +634,6 @@ fun! s:GetOneScript(...)
|
||||
" call Dret("GetOneScript")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" s:Escape: makes a string safe&suitable for the shell {{{2
|
||||
fun! s:Escape(name)
|
||||
" call Dfunc("s:Escape(name<".a:name.">)")
|
||||
if exists("*shellescape")
|
||||
" shellescape() was added by patch 7.0.111
|
||||
let name= shellescape(a:name)
|
||||
else
|
||||
let name= g:getscript_shq . a:name . g:getscript_shq
|
||||
endif
|
||||
" call Dret("s:Escape ".name)
|
||||
return name
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Restore Options: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
|
@ -1,14 +1,14 @@
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Vim Ada/GNAT compiler file
|
||||
" Language: Ada (GNAT)
|
||||
" $Id$
|
||||
" $Id: gnat.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Copyright: Copyright (C) 2006 Martin Krischik
|
||||
" Maintainer: Martin Krischi <krischik@users.sourceforge.net>k
|
||||
" Ned Okie <nokie@radford.edu>
|
||||
" $Author$
|
||||
" $Date$
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6
|
||||
" $Revision$
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/gnat.vim $
|
||||
" History: 24.05.2006 MK Unified Headers
|
||||
" 16.07.2006 MK Ada-Mode as vim-ball
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
||||
" netrwFileHandlers: contains various extension-based file handlers for
|
||||
" netrw's browsers' x command ("eXecute launcher")
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: May 30, 2006
|
||||
" Version: 9
|
||||
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
||||
" Date: Sep 30, 2008
|
||||
" Version: 10
|
||||
" Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1
|
||||
" 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,
|
||||
@ -20,9 +20,15 @@
|
||||
if exists("g:loaded_netrwFileHandlers") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwFileHandlers= "v10"
|
||||
if v:version < 702
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of netrwFileHandlers needs vim 7.2"
|
||||
echohl Normal
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
let g:loaded_netrwFileHandlers= "v9"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" netrwFileHandlers#Invoke: {{{1
|
||||
@ -73,10 +79,10 @@ fun! s:NFH_html(pagefile)
|
||||
|
||||
if executable("mozilla")
|
||||
" call Decho("executing !mozilla ".page)
|
||||
exe "!mozilla ".g:netrw_shq.page.g:netrw_shq
|
||||
exe "!mozilla ".shellescape(page,1)
|
||||
elseif executable("netscape")
|
||||
" call Decho("executing !netscape ".page)
|
||||
exe "!netscape ".g:netrw_shq..page.g:netrw_shq
|
||||
exe "!netscape ".shellescape(page,1)
|
||||
else
|
||||
" call Dret("s:NFH_html 0")
|
||||
return 0
|
||||
@ -96,10 +102,10 @@ fun! s:NFH_htm(pagefile)
|
||||
|
||||
if executable("mozilla")
|
||||
" call Decho("executing !mozilla ".page)
|
||||
exe "!mozilla ".g:netrw_shq.page.g:netrw_shq
|
||||
exe "!mozilla ".shellescape(page,1)
|
||||
elseif executable("netscape")
|
||||
" call Decho("executing !netscape ".page)
|
||||
exe "!netscape ".g:netrw_shq.page.g:netrw_shq
|
||||
exe "!netscape ".shellescape(page,1)
|
||||
else
|
||||
" call Dret("s:NFH_htm 0")
|
||||
return 0
|
||||
@ -115,10 +121,10 @@ fun! s:NFH_jpg(jpgfile)
|
||||
" call Dfunc("s:NFH_jpg(jpgfile<".a:jpgfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".g:netrw_shq.a:jpgfile.g:netrw_shq
|
||||
exe "silent! !gimp -s ".shellescape(a:jpgfile,1)
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
" call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'"))
|
||||
exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:jpgfile.g:netrw_shq
|
||||
exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:jpgfile,1)
|
||||
else
|
||||
" call Dret("s:NFH_jpg 0")
|
||||
return 0
|
||||
@ -134,9 +140,9 @@ fun! s:NFH_gif(giffile)
|
||||
" call Dfunc("s:NFH_gif(giffile<".a:giffile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".g:netrw_shq.a:giffile.g:netrw_shq
|
||||
exe "silent! !gimp -s ".shellescape(a:giffile,1)
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:giffile.g:netrw_shq
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:giffile,1)
|
||||
else
|
||||
" call Dret("s:NFH_gif 0")
|
||||
return 0
|
||||
@ -152,9 +158,9 @@ fun! s:NFH_png(pngfile)
|
||||
" call Dfunc("s:NFH_png(pngfile<".a:pngfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".g:netrw_shq.a:pngfile.g:netrw_shq
|
||||
exe "silent! !gimp -s ".shellescape(a:pngfile,1)
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:pngfile.g:netrw_shq
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pngfile,1)
|
||||
else
|
||||
" call Dret("s:NFH_png 0")
|
||||
return 0
|
||||
@ -170,9 +176,9 @@ fun! s:NFH_pnm(pnmfile)
|
||||
" call Dfunc("s:NFH_pnm(pnmfile<".a:pnmfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".g:netrw_shq.a:pnmfile.g:netrw_shq
|
||||
exe "silent! !gimp -s ".shellescape(a:pnmfile,1)
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:pnmfile.g:netrw_shq
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pnmfile,1)
|
||||
else
|
||||
" call Dret("s:NFH_pnm 0")
|
||||
return 0
|
||||
@ -190,7 +196,7 @@ fun! s:NFH_bmp(bmpfile)
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:bmpfile
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".g:netrw_shq.a:bmpfile.g:netrw_shq
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:bmpfile,1)
|
||||
else
|
||||
" call Dret("s:NFH_bmp 0")
|
||||
return 0
|
||||
@ -205,9 +211,9 @@ endfun
|
||||
fun! s:NFH_pdf(pdf)
|
||||
" call Dfunc("s:NFH_pdf(pdf<".a:pdf.">)")
|
||||
if executable("gs")
|
||||
exe 'silent! !gs '.g:netrw_shq.a:pdf.g:netrw_shq
|
||||
exe 'silent! !gs '.shellescape(a:pdf,1)
|
||||
elseif executable("pdftotext")
|
||||
exe 'silent! pdftotext -nopgbrk '.g:netrw_shq.a:pdf.g:netrw_shq
|
||||
exe 'silent! pdftotext -nopgbrk '.shellescape(a:pdf,1)
|
||||
else
|
||||
" call Dret("s:NFH_pdf 0")
|
||||
return 0
|
||||
@ -223,7 +229,7 @@ fun! s:NFH_doc(doc)
|
||||
" call Dfunc("s:NFH_doc(doc<".a:doc.">)")
|
||||
|
||||
if executable("oowriter")
|
||||
exe 'silent! !oowriter '.g:netrw_shq.a:doc.g:netrw_shq
|
||||
exe 'silent! !oowriter '.shellescape(a:doc,1)
|
||||
redraw!
|
||||
else
|
||||
" call Dret("s:NFH_doc 0")
|
||||
@ -240,7 +246,7 @@ fun! s:NFH_sxw(sxw)
|
||||
" call Dfunc("s:NFH_sxw(sxw<".a:sxw.">)")
|
||||
|
||||
if executable("oowriter")
|
||||
exe 'silent! !oowriter '.g:netrw_shq.a:sxw.g:netrw_shq
|
||||
exe 'silent! !oowriter '.shellescape(a:sxw,1)
|
||||
redraw!
|
||||
else
|
||||
" call Dret("s:NFH_sxw 0")
|
||||
@ -257,7 +263,7 @@ fun! s:NFH_xls(xls)
|
||||
" call Dfunc("s:NFH_xls(xls<".a:xls.">)")
|
||||
|
||||
if executable("oocalc")
|
||||
exe 'silent! !oocalc '.g:netrw_shq.a:xls.g:netrw_shq
|
||||
exe 'silent! !oocalc '.shellescape(a:xls,1)
|
||||
redraw!
|
||||
else
|
||||
" call Dret("s:NFH_xls 0")
|
||||
@ -274,15 +280,15 @@ fun! s:NFH_ps(ps)
|
||||
" call Dfunc("s:NFH_ps(ps<".a:ps.">)")
|
||||
if executable("gs")
|
||||
" call Decho("exe silent! !gs ".a:ps)
|
||||
exe "silent! !gs ".g:netrw_shq.a:ps.g:netrw_shq
|
||||
exe "silent! !gs ".shellescape(a:ps,1)
|
||||
redraw!
|
||||
elseif executable("ghostscript")
|
||||
" call Decho("exe silent! !ghostscript ".a:ps)
|
||||
exe "silent! !ghostscript ".g:netrw_shq.a:ps.g:netrw_shq
|
||||
exe "silent! !ghostscript ".shellescape(a:ps,1)
|
||||
redraw!
|
||||
elseif executable("gswin32")
|
||||
" call Decho("exe silent! !gswin32 ".g:netrw_shq.a:ps.g:netrw_shq)
|
||||
exe "silent! !gswin32 ".g:netrw_shq.a:ps.g:netrw_shq
|
||||
" call Decho("exe silent! !gswin32 ".shellescape(a:ps,1))
|
||||
exe "silent! !gswin32 ".shellescape(a:ps,1)
|
||||
redraw!
|
||||
else
|
||||
" call Dret("s:NFH_ps 0")
|
||||
@ -298,16 +304,16 @@ endfun
|
||||
fun! s:NFH_eps(eps)
|
||||
" call Dfunc("s:NFH_eps()")
|
||||
if executable("gs")
|
||||
exe "silent! !gs ".g:netrw_shq.a:eps.g:netrw_shq
|
||||
exe "silent! !gs ".shellescape(a:eps,1)
|
||||
redraw!
|
||||
elseif executable("ghostscript")
|
||||
exe "silent! !ghostscript ".g:netrw_shq.a:eps.g:netrw_shq
|
||||
exe "silent! !ghostscript ".shellescape(a:eps,1)
|
||||
redraw!
|
||||
elseif executable("ghostscript")
|
||||
exe "silent! !ghostscript ".g:netrw_shq.a:eps.g:netrw_shq
|
||||
exe "silent! !ghostscript ".shellescape(a:eps,1)
|
||||
redraw!
|
||||
elseif executable("gswin32")
|
||||
exe "silent! !gswin32 ".g:netrw_shq.a:eps.g:netrw_shq
|
||||
exe "silent! !gswin32 ".shellescape(a:eps,1)
|
||||
redraw!
|
||||
else
|
||||
" call Dret("s:NFH_eps 0")
|
||||
|
@ -1,7 +1,7 @@
|
||||
" netrwSettings.vim: makes netrw settings simpler
|
||||
" Date: Jul 02, 2008
|
||||
" Date: Sep 03, 2008
|
||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||
" Version: 12
|
||||
" Version: 13
|
||||
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
@ -19,7 +19,13 @@
|
||||
if exists("g:loaded_netrwSettings") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwSettings = "v12"
|
||||
let g:loaded_netrwSettings = "v13"
|
||||
if v:version < 700
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of netrwSettings needs vim 7.0"
|
||||
echohl Normal
|
||||
finish
|
||||
endif
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwSettings: {{{1
|
||||
@ -100,6 +106,7 @@ fun! netrwSettings#NetrwSettings()
|
||||
put = 'let g:netrw_browsex_viewer = (not defined)'
|
||||
endif
|
||||
put = 'let g:netrw_compress = '.g:netrw_compress
|
||||
put = 'let g:netrw_cursorline = '.g:netrw_cursorline
|
||||
let decompressline= line("$")
|
||||
put ='let g:netrw_decompress...'
|
||||
put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
|
||||
@ -138,6 +145,7 @@ fun! netrwSettings#NetrwSettings()
|
||||
put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax
|
||||
put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
|
||||
put = 'let g:netrw_scpport = '.g:netrw_scpport
|
||||
put = 'let g:netrw_sepchr = '.g:netrw_sepchr
|
||||
put = 'let g:netrw_sshport = '.g:netrw_sshport
|
||||
put = 'let g:netrw_timefmt = '.g:netrw_timefmt
|
||||
let tmpfileescline= line("$")
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim completion script
|
||||
" Language: Ruby
|
||||
" Maintainer: Mark Guzman <segfault@hasno.info>
|
||||
" Info: $Id$
|
||||
" Info: $Id: rubycomplete.vim,v 1.41 2008/06/30 06:50:45 segy Exp $
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Vim script to download a missing spell file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2008 Jun 27
|
||||
" Last Change: 2008 Nov 29
|
||||
|
||||
if !exists('g:spellfile_URL')
|
||||
" Prefer using http:// when netrw should be able to use it, since
|
||||
@ -39,19 +39,22 @@ function! spellfile#LoadFile(lang)
|
||||
let s:donedict[a:lang . &enc] = 1
|
||||
|
||||
" Find spell directories we can write in.
|
||||
let dirlist = []
|
||||
let dirchoices = '&Cancel'
|
||||
for dir in split(globpath(&rtp, 'spell'), "\n")
|
||||
if filewritable(dir) == 2
|
||||
call add(dirlist, dir)
|
||||
let dirchoices .= "\n&" . len(dirlist)
|
||||
endif
|
||||
endfor
|
||||
let [dirlist, dirchoices] = spellfile#GetDirChoices()
|
||||
if len(dirlist) == 0
|
||||
if &verbose
|
||||
let dir_to_create = spellfile#WritableSpellDir()
|
||||
if &verbose || dir_to_create != ''
|
||||
echomsg 'spellfile#LoadFile(): There is no writable spell directory.'
|
||||
endif
|
||||
return
|
||||
if dir_to_create != ''
|
||||
if confirm("Shall I create " . dir_to_create, "&Yes\n&No", 2) == 1
|
||||
" After creating the directory it should show up in the list.
|
||||
call mkdir(dir_to_create, "p")
|
||||
let [dirlist, dirchoices] = spellfile#GetDirChoices()
|
||||
endif
|
||||
endif
|
||||
if len(dirlist) == 0
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
let msg = 'Cannot find spell file for "' . a:lang . '" in ' . &enc
|
||||
@ -177,3 +180,29 @@ function! spellfile#Nread(fname)
|
||||
unlet g:netrw_use_errorwindow
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Get a list of writable spell directories and choices for confirm().
|
||||
function! spellfile#GetDirChoices()
|
||||
let dirlist = []
|
||||
let dirchoices = '&Cancel'
|
||||
for dir in split(globpath(&rtp, 'spell'), "\n")
|
||||
if filewritable(dir) == 2
|
||||
call add(dirlist, dir)
|
||||
let dirchoices .= "\n&" . len(dirlist)
|
||||
endif
|
||||
endfor
|
||||
return [dirlist, dirchoices]
|
||||
endfunc
|
||||
|
||||
function! spellfile#WritableSpellDir()
|
||||
if has("unix")
|
||||
" For Unix always use the $HOME/.vim directory
|
||||
return $HOME . "/.vim/spell"
|
||||
endif
|
||||
for dir in split(&rtp, ',')
|
||||
if filewritable(dir) == 2
|
||||
return dir . "/spell"
|
||||
endif
|
||||
endfor
|
||||
return ''
|
||||
endfunction
|
||||
|
@ -1,13 +1,19 @@
|
||||
" Vim OMNI completion script for SQL
|
||||
" Language: SQL
|
||||
" Maintainer: David Fishburn <fishburn@ianywhere.com>
|
||||
" Version: 6.0
|
||||
" Last Change: Thu 03 Apr 2008 10:37:54 PM Eastern Daylight Time
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Version: 7.0
|
||||
" Last Change: 2009 Jan 04
|
||||
" Usage: For detailed help
|
||||
" ":help sql.txt"
|
||||
" or ":help ft-sql-omni"
|
||||
" or read $VIMRUNTIME/doc/sql.txt
|
||||
|
||||
" History
|
||||
" Version 7.0
|
||||
" Better handling of object names
|
||||
" Version 6.0
|
||||
" Supports object names with spaces "my table name"
|
||||
"
|
||||
" Set completion with CTRL-X CTRL-O to autoloaded function.
|
||||
" This check is in place in case this script is
|
||||
" sourced directly instead of using the autoload feature.
|
||||
@ -22,7 +28,7 @@ endif
|
||||
if exists('g:loaded_sql_completion')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_sql_completion = 50
|
||||
let g:loaded_sql_completion = 70
|
||||
|
||||
" Maintains filename of dictionary
|
||||
let s:sql_file_table = ""
|
||||
@ -106,10 +112,23 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
let begindot = 1
|
||||
endif
|
||||
while start > 0
|
||||
if line[start - 1] =~ '\(\w\|\s\+\)'
|
||||
" Additional code was required to handle objects which
|
||||
" can contain spaces like "my table name".
|
||||
if line[start - 1] !~ '\(\w\|\.\)'
|
||||
" If the previous character is not a period or word character
|
||||
break
|
||||
" elseif line[start - 1] =~ '\(\w\|\s\+\)'
|
||||
" let start -= 1
|
||||
elseif line[start - 1] =~ '\w'
|
||||
" If the previous character is word character continue back
|
||||
let start -= 1
|
||||
elseif line[start - 1] =~ '\.' &&
|
||||
\ compl_type =~ 'column\|table\|view\|procedure'
|
||||
" If the previous character is a period and we are completing
|
||||
" an object which can be specified with a period like this:
|
||||
" table_name.column_name
|
||||
" owner_name.table_name
|
||||
|
||||
" If lastword has already been set for column completion
|
||||
" break from the loop, since we do not also want to pickup
|
||||
" a table name if it was also supplied.
|
||||
@ -184,9 +203,10 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
endif
|
||||
|
||||
let compl_type_uc = substitute(compl_type, '\w\+', '\u&', '')
|
||||
if s:sql_file_{compl_type} == ""
|
||||
let s:sql_file_{compl_type} = DB_getDictionaryName(compl_type_uc)
|
||||
endif
|
||||
" Same call below, no need to do it twice
|
||||
" if s:sql_file_{compl_type} == ""
|
||||
" let s:sql_file_{compl_type} = DB_getDictionaryName(compl_type_uc)
|
||||
" endif
|
||||
let s:sql_file_{compl_type} = DB_getDictionaryName(compl_type_uc)
|
||||
if s:sql_file_{compl_type} != ""
|
||||
if filereadable(s:sql_file_{compl_type})
|
||||
@ -312,9 +332,16 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
endif
|
||||
|
||||
if base != ''
|
||||
" Filter the list based on the first few characters the user
|
||||
" entered
|
||||
let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|\\([^.]*\\)\\?'.base.'\\)"'
|
||||
" Filter the list based on the first few characters the user entered.
|
||||
" Check if the text matches at the beginning
|
||||
" or
|
||||
" Match to a owner.table or alias.column type match
|
||||
" or
|
||||
" Handle names with spaces "my table name"
|
||||
let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|^\\(\\w\\+\\.\\)\\?'.base.'\\)"'
|
||||
" let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\)"'
|
||||
" let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|\\(\\.\\)\\?'.base.'\\)"'
|
||||
" let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|\\([^.]*\\)\\?'.base.'\\)"'
|
||||
let compl_list = filter(deepcopy(compl_list), expr)
|
||||
endif
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
" tar.vim: Handles browsing tarfiles
|
||||
" AUTOLOAD PORTION
|
||||
" Date: Aug 08, 2008
|
||||
" Version: 23 + modifications by Bram
|
||||
" Date: Dec 28, 2009
|
||||
" Version: 24
|
||||
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
|
||||
" License: Vim License (see vim's :help license)
|
||||
"
|
||||
" Contains many ideas from Michael Toren's <tar.vim>
|
||||
"
|
||||
" Copyright: Copyright (C) 2005-2008 Charles E. Campbell, Jr. {{{1
|
||||
" Copyright: Copyright (C) 2005-2009 Charles E. Campbell, Jr. {{{1
|
||||
" 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,
|
||||
@ -16,19 +16,22 @@
|
||||
" By using this plugin, you agree that in no event will the
|
||||
" copyright holder be liable for any damages resulting from
|
||||
" the use of this software.
|
||||
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
" ---------------------------------------------------------------------
|
||||
" Load Once: {{{1
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
if &cp || exists("g:loaded_tar") || v:version < 700
|
||||
if &cp || exists("g:loaded_tar")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_tar= "v23b"
|
||||
"call Decho("loading autoload/tar.vim")
|
||||
if v:version < 701 || (v:version == 701 && !has("patch299"))
|
||||
echoerr "(autoload/tar.vim) need vim v7.1 with patchlevel 299"
|
||||
let g:loaded_tar= "v24"
|
||||
if v:version < 702
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of tar needs vim 7.2"
|
||||
echohl Normal
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
"call Decho("loading autoload/tar.vim")
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Default Settings: {{{1
|
||||
@ -44,7 +47,22 @@ endif
|
||||
if !exists("g:tar_writeoptions")
|
||||
let g:tar_writeoptions= "uf"
|
||||
endif
|
||||
|
||||
if !exists("g:tar_copycmd")
|
||||
if !exists("g:netrw_localcopycmd")
|
||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if g:netrw_cygwin
|
||||
let g:netrw_localcopycmd= "cp"
|
||||
else
|
||||
let g:netrw_localcopycmd= "copy"
|
||||
endif
|
||||
elseif has("unix") || has("macunix")
|
||||
let g:netrw_localcopycmd= "cp"
|
||||
else
|
||||
let g:netrw_localcopycmd= ""
|
||||
endif
|
||||
endif
|
||||
let g:tar_copycmd= g:netrw_localcopycmd
|
||||
endif
|
||||
if !exists("g:netrw_cygwin")
|
||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$'
|
||||
@ -56,6 +74,9 @@ if !exists("g:netrw_cygwin")
|
||||
let g:netrw_cygwin= 0
|
||||
endif
|
||||
endif
|
||||
if !exists("g:tar_extractcmd")
|
||||
let g:tar_extractcmd= "tar -xf"
|
||||
endif
|
||||
|
||||
" set up shell quoting character
|
||||
if !exists("g:tar_shq")
|
||||
@ -88,7 +109,6 @@ fun! tar#Browse(tarfile)
|
||||
if !executable(g:tar_cmd)
|
||||
redraw!
|
||||
echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system'
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Browse")
|
||||
return
|
||||
@ -99,7 +119,6 @@ fun! tar#Browse(tarfile)
|
||||
" if its an url, don't complain, let url-handlers such as vim do its thing
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
endif
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Browse : file<".a:tarfile."> not readable")
|
||||
@ -130,37 +149,38 @@ fun! tar#Browse(tarfile)
|
||||
let tarfile= a:tarfile
|
||||
if has("win32") && executable("cygpath")
|
||||
" assuming cygwin
|
||||
let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e')
|
||||
let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e')
|
||||
endif
|
||||
let curlast= line("$")
|
||||
if tarfile =~# '\.\(gz\|tgz\)$'
|
||||
" call Decho("1: exe silent r! gzip -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
|
||||
exe "silent r! gzip -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
|
||||
" call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
|
||||
exe "silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
|
||||
elseif tarfile =~# '\.lrp'
|
||||
" call Decho("2: exe silent r! cat -- ".s:Escape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ")
|
||||
exe "silent r! cat -- ".s:Escape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - "
|
||||
" call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ")
|
||||
exe "silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - "
|
||||
elseif tarfile =~# '\.bz2$'
|
||||
" call Decho("3: exe silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
|
||||
exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
|
||||
" call Decho("3: exe silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
|
||||
exe "silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
|
||||
elseif tarfile =~# '\.lzma$'
|
||||
" call Decho("3: exe silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
|
||||
exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
|
||||
else
|
||||
if tarfile =~ '^\s*-'
|
||||
" A file name starting with a dash may be taken as an option. Prepend ./ to avoid that.
|
||||
" A file name starting with a dash is taken as an option. Prepend ./ to avoid that.
|
||||
let tarfile = substitute(tarfile, '-', './-', '')
|
||||
endif
|
||||
" call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile,1))
|
||||
exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".s:Escape(tarfile,1)
|
||||
" call Decho("4: exe silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,0))
|
||||
exe "silent r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,1)
|
||||
endif
|
||||
if v:shell_error != 0
|
||||
redraw!
|
||||
echohl WarningMsg | echo "***warning*** (tar#Browse) please check your g:tar_browseoptions<".g:tar_browseoptions.">"
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
" call Dret("tar#Browse : a:tarfile<".a:tarfile.">")
|
||||
return
|
||||
endif
|
||||
if line("$") == curlast || ( line("$") == (curlast + 1) && getline("$") =~ '\c\%(warning\|error\|inappropriate\|unrecognized\)')
|
||||
redraw!
|
||||
echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
silent %d
|
||||
let eikeep= &ei
|
||||
set ei=BufReadCmd,FileReadCmd
|
||||
@ -189,7 +209,7 @@ fun! s:TarBrowseSelect()
|
||||
|
||||
if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-'
|
||||
redraw!
|
||||
echohl WarningMsg | echo '***error*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"; See :help tar-options'
|
||||
echohl WarningMsg | echo '***warning*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"'
|
||||
" call Dret('tar#BrowseSelect : rejecting tarfile member<'.fname.'> because of embedded "-"')
|
||||
return
|
||||
endif
|
||||
@ -206,7 +226,7 @@ fun! s:TarBrowseSelect()
|
||||
let curfile= expand("%")
|
||||
if has("win32") && executable("cygpath")
|
||||
" assuming cygwin
|
||||
let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e')
|
||||
let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e')
|
||||
endif
|
||||
|
||||
new
|
||||
@ -231,21 +251,24 @@ fun! tar#Read(fname,mode)
|
||||
let fname = substitute(a:fname,'tarfile:.\{-}::\(.*\)$','\1','')
|
||||
if has("win32") && executable("cygpath")
|
||||
" assuming cygwin
|
||||
let tarfile=substitute(system("cygpath -u ".s:Escape(tarfile,0)),'\n$','','e')
|
||||
let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e')
|
||||
endif
|
||||
" call Decho("tarfile<".tarfile.">")
|
||||
" call Decho("fname<".fname.">")
|
||||
|
||||
if fname =~ '\.gz$' && executable("zcat")
|
||||
if fname =~ '\.bz2$' && executable("bzcat")
|
||||
let decmp= "|bzcat"
|
||||
let doro = 1
|
||||
elseif fname =~ '\.gz$' && executable("zcat")
|
||||
let decmp= "|zcat"
|
||||
let doro = 1
|
||||
elseif fname =~ '\.bz2$' && executable("bzcat")
|
||||
let decmp= "|bzcat"
|
||||
elseif fname =~ '\.lzma$' && executable("lzcat")
|
||||
let decmp= "|lzcat"
|
||||
let doro = 1
|
||||
else
|
||||
let decmp=""
|
||||
let doro = 0
|
||||
if fname =~ '\.gz$\|\.bz2$\|\.Z$\|\.zip$'
|
||||
if fname =~ '\.bz2$\|\.gz$\|\.lzma$\|\.zip$\|\.Z$'
|
||||
setlocal bin
|
||||
endif
|
||||
endif
|
||||
@ -255,22 +278,25 @@ fun! tar#Read(fname,mode)
|
||||
else
|
||||
let tar_secure= " "
|
||||
endif
|
||||
if tarfile =~# '\.\(gz\|tgz\)$'
|
||||
" call Decho("5: exe silent r! gzip -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.s:Escape(fname,1))
|
||||
exe "silent r! gzip -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp
|
||||
if tarfile =~# '\.bz2$'
|
||||
" call Decho("7: exe silent r! bzip2 -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
|
||||
exe "silent r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
|
||||
elseif tarfile =~# '\.\(gz\|tgz\)$'
|
||||
" call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1))
|
||||
exe "silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
|
||||
elseif tarfile =~# '\.lrp$'
|
||||
" call Decho("6: exe silent r! cat ".s:Escape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp)
|
||||
exe "silent r! cat -- ".s:Escape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp
|
||||
elseif tarfile =~# '\.bz2$'
|
||||
" call Decho("7: exe silent r! bzip2 -d -c ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp)
|
||||
exe "silent r! bzip2 -d -c -- ".s:Escape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.s:Escape(fname,1).decmp
|
||||
" call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
|
||||
exe "silent r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
|
||||
elseif tarfile =~# '\.lzma$'
|
||||
" call Decho("7: exe silent r! lzma -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
|
||||
exe "silent r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
|
||||
else
|
||||
if tarfile =~ '^\s*-'
|
||||
" A file name starting with a dash may be taken as an option. Prepend ./ to avoid that.
|
||||
" A file name starting with a dash is taken as an option. Prepend ./ to avoid that.
|
||||
let tarfile = substitute(tarfile, '-', './-', '')
|
||||
endif
|
||||
" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions." "s:Escape(tarfile,1).tar_secure..s:Escape(fname,1).decmp)
|
||||
exe "silent r! ".g:tar_cmd." -".g:tar_readoptions." ".s:Escape(tarfile,1).tar_secure.s:Escape(fname,1).decmp
|
||||
" call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions.tar_secure.shellescape(tarfile,1)." ".shellescape(fname,1).decmp)
|
||||
exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".tar_secure.shellescape(fname,1).decmp
|
||||
endif
|
||||
|
||||
if doro
|
||||
@ -298,7 +324,7 @@ fun! tar#Write(fname)
|
||||
|
||||
if !exists("g:tar_secure") && a:fname =~ '^\s*-\|\s\+-'
|
||||
redraw!
|
||||
echohl WarningMsg | echo '***error*** (tar#Write) rejecting tarfile member<'.a:fname.'> because of embedded "-"; See :help tar-options'
|
||||
echohl WarningMsg | echo '***warning*** (tar#Write) rejecting tarfile member<'.a:fname.'> because of embedded "-"'
|
||||
" call Dret('tar#Write : rejecting tarfile member<'.fname.'> because of embedded "-"')
|
||||
return
|
||||
endif
|
||||
@ -307,7 +333,6 @@ fun! tar#Write(fname)
|
||||
if !executable(g:tar_cmd)
|
||||
redraw!
|
||||
echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system'
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
return
|
||||
@ -315,7 +340,6 @@ fun! tar#Write(fname)
|
||||
if !exists("*mkdir")
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
return
|
||||
@ -336,7 +360,6 @@ fun! tar#Write(fname)
|
||||
catch /^Vim\%((\a\+)\)\=:E344/
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
return
|
||||
@ -355,21 +378,26 @@ fun! tar#Write(fname)
|
||||
let fname = substitute(w:tarfile,'tarfile:.\{-}::\(.*\)$','\1','')
|
||||
|
||||
" handle compressed archives
|
||||
if tarfile =~# '\.gz'
|
||||
call system("gzip -d -- ".s:Escape(tarfile,0))
|
||||
if tarfile =~# '\.bz2'
|
||||
call system("bzip2 -d -- ".shellescape(tarfile,0))
|
||||
let tarfile = substitute(tarfile,'\.bz2','','e')
|
||||
let compress= "bzip2 -- ".shellescape(tarfile,0)
|
||||
" call Decho("compress<".compress.">")
|
||||
elseif tarfile =~# '\.gz'
|
||||
call system("gzip -d -- ".shellescape(tarfile,0))
|
||||
let tarfile = substitute(tarfile,'\.gz','','e')
|
||||
let compress= "gzip -- ".s:Escape(tarfile,0)
|
||||
let compress= "gzip -- ".shellescape(tarfile,0)
|
||||
" call Decho("compress<".compress.">")
|
||||
elseif tarfile =~# '\.lzma'
|
||||
call system("lzma -d -- ".shellescape(tarfile,0))
|
||||
let tarfile = substitute(tarfile,'\.lzma','','e')
|
||||
let compress= "lzma -- ".shellescape(tarfile,0)
|
||||
" call Decho("compress<".compress.">")
|
||||
elseif tarfile =~# '\.tgz'
|
||||
call system("gzip -d -- ".s:Escape(tarfile,0))
|
||||
call system("gzip -d -- ".shellescape(tarfile,0))
|
||||
let tarfile = substitute(tarfile,'\.tgz','.tar','e')
|
||||
let compress= "gzip -- ".s:Escape(tarfile,0)
|
||||
let compress= "gzip -- ".shellescape(tarfile,0)
|
||||
let tgz = 1
|
||||
" call Decho("compress<".compress.">")
|
||||
elseif tarfile =~# '\.bz2'
|
||||
call system("bzip2 -d -- ".s:Escape(tarfile,0))
|
||||
let tarfile = substitute(tarfile,'\.bz2','','e')
|
||||
let compress= "bzip2 -- ".s:Escape(tarfile,0)
|
||||
" call Decho("compress<".compress.">")
|
||||
endif
|
||||
" call Decho("tarfile<".tarfile.">")
|
||||
@ -377,7 +405,6 @@ fun! tar#Write(fname)
|
||||
if v:shell_error != 0
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
else
|
||||
|
||||
" call Decho("tarfile<".tarfile."> fname<".fname.">")
|
||||
@ -385,7 +412,7 @@ fun! tar#Write(fname)
|
||||
if fname =~ '/'
|
||||
let dirpath = substitute(fname,'/[^/]\+$','','e')
|
||||
if executable("cygpath")
|
||||
let dirpath = substitute(system("cygpath ".s:Escape(dirpath, 0)),'\n','','e')
|
||||
let dirpath = substitute(system("cygpath ".shellescape(dirpath, 0)),'\n','','e')
|
||||
endif
|
||||
call mkdir(dirpath,"p")
|
||||
endif
|
||||
@ -405,25 +432,23 @@ fun! tar#Write(fname)
|
||||
endif
|
||||
exe "w! ".fnameescape(fname)
|
||||
if executable("cygpath")
|
||||
let tarfile = substitute(system("cygpath ".s:Escape(tarfile,0)),'\n','','e')
|
||||
let tarfile = substitute(system("cygpath ".shellescape(tarfile,0)),'\n','','e')
|
||||
endif
|
||||
|
||||
" delete old file from tarfile
|
||||
" call Decho("system(".g:tar_cmd." --delete -f ".s:Escape(tarfile,0)." -- ".s:Escape(fname,0).")")
|
||||
call system(g:tar_cmd." --delete -f ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0))
|
||||
" call Decho("system(".g:tar_cmd." --delete -f ".shellescape(tarfile,0)." -- ".shellescape(fname,0).")")
|
||||
call system(g:tar_cmd." --delete -f ".shellescape(tarfile,0).tar_secure.shellescape(fname,0))
|
||||
if v:shell_error != 0
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
else
|
||||
|
||||
" update tarfile with new file
|
||||
" call Decho(g:tar_cmd." -".g:tar_writeoptions." ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0))
|
||||
call system(g:tar_cmd." -".g:tar_writeoptions." ".s:Escape(tarfile,0).tar_secure.s:Escape(fname,0))
|
||||
" call Decho(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0))
|
||||
call system(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0))
|
||||
if v:shell_error != 0
|
||||
redraw!
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None
|
||||
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
elseif exists("compress")
|
||||
" call Decho("call system(".compress.")")
|
||||
call system(compress)
|
||||
@ -439,13 +464,13 @@ fun! tar#Write(fname)
|
||||
" call Decho("handle writing <".tarfile."> across network to <".s:tblfile_{winnr()}.">")
|
||||
let tblfile= s:tblfile_{winnr()}
|
||||
1split|enew
|
||||
let binkeep= &binary
|
||||
let binkeep= &l:binary
|
||||
let eikeep = &ei
|
||||
set binary ei=all
|
||||
exe "e! ".fnameescape(tarfile)
|
||||
call netrw#NetWrite(tblfile)
|
||||
let &ei = eikeep
|
||||
let &binary = binkeep
|
||||
let &ei = eikeep
|
||||
let &l:binary = binkeep
|
||||
q!
|
||||
unlet s:tblfile_{winnr()}
|
||||
endif
|
||||
@ -462,38 +487,98 @@ fun! tar#Write(fname)
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Rmdir: {{{2
|
||||
" s:Rmdir: {{{2
|
||||
fun! s:Rmdir(fname)
|
||||
" call Dfunc("Rmdir(fname<".a:fname.">)")
|
||||
if has("unix")
|
||||
call system("/bin/rm -rf -- ".s:Escape(a:fname,0))
|
||||
call system("/bin/rm -rf -- ".shellescape(a:fname,0))
|
||||
elseif has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if &shell =~? "sh$"
|
||||
call system("/bin/rm -rf -- ".s:Escape(a:fname,0))
|
||||
call system("/bin/rm -rf -- ".shellescape(a:fname,0))
|
||||
else
|
||||
call system("del /S ".s:Escape(a:fname,0))
|
||||
call system("del /S ".shellescape(a:fname,0))
|
||||
endif
|
||||
endif
|
||||
" call Dret("Rmdir")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" s:Escape: {{{2
|
||||
fun s:Escape(name,isfilt)
|
||||
" shellescape() was added by patch 7.0.111
|
||||
if exists("*shellescape")
|
||||
if a:isfilt
|
||||
let qnameq= shellescape(a:name,1)
|
||||
" tar#Vimuntar: installs a tarball in the user's .vim / vimfiles directory {{{2
|
||||
fun! tar#Vimuntar(...)
|
||||
" call Dfunc("tar#Vimuntar() a:0=".a:0." a:1<".(exists("a:1")? a:1 : "-n/a-").">")
|
||||
let tarball = expand("%")
|
||||
" call Decho("tarball<".tarball.">")
|
||||
let tarbase = substitute(tarball,'\..*$','','')
|
||||
" call Decho("tarbase<".tarbase.">")
|
||||
let tarhome = expand("%:p")
|
||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||
let tarhome= substitute(tarhome,'\\','/','g')
|
||||
endif
|
||||
let tarhome= substitute(tarhome,'/[^/]*$','','')
|
||||
" call Decho("tarhome<".tarhome.">")
|
||||
let tartail = expand("%:t")
|
||||
" call Decho("tartail<".tartail.">")
|
||||
let curdir = getcwd()
|
||||
" call Decho("curdir <".curdir.">")
|
||||
" set up vimhome
|
||||
if a:0 > 0 && a:1 != ""
|
||||
let vimhome= a:1
|
||||
else
|
||||
let vimhome= vimball#VimballHome()
|
||||
endif
|
||||
" call Decho("vimhome<".vimhome.">")
|
||||
|
||||
" call Decho("curdir<".curdir."> vimhome<".vimhome.">")
|
||||
if simplify(curdir) != simplify(vimhome)
|
||||
" copy (possibly compressed) tarball to .vim/vimfiles
|
||||
" call Decho(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome))
|
||||
call system(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome))
|
||||
" call Decho("exe cd ".fnameescape(vimhome))
|
||||
exe "cd ".fnameescape(vimhome)
|
||||
endif
|
||||
" call Decho("getcwd<".getcwd().">")
|
||||
|
||||
" if necessary, decompress the tarball; then, extract it
|
||||
if tartail =~ '\.tgz'
|
||||
if executable("gunzip")
|
||||
silent exe "!gunzip ".shellescape(tartail)
|
||||
elseif executable("gzip")
|
||||
silent exe "!gzip -d ".shellescape(tartail)
|
||||
else
|
||||
let qnameq= shellescape(a:name)
|
||||
echoerr "unable to decompress<".tartail."> on this sytem"
|
||||
if simplify(curdir) != simplify(tarhome)
|
||||
" remove decompressed tarball, restore directory
|
||||
" call Decho("delete(".tartail.".tar)")
|
||||
call delete(tartail.".tar")
|
||||
" call Decho("exe cd ".fnameescape(curdir))
|
||||
exe "cd ".fnameescape(curdir)
|
||||
endif
|
||||
" call Dret("tar#Vimuntar")
|
||||
return
|
||||
endif
|
||||
else
|
||||
let qnameq= g:tar_shq . a:name . g:tar_shq
|
||||
call vimball#Decompress(tartail,0)
|
||||
endif
|
||||
return qnameq
|
||||
let extractcmd= netrw#WinPath(g:tar_extractcmd)
|
||||
" call Decho("system(".extractcmd." ".shellescape(tarbase.".tar").")")
|
||||
call system(extractcmd." ".shellescape(tarbase.".tar"))
|
||||
|
||||
" set up help
|
||||
if filereadable("doc/".tarbase.".txt")
|
||||
" call Decho("exe helptags ".getcwd()."/doc")
|
||||
exe "helptags ".getcwd()."/doc"
|
||||
endif
|
||||
|
||||
if simplify(tarhome) != simplify(vimhome)
|
||||
" remove decompressed tarball, restore directory
|
||||
call delete(vimhome."/".tarbase.".tar")
|
||||
exe "cd ".fnameescape(curdir)
|
||||
endif
|
||||
|
||||
" call Dret("tar#Vimuntar")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" =====================================================================
|
||||
" Modelines And Restoration: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
@ -1,9 +1,9 @@
|
||||
" vimball.vim : construct a file containing both paths and files
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: Jul 30, 2008
|
||||
" Version: 29
|
||||
" Date: Dec 28, 2009
|
||||
" Version: 30
|
||||
" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim
|
||||
" Copyright: (c) 2004-2008 by Charles E. Campbell, Jr.
|
||||
" Copyright: (c) 2004-2009 by Charles E. Campbell, Jr.
|
||||
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
|
||||
" (see |copyright|) except use "Vimball" instead of "Vim".
|
||||
" No warranty, express or implied.
|
||||
@ -11,11 +11,17 @@
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Load Once: {{{1
|
||||
if &cp || exists("g:loaded_vimball") || v:version < 700
|
||||
if &cp || exists("g:loaded_vimball")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo = &cpo
|
||||
let g:loaded_vimball = "v29"
|
||||
let g:loaded_vimball = "v30"
|
||||
if v:version < 702
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of vimball needs vim 7.2"
|
||||
echohl Normal
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
"DechoTabOn
|
||||
|
||||
@ -52,30 +58,6 @@ if !exists("s:USAGE")
|
||||
call vimball#ShowMesg(s:WARNING,"(vimball) g:vimball_mkdir undefined")
|
||||
endif
|
||||
endif
|
||||
|
||||
" set up shell quoting character
|
||||
if exists("g:vimball_shq") && !exists("g:netrw_shq")
|
||||
let g:netrw_shq= g:vimball_shq
|
||||
endif
|
||||
if !exists("g:netrw_shq")
|
||||
if exists("&shq") && &shq != ""
|
||||
let g:netrw_shq= &shq
|
||||
elseif has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if g:netrw_cygwin
|
||||
let g:netrw_shq= "'"
|
||||
else
|
||||
let g:netrw_shq= '"'
|
||||
endif
|
||||
else
|
||||
let g:netrw_shq= "'"
|
||||
endif
|
||||
" call Decho("g:netrw_shq<".g:netrw_shq.">")
|
||||
endif
|
||||
|
||||
" set up escape string (used to protect paths)
|
||||
if !exists("g:vimball_path_escape")
|
||||
let g:vimball_path_escape= ' ;#%'
|
||||
endif
|
||||
endif
|
||||
|
||||
" =====================================================================
|
||||
@ -106,8 +88,8 @@ fun! vimball#MkVimball(line1,line2,writelevel,...) range
|
||||
let vbname= vbname.'.vba'
|
||||
endif
|
||||
" call Decho("vbname<".vbname.">")
|
||||
if a:1 =~ '[\/]'
|
||||
call vimball#ShowMesg(s:ERROR,"(MkVimball) vimball name<".a:1."> should not include slashes")
|
||||
if !a:writelevel && a:1 =~ '[\/]'
|
||||
call vimball#ShowMesg(s:ERROR,"(MkVimball) vimball name<".a:1."> should not include slashes; use ! to insist")
|
||||
" call Dret("MkVimball : vimball name<".a:1."> should not include slashes")
|
||||
return
|
||||
endif
|
||||
@ -125,7 +107,7 @@ fun! vimball#MkVimball(line1,line2,writelevel,...) range
|
||||
let home= expand(a:2)
|
||||
else
|
||||
" use first existing directory from rtp
|
||||
let home= s:VimballHome()
|
||||
let home= vimball#VimballHome()
|
||||
endif
|
||||
|
||||
" save current directory
|
||||
@ -218,7 +200,7 @@ fun! vimball#Vimball(really,...)
|
||||
return
|
||||
endif
|
||||
|
||||
if getline(1) !~ '^" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.$'
|
||||
if getline(1) !~ '^" Vimball Archiver'
|
||||
echoerr "(Vimball) The current file does not appear to be a Vimball!"
|
||||
" call Dret("vimball#Vimball")
|
||||
return
|
||||
@ -240,7 +222,7 @@ fun! vimball#Vimball(really,...)
|
||||
if a:0 > 0
|
||||
let home= expand(a:1)
|
||||
else
|
||||
let home= s:VimballHome()
|
||||
let home= vimball#VimballHome()
|
||||
endif
|
||||
" call Decho("home<".home.">")
|
||||
|
||||
@ -272,7 +254,9 @@ fun! vimball#Vimball(really,...)
|
||||
while 1 < linenr && linenr < line("$")
|
||||
let fname = substitute(getline(linenr),'\t\[\[\[1$','','')
|
||||
let fname = substitute(fname,'\\','/','g')
|
||||
let fsize = getline(linenr+1)+0
|
||||
" let fsize = getline(linenr+1)+0
|
||||
let fsize = substitute(getline(linenr+1),'^\(\d\+\).\{-}$','\1','')+0
|
||||
let fenc = substitute(getline(linenr+1),'^\d\+\s*\(\S\+\)$','\1','')
|
||||
let filecnt = filecnt + 1
|
||||
" call Decho("fname<".fname."> fsize=".fsize." filecnt=".filecnt)
|
||||
|
||||
@ -307,7 +291,7 @@ fun! vimball#Vimball(really,...)
|
||||
if !isdirectory(dirname)
|
||||
" call Decho("making <".dirname.">")
|
||||
if exists("g:vimball_mkdir")
|
||||
call system(g:vimball_mkdir." ".s:Escape(dirname))
|
||||
call system(g:vimball_mkdir." ".shellescape(dirname))
|
||||
else
|
||||
call mkdir(dirname)
|
||||
endif
|
||||
@ -337,9 +321,13 @@ fun! vimball#Vimball(really,...)
|
||||
if a:really
|
||||
let fnamepath= home."/".fname
|
||||
" call Decho("exe w! ".fnameescape(fnamepath))
|
||||
exe "silent w! ".fnameescape(fnamepath)
|
||||
echo "wrote ".fnamepath
|
||||
call s:RecordInVar(home,"call delete('".fnameescape(fnamepath)."')")
|
||||
if fenc != ""
|
||||
exe "silent w! ++enc=".fnameescape(fenc)." ".fnameescape(fnamepath)
|
||||
else
|
||||
exe "silent w! ".fnameescape(fnamepath)
|
||||
endif
|
||||
echo "wrote ".fnameescape(fnamepath)
|
||||
call s:RecordInVar(home,"call delete('".fnamepath."')")
|
||||
endif
|
||||
|
||||
" return to tab with vimball
|
||||
@ -418,7 +406,7 @@ fun! vimball#RmVimball(...)
|
||||
if a:0 >= 2
|
||||
let home= expand(a:2)
|
||||
else
|
||||
let home= s:VimballHome()
|
||||
let home= vimball#VimballHome()
|
||||
endif
|
||||
let curdir = getcwd()
|
||||
" call Decho("home <".home.">")
|
||||
@ -432,19 +420,20 @@ fun! vimball#RmVimball(...)
|
||||
keepalt keepjumps 1split
|
||||
silent! keepalt keepjumps e .VimballRecord
|
||||
let keepsrch= @/
|
||||
" call Decho("search for ^".curfile.".vba:")
|
||||
" call Decho("search for ^".curfile."[-0-9.]*.vba:")
|
||||
if search('^'.curfile.": ".'cw')
|
||||
" call Decho('search for ^\M'.curfile.'.\m: ')
|
||||
" call Decho('search for ^\M'.curfile.'.\mvba: ')
|
||||
" call Decho('search for ^\M'.curfile.'\m[-0-9.]*\.vba: ')
|
||||
if search('^\M'.curfile."\m: ".'cw')
|
||||
let foundit= 1
|
||||
elseif search('^'.curfile.".vba: ",'cw')
|
||||
elseif search('^\M'.curfile.".\mvba: ",'cw')
|
||||
let foundit= 1
|
||||
elseif search('^'.curfile.'[-0-9.]*.vba: ','cw')
|
||||
elseif search('^\M'.curfile.'\m[-0-9.]*\.vba: ','cw')
|
||||
let foundit= 1
|
||||
else
|
||||
let foundit = 0
|
||||
endif
|
||||
if foundit
|
||||
let exestring = substitute(getline("."),'^'.curfile.'\S\{-}\.vba: ','','')
|
||||
let exestring = substitute(getline("."),'^\M'.curfile.'\m\S\{-}\.vba: ','','')
|
||||
let s:VBRstring= substitute(exestring,'call delete(','','g')
|
||||
let s:VBRstring= substitute(s:VBRstring,"[')]",'','g')
|
||||
" call Decho("exe ".exestring)
|
||||
@ -472,62 +461,62 @@ endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" vimball#Decompress: attempts to automatically decompress vimballs {{{2
|
||||
fun! vimball#Decompress(fname)
|
||||
" call Dfunc("Decompress(fname<".a:fname.">)")
|
||||
fun! vimball#Decompress(fname,...)
|
||||
" call Dfunc("Decompress(fname<".a:fname.">) a:0=".a:0)
|
||||
|
||||
" decompression:
|
||||
if expand("%") =~ '.*\.gz' && executable("gunzip")
|
||||
" handle *.gz with gunzip
|
||||
silent exe "!gunzip ".s:Escape(a:fname)
|
||||
silent exe "!gunzip ".shellescape(a:fname)
|
||||
if v:shell_error != 0
|
||||
call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) gunzip may have failed with <".a:fname.">")
|
||||
endif
|
||||
let fname= substitute(a:fname,'\.gz$','','')
|
||||
exe "e ".escape(fname,' \')
|
||||
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
|
||||
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
|
||||
|
||||
elseif expand("%") =~ '.*\.gz' && executable("gzip")
|
||||
" handle *.gz with gzip -d
|
||||
silent exe "!gzip -d ".s:Escape(a:fname)
|
||||
silent exe "!gzip -d ".shellescape(a:fname)
|
||||
if v:shell_error != 0
|
||||
call vimball#ShowMesg(s:WARNING,'(vimball#Decompress) "gzip -d" may have failed with <'.a:fname.">")
|
||||
endif
|
||||
let fname= substitute(a:fname,'\.gz$','','')
|
||||
exe "e ".escape(fname,' \')
|
||||
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
|
||||
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
|
||||
|
||||
elseif expand("%") =~ '.*\.bz2' && executable("bunzip2")
|
||||
" handle *.bz2 with bunzip2
|
||||
silent exe "!bunzip2 ".s:Escape(a:fname)
|
||||
silent exe "!bunzip2 ".shellescape(a:fname)
|
||||
if v:shell_error != 0
|
||||
call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) bunzip2 may have failed with <".a:fname.">")
|
||||
endif
|
||||
let fname= substitute(a:fname,'\.bz2$','','')
|
||||
exe "e ".escape(fname,' \')
|
||||
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
|
||||
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
|
||||
|
||||
elseif expand("%") =~ '.*\.bz2' && executable("bzip2")
|
||||
" handle *.bz2 with bzip2 -d
|
||||
silent exe "!bzip2 -d ".s:Escape(a:fname)
|
||||
silent exe "!bzip2 -d ".shellescape(a:fname)
|
||||
if v:shell_error != 0
|
||||
call vimball#ShowMesg(s:WARNING,'(vimball#Decompress) "bzip2 -d" may have failed with <'.a:fname.">")
|
||||
endif
|
||||
let fname= substitute(a:fname,'\.bz2$','','')
|
||||
exe "e ".escape(fname,' \')
|
||||
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
|
||||
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
|
||||
|
||||
elseif expand("%") =~ '.*\.zip' && executable("unzip")
|
||||
" handle *.zip with unzip
|
||||
silent exe "!unzip ".s:Escape(a:fname)
|
||||
silent exe "!unzip ".shellescape(a:fname)
|
||||
if v:shell_error != 0
|
||||
call vimball#ShowMesg(s:WARNING,"(vimball#Decompress) unzip may have failed with <".a:fname.">")
|
||||
endif
|
||||
let fname= substitute(a:fname,'\.zip$','','')
|
||||
exe "e ".escape(fname,' \')
|
||||
call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)")
|
||||
if a:0 == 0| call vimball#ShowMesg(s:USAGE,"Source this file to extract it! (:so %)") | endif
|
||||
endif
|
||||
|
||||
set noma bt=nofile fmr=[[[,]]] fdm=marker
|
||||
if a:0 == 0| setlocal noma bt=nofile fmr=[[[,]]] fdm=marker | endif
|
||||
|
||||
" call Dret("Decompress")
|
||||
endfun
|
||||
@ -536,20 +525,21 @@ endfun
|
||||
" vimball#ShowMesg: {{{2
|
||||
fun! vimball#ShowMesg(level,msg)
|
||||
" call Dfunc("vimball#ShowMesg(level=".a:level." msg<".a:msg.">)")
|
||||
|
||||
let rulerkeep = &ruler
|
||||
let showcmdkeep = &showcmd
|
||||
set noruler noshowcmd
|
||||
redraw!
|
||||
|
||||
if &fo =~ '[ta]'
|
||||
echomsg "***vimball*** " a:msg
|
||||
echomsg "***vimball*** ".a:msg
|
||||
else
|
||||
if a:level == s:WARNING || a:level == s:USAGE
|
||||
echohl WarningMsg
|
||||
elseif a:level == s:ERROR
|
||||
echohl Error
|
||||
endif
|
||||
echomsg "***vimball*** " a:msg
|
||||
echomsg "***vimball*** ".a:msg
|
||||
echohl None
|
||||
endif
|
||||
|
||||
@ -646,9 +636,9 @@ fun! s:RecordInFile(home)
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" s:VimballHome: determine/get home directory path (usually from rtp) {{{2
|
||||
fun! s:VimballHome()
|
||||
" call Dfunc("VimballHome()")
|
||||
" vimball#VimballHome: determine/get home directory path (usually from rtp) {{{2
|
||||
fun! vimball#VimballHome()
|
||||
" call Dfunc("vimball#VimballHome()")
|
||||
if exists("g:vimball_home")
|
||||
let home= g:vimball_home
|
||||
else
|
||||
@ -674,14 +664,14 @@ fun! s:VimballHome()
|
||||
if !isdirectory(home)
|
||||
if exists("g:vimball_mkdir")
|
||||
" call Decho("home<".home."> isn't a directory -- making it now with g:vimball_mkdir<".g:vimball_mkdir.">")
|
||||
" call Decho("system(".g:vimball_mkdir." ".s:Escape(home).")")
|
||||
call system(g:vimball_mkdir." ".s:Escape(home))
|
||||
" call Decho("system(".g:vimball_mkdir." ".shellescape(home).")")
|
||||
call system(g:vimball_mkdir." ".shellescape(home))
|
||||
else
|
||||
" call Decho("home<".home."> isn't a directory -- making it now with mkdir()")
|
||||
call mkdir(home)
|
||||
endif
|
||||
endif
|
||||
" call Dret("VimballHome <".home.">")
|
||||
" call Dret("vimball#VimballHome <".home.">")
|
||||
return home
|
||||
endfun
|
||||
|
||||
@ -742,21 +732,6 @@ fun! vimball#RestoreSettings()
|
||||
" call Dret("RestoreSettings")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" s:Escape: {{{2
|
||||
fun s:Escape(name)
|
||||
" shellescape() was added by patch 7.0.111
|
||||
if exists("*shellescape")
|
||||
return shellescape(a:name)
|
||||
endif
|
||||
return g:netrw_shq . a:name . g:netrw_shq
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Restore:
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Modelines: {{{1
|
||||
" vim: fdm=marker
|
||||
|
@ -1,9 +1,9 @@
|
||||
" Vim color file
|
||||
" Maintainer: Hans Fugal <hans@fugal.net>
|
||||
" Last Change: $Date$
|
||||
" Last Change: $Date$
|
||||
" Last Change: $Date: 2004/06/13 19:30:30 $
|
||||
" Last Change: $Date: 2004/06/13 19:30:30 $
|
||||
" URL: http://hans.fugal.net/vim/colors/desert.vim
|
||||
" Version: $Id$
|
||||
" Version: $Id: desert.vim,v 1.1 2004/06/13 19:30:30 vimboss Exp $
|
||||
|
||||
" cool help screens
|
||||
" :he group-name
|
||||
|
@ -1,13 +1,13 @@
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Vim Ada/Dec Ada compiler file
|
||||
" Language: Ada (Dec Ada)
|
||||
" $Id$
|
||||
" $Id: decada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Copyright: Copyright (C) 2006 Martin Krischik
|
||||
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
|
||||
" $Author$
|
||||
" $Date$
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6
|
||||
" $Revision$
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/decada.vim $
|
||||
" History: 21.07.2006 MK New Dec Ada
|
||||
" 15.10.2006 MK Bram's suggestion for runtime integration
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Language: eRuby
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Info: $Id$
|
||||
" Info: $Id: eruby.vim,v 1.7 2008/06/29 04:18:42 tpope Exp $
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim compiler file
|
||||
" Compiler: g77 (GNU Fortran)
|
||||
" Maintainer: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
||||
" Last Change: $Date$
|
||||
" $Revision$
|
||||
" Last Change: $Date: 2004/06/13 18:17:36 $
|
||||
" $Revision: 1.1 $
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Compiler: GNU C Compiler
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2006-12-20
|
||||
" Latest Revision: 2009-05-01
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@ -12,10 +12,13 @@ let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet errorformat=
|
||||
\%*[^\"]\"%f\"%*\\D%l:%c:\ %m,
|
||||
\%*[^\"]\"%f\"%*\\D%l:\ %m,
|
||||
\\"%f\"%*\\D%l:%c:\ %m,
|
||||
\\"%f\"%*\\D%l:\ %m,
|
||||
\%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\ only\ once,
|
||||
\%-G%f:%l:\ %trror:\ for\ each\ function\ it\ appears\ in.),
|
||||
\%f:%l:%c:\ %m,
|
||||
\%f:%l:\ %m,
|
||||
\\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
||||
|
@ -1,14 +1,14 @@
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Vim Ada/GNAT compiler file
|
||||
" Language: Ada (GNAT)
|
||||
" $Id$
|
||||
" $Id: gnat.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Copyright: Copyright (C) 2006 Martin Krischik
|
||||
" Maintainer: Martin Krischi <krischik@users.sourceforge.net>k
|
||||
" Ned Okie <nokie@radford.edu>
|
||||
" $Author$
|
||||
" $Date$
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6
|
||||
" $Revision$
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/compiler/gnat.vim $
|
||||
" History: 24.05.2006 MK Unified Headers
|
||||
" 16.07.2006 MK Ada-Mode as vim-ball
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim Compiler File
|
||||
" Compiler: Jikes
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Change: 2004 Mar 27
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/compiler
|
||||
" Last Change: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/compiler
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Language: RSpec
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Info: $Id$
|
||||
" Info: $Id: rspec.vim,v 1.2 2008/06/29 04:18:42 tpope Exp $
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
@ -2,7 +2,7 @@
|
||||
" Language: Ruby
|
||||
" Function: Syntax check and/or error reporting
|
||||
" Maintainer: Tim Hammerquist <timh at rubyforge.org>
|
||||
" Info: $Id$
|
||||
" Info: $Id: ruby.vim,v 1.13 2008/06/29 04:18:43 tpope Exp $
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim compiler file
|
||||
" Language: Test::Unit - Ruby Unit Testing Framework
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Info: $Id$
|
||||
" Info: $Id: rubyunit.vim,v 1.12 2008/06/29 04:18:43 tpope Exp $
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Maintainer: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
||||
" Splint Home: http://www.splint.org/
|
||||
" Last Change: 2005 Apr 21
|
||||
" $Revision$
|
||||
" $Revision: 1.3 $
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2008 Aug 03
|
||||
" Last Change: 2009 Dec 24
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@ -110,12 +110,15 @@ au BufNewFile,BufRead build.xml setf ant
|
||||
au BufNewFile,BufRead proftpd.conf* call s:StarSetf('apachestyle')
|
||||
|
||||
" Apache config file
|
||||
au BufNewFile,BufRead .htaccess setf apache
|
||||
au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/apache2/*.conf* call s:StarSetf('apache')
|
||||
au BufNewFile,BufRead .htaccess,/etc/httpd/*.conf setf apache
|
||||
au BufNewFile,BufRead httpd.conf*,srm.conf*,access.conf*,apache.conf*,apache2.conf*,/etc/apache2/*.conf*,/etc/httpd/conf.d/*.conf* call s:StarSetf('apache')
|
||||
|
||||
" XA65 MOS6510 cross assembler
|
||||
au BufNewFile,BufRead *.a65 setf a65
|
||||
|
||||
" Applescript
|
||||
au BufNewFile,BufRead *.scpt setf applescript
|
||||
|
||||
" Applix ELF
|
||||
au BufNewFile,BufRead *.am
|
||||
\ if expand("<afile>") !~? 'Makefile.am\>' | setf elf | endif
|
||||
@ -350,10 +353,9 @@ au BufNewFile,BufRead *.cpp
|
||||
\ if exists("cynlib_syntax_for_cpp")|setf cynlib|else|setf cpp|endif
|
||||
|
||||
" C++
|
||||
au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.ipp,*.moc,*.tcc,*.inl setf cpp
|
||||
if has("fname_case")
|
||||
au BufNewFile,BufRead *.cxx,*.c++,*.C,*.H,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp
|
||||
else
|
||||
au BufNewFile,BufRead *.cxx,*.c++,*.hh,*.hxx,*.hpp,*.moc,*.tcc,*.inl setf cpp
|
||||
au BufNewFile,BufRead *.C,*.H setf cpp
|
||||
endif
|
||||
|
||||
" .h files can be C, Ch C++, ObjC or ObjC++.
|
||||
@ -364,9 +366,9 @@ au BufNewFile,BufRead *.h call s:FTheader()
|
||||
func! s:FTheader()
|
||||
if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1
|
||||
setf objc
|
||||
elseif exists("c_syntax_for_h")
|
||||
elseif exists("g:c_syntax_for_h")
|
||||
setf c
|
||||
elseif exists("ch_syntax_for_h")
|
||||
elseif exists("g:ch_syntax_for_h")
|
||||
setf ch
|
||||
else
|
||||
setf cpp
|
||||
@ -669,8 +671,9 @@ au BufNewFile,BufRead *.factor setf factor
|
||||
" Fetchmail RC file
|
||||
au BufNewFile,BufRead .fetchmailrc setf fetchmail
|
||||
|
||||
" FlexWiki
|
||||
au BufNewFile,BufRead *.wiki setf flexwiki
|
||||
" FlexWiki - disabled, because it has side effects when a .wiki file
|
||||
" is not actually FlexWiki
|
||||
"au BufNewFile,BufRead *.wiki setf flexwiki
|
||||
|
||||
" Focus Executable
|
||||
au BufNewFile,BufRead *.fex,*.focexec setf focexec
|
||||
@ -704,12 +707,12 @@ au BufNewFile,BufRead .gdbinit setf gdb
|
||||
au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
|
||||
|
||||
" Gedcom
|
||||
au BufNewFile,BufRead *.ged setf gedcom
|
||||
au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
|
||||
|
||||
" Git
|
||||
autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG setf gitcommit
|
||||
autocmd BufNewFile,BufRead *.git/config,.gitconfig setf gitconfig
|
||||
autocmd BufNewFile,BufRead git-rebase-todo setf gitrebase
|
||||
autocmd BufNewFile,BufRead *.git/COMMIT_EDITMSG setf gitcommit
|
||||
autocmd BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules setf gitconfig
|
||||
autocmd BufNewFile,BufRead git-rebase-todo setf gitrebase
|
||||
autocmd BufNewFile,BufRead .msg.[0-9]*
|
||||
\ if getline(1) =~ '^From.*# This line is ignored.$' |
|
||||
\ setf gitsendemail |
|
||||
@ -896,7 +899,7 @@ au BufNewFile,BufRead *.java,*.jav setf java
|
||||
au BufNewFile,BufRead *.jj,*.jjt setf javacc
|
||||
|
||||
" JavaScript, ECMAScript
|
||||
au BufNewFile,BufRead *.js,*.javascript,*.es setf javascript
|
||||
au BufNewFile,BufRead *.js,*.javascript,*.es,*.jsx setf javascript
|
||||
|
||||
" Java Server Pages
|
||||
au BufNewFile,BufRead *.jsp setf jsp
|
||||
@ -1043,7 +1046,7 @@ func! s:FTm()
|
||||
let n = 1
|
||||
while n < 10
|
||||
let line = getline(n)
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\)'
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|/\*\|//\)'
|
||||
setf objc
|
||||
return
|
||||
endif
|
||||
@ -1070,6 +1073,9 @@ au BufNewFile,BufRead *.nb setf mma
|
||||
" Maya Extension Language
|
||||
au BufNewFile,BufRead *.mel setf mel
|
||||
|
||||
" Mercurial config (looks like generic config file)
|
||||
au BufNewFile,BufRead *.hgrc,*hgrc setf cfg
|
||||
|
||||
" Messages
|
||||
au BufNewFile,BufRead /var/log/messages,/var/log/messages.*[0-9] setf messages
|
||||
|
||||
@ -1260,7 +1266,7 @@ if has("fname_case")
|
||||
else
|
||||
au BufNewFile,BufRead *.pl call s:FTpl()
|
||||
endif
|
||||
au BufNewFile,BufRead *.plx setf perl
|
||||
au BufNewFile,BufRead *.plx,*.al setf perl
|
||||
|
||||
func! s:FTpl()
|
||||
if exists("g:filetype_pl")
|
||||
@ -1552,6 +1558,7 @@ endfunc
|
||||
|
||||
" Remind
|
||||
au BufNewFile,BufRead .reminders* call s:StarSetf('remind')
|
||||
au BufNewFile,BufRead *.remind,*.rem setf remind
|
||||
|
||||
" Resolv.conf
|
||||
au BufNewFile,BufRead resolv.conf setf resolv
|
||||
@ -1586,7 +1593,7 @@ au BufNewFile,BufRead *.builder,*.rxml,*.rjs setf ruby
|
||||
" Rantfile and Rakefile is like Ruby
|
||||
au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby
|
||||
|
||||
" S-lang (or shader language!)
|
||||
" S-lang (or shader language, or SmallLisp)
|
||||
au BufNewFile,BufRead *.sl setf slang
|
||||
|
||||
" Samba config
|
||||
@ -1685,7 +1692,15 @@ func! SetFileTypeSH(name)
|
||||
if expand("<amatch>") =~ g:ft_ignore_pat
|
||||
return
|
||||
endif
|
||||
if a:name =~ '\<ksh\>'
|
||||
if a:name =~ '\<csh\>'
|
||||
" Some .sh scripts contain #!/bin/csh.
|
||||
call SetFileTypeShell("csh")
|
||||
return
|
||||
elseif a:name =~ '\<tcsh\>'
|
||||
" Some .sh scripts contain #!/bin/tcsh.
|
||||
call SetFileTypeShell("tcsh")
|
||||
return
|
||||
elseif a:name =~ '\<ksh\>'
|
||||
let b:is_kornshell = 1
|
||||
if exists("b:is_bash")
|
||||
unlet b:is_bash
|
||||
@ -1823,10 +1838,15 @@ au BufNewFile,BufRead *.rules call s:FTRules()
|
||||
|
||||
let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*'
|
||||
func! s:FTRules()
|
||||
if expand('<amatch>:p') =~ '^/etc/udev/\%(rules\.d/\)\=.*\.rules$'
|
||||
let path = expand('<amatch>:p')
|
||||
if path =~ '^/etc/udev/\%(rules\.d/\)\=.*\.rules$'
|
||||
setf udevrules
|
||||
return
|
||||
endif
|
||||
if path =~ '^/etc/ufw/'
|
||||
setf conf " Better than hog
|
||||
return
|
||||
endif
|
||||
try
|
||||
let config_lines = readfile('/etc/udev/udev.conf')
|
||||
catch /^Vim\%((\a\+)\)\=:E484/
|
||||
@ -1909,6 +1929,9 @@ au BufNewFile,BufRead *.cm setf voscm
|
||||
" Sysctl
|
||||
au BufNewFile,BufRead /etc/sysctl.conf setf sysctl
|
||||
|
||||
" Synopsys Design Constraints
|
||||
au BufNewFile,BufRead *.sdc setf sdc
|
||||
|
||||
" Sudoers
|
||||
au BufNewFile,BufRead /etc/sudoers,sudoers.tmp setf sudoers
|
||||
|
||||
@ -1944,6 +1967,10 @@ au BufNewFile,BufRead tags setf tags
|
||||
" TAK
|
||||
au BufNewFile,BufRead *.tak setf tak
|
||||
|
||||
" Task
|
||||
au BufRead,BufNewFile {pending,completed,undo}.data setf taskdata
|
||||
au BufRead,BufNewFile *.task setf taskedit
|
||||
|
||||
" Tcl (JACL too)
|
||||
au BufNewFile,BufRead *.tcl,*.tk,*.itcl,*.itk,*.jacl setf tcl
|
||||
|
||||
@ -2079,8 +2106,13 @@ au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc setf vim
|
||||
" Viminfo file
|
||||
au BufNewFile,BufRead .viminfo,_viminfo setf viminfo
|
||||
|
||||
" Virata Config Script File
|
||||
au BufRead,BufNewFile *.hw,*.module,*.pkg setf virata
|
||||
" Virata Config Script File or Drupal module
|
||||
au BufRead,BufNewFile *.hw,*.module,*.pkg
|
||||
\ if getline(1) =~ '<?php' |
|
||||
\ setf php |
|
||||
\ else |
|
||||
\ setf virata |
|
||||
\ endif
|
||||
|
||||
" Visual Basic (also uses *.bas) or FORM
|
||||
au BufNewFile,BufRead *.frm call s:FTVB("form")
|
||||
@ -2325,6 +2357,9 @@ au BufNewFile,BufRead *fvwm2rc*
|
||||
\| let b:fvwm_version = 2 | call s:StarSetf('fvwm')
|
||||
\|endif
|
||||
|
||||
" Gedcom
|
||||
au BufNewFile,BufRead /tmp/lltmp* call s:StarSetf('gedcom')
|
||||
|
||||
" GTK RC
|
||||
au BufNewFile,BufRead .gtkrc*,gtkrc* call s:StarSetf('gtkrc')
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Abaqus finite element input file (www.abaqus.com)
|
||||
" Maintainer: Carl Osterwisch <osterwischc@asme.org>
|
||||
" Last Change: 2004 Jul 06
|
||||
" Last Change: 2008 Oct 5
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
@ -13,13 +13,6 @@ let b:did_ftplugin = 1
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
" Folding
|
||||
if version >= 600
|
||||
" Fold all lines that do not begin with *
|
||||
setlocal foldexpr=getline(v:lnum)[0]!=\"\*\"
|
||||
setlocal foldmethod=expr
|
||||
endif
|
||||
|
||||
" Set the format of the include file specification for Abaqus
|
||||
" Used in :check gf ^wf [i and other commands
|
||||
setlocal include=\\<\\cINPUT\\s*=
|
||||
@ -42,29 +35,43 @@ setlocal define=^\\*\\a.*\\c\\(NAME\\\|NSET\\\|ELSET\\)\\s*=
|
||||
" Abaqus keywords and identifiers may include a - character
|
||||
setlocal iskeyword+=-
|
||||
|
||||
let b:undo_ftplugin = "setlocal include< includeexpr< isfname<"
|
||||
\ . " comments< commentstring< define< iskeyword<"
|
||||
|
||||
if has("folding")
|
||||
" Fold all lines that do not begin with *
|
||||
setlocal foldexpr=getline(v:lnum)[0]!=\"\*\"
|
||||
setlocal foldmethod=expr
|
||||
let b:undo_ftplugin .= " foldexpr< foldmethod<"
|
||||
endif
|
||||
|
||||
" Set the file browse filter (currently only supported under Win32 gui)
|
||||
if has("gui_win32") && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Abaqus Input Files (*.inp *.inc)\t*.inp;*.inc\n" .
|
||||
\ "Abaqus Results (*.dat)\t*.dat\n" .
|
||||
\ "Abaqus Messages (*.pre *.msg *.sta)\t*.pre;*.msg;*.sta\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
let b:undo_ftplugin .= "|unlet b:browsefilter"
|
||||
endif
|
||||
|
||||
" Define keys used to move [count] sections backward or forward.
|
||||
" TODO: Make this do something intelligent in visual mode.
|
||||
nnoremap <silent> <buffer> [[ :call <SID>Abaqus_Jump('?^\*\a?')<CR>
|
||||
nnoremap <silent> <buffer> ]] :call <SID>Abaqus_Jump('/^\*\a/')<CR>
|
||||
function! <SID>Abaqus_Jump(motion) range
|
||||
let s:count = v:count1
|
||||
mark '
|
||||
while s:count > 0
|
||||
silent! execute a:motion
|
||||
let s:count = s:count - 1
|
||||
endwhile
|
||||
endfunction
|
||||
" Define patterns for the matchit plugin
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let b:match_ignorecase = 1
|
||||
let b:match_words =
|
||||
\ '\*part:\*end\s*part,' .
|
||||
\ '\*assembly:\*end\s*assembly,' .
|
||||
\ '\*instance:\*end\s*instance,' .
|
||||
\ '\*step:\*end\s*step'
|
||||
let b:undo_ftplugin .= "|unlet b:match_ignorecase b:match_words"
|
||||
endif
|
||||
|
||||
" Define keys used to move [count] keywords backward or forward.
|
||||
noremap <silent><buffer> [[ ?^\*\a<CR>:nohlsearch<CR>
|
||||
noremap <silent><buffer> ]] /^\*\a<CR>:nohlsearch<CR>
|
||||
|
||||
" Define key to toggle commenting of the current line or range
|
||||
noremap <silent> <buffer> <m-c> :call <SID>Abaqus_ToggleComment()<CR>j
|
||||
noremap <silent><buffer> <LocalLeader><LocalLeader>
|
||||
\ :call <SID>Abaqus_ToggleComment()<CR>j
|
||||
function! <SID>Abaqus_ToggleComment() range
|
||||
if strpart(getline(a:firstline), 0, 2) == "**"
|
||||
" Un-comment all lines in range
|
||||
@ -75,5 +82,8 @@ function! <SID>Abaqus_ToggleComment() range
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let b:undo_ftplugin .= "|unmap <buffer> [[|unmap <buffer> ]]"
|
||||
\ . "|unmap <buffer> <LocalLeader><LocalLeader>"
|
||||
|
||||
" Restore saved compatibility options
|
||||
let &cpoptions = s:cpo_save
|
||||
|
@ -1,14 +1,14 @@
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Perform Ada specific completion & tagging.
|
||||
" Language: Ada (2005)
|
||||
" $Id$
|
||||
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
|
||||
" Taylor Venable <taylor@metasyntax.net>
|
||||
" Neil Bird <neil@fnxweb.com>
|
||||
" $Author$
|
||||
" $Date$
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6
|
||||
" $Revision$
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/ftplugin/ada.vim $
|
||||
" History: 24.05.2006 MK Unified Headers
|
||||
" 26.05.2006 MK ' should not be in iskeyword.
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: ant
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2003 Sep 29
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: aspvbs
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2004 Jun 28
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: bst
|
||||
" Author: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" $Id$
|
||||
" $Id: bst.vim,v 1.1 2007/05/05 17:37:57 vimboss Exp $
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: generic Changelog file
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2007-05-21
|
||||
" Latest Revision: 2009-05-25
|
||||
" Variables:
|
||||
" g:changelog_timeformat (deprecated: use g:changelog_dateformat instead) -
|
||||
" description: the timeformat used in ChangeLog entries.
|
||||
@ -46,73 +46,78 @@ if &filetype == 'changelog'
|
||||
endif
|
||||
endif
|
||||
|
||||
" Try to figure out a reasonable username of the form:
|
||||
" Full Name <user@host>.
|
||||
if !exists('g:changelog_username')
|
||||
if exists('$EMAIL') && $EMAIL != ''
|
||||
let g:changelog_username = $EMAIL
|
||||
elseif exists('$EMAIL_ADDRESS') && $EMAIL_ADDRESS != ''
|
||||
" This is some Debian junk if I remember correctly.
|
||||
let g:changelog_username = $EMAIL_ADDRESS
|
||||
else
|
||||
" Get the users login name.
|
||||
let login = system('whoami')
|
||||
if v:shell_error
|
||||
let login = 'unknown'
|
||||
else
|
||||
let newline = stridx(login, "\n")
|
||||
if newline != -1
|
||||
let login = strpart(login, 0, newline)
|
||||
endif
|
||||
endif
|
||||
|
||||
" Try to get the full name from gecos field in /etc/passwd.
|
||||
if filereadable('/etc/passwd')
|
||||
for line in readfile('/etc/passwd')
|
||||
if line =~ '^' . login
|
||||
let name = substitute(line,'^\%([^:]*:\)\{4}\([^:]*\):.*$','\1','')
|
||||
" Only keep stuff before the first comma.
|
||||
let comma = stridx(name, ',')
|
||||
if comma != -1
|
||||
let name = strpart(name, 0, comma)
|
||||
endif
|
||||
" And substitute & in the real name with the login of our user.
|
||||
let amp = stridx(name, '&')
|
||||
if amp != -1
|
||||
let name = strpart(name, 0, amp) . toupper(login[0]) .
|
||||
\ strpart(login, 1) . strpart(name, amp + 1)
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
" If we haven't found a name, try to gather it from other places.
|
||||
if !exists('name')
|
||||
" Maybe the environment has something of interest.
|
||||
if exists("$NAME")
|
||||
let name = $NAME
|
||||
else
|
||||
" No? well, use the login name and capitalize first
|
||||
" character.
|
||||
let name = toupper(login[0]) . strpart(login, 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
" Get our hostname.
|
||||
let hostname = system('hostname')
|
||||
if v:shell_error
|
||||
let hostname = 'localhost'
|
||||
else
|
||||
let newline = stridx(hostname, "\n")
|
||||
if newline != -1
|
||||
let hostname = strpart(hostname, 0, newline)
|
||||
endif
|
||||
endif
|
||||
|
||||
" And finally set the username.
|
||||
let g:changelog_username = name . ' <' . login . '@' . hostname . '>'
|
||||
function! s:username()
|
||||
if exists('g:changelog_username')
|
||||
return g:changelog_username
|
||||
elseif $EMAIL != ""
|
||||
return $EMAIL
|
||||
elseif $EMAIL_ADDRESS != ""
|
||||
return $EMAIL_ADDRESS
|
||||
endif
|
||||
endif
|
||||
|
||||
let login = s:login()
|
||||
return printf('%s <%s@%s>', s:name(login), login, s:hostname())
|
||||
endfunction
|
||||
|
||||
function! s:login()
|
||||
return s:trimmed_system_with_default('whoami', 'unknown')
|
||||
endfunction
|
||||
|
||||
function! s:trimmed_system_with_default(command, default)
|
||||
return s:first_line(s:system_with_default(a:command, a:default))
|
||||
endfunction
|
||||
|
||||
function! s:system_with_default(command, default)
|
||||
let output = system(a:command)
|
||||
if v:shell_error
|
||||
return default
|
||||
endif
|
||||
return output
|
||||
endfunction
|
||||
|
||||
function! s:first_line(string)
|
||||
return substitute(a:string, '\n.*$', "", "")
|
||||
endfunction
|
||||
|
||||
function! s:name(login)
|
||||
for name in [s:gecos_name(a:login), $NAME, s:capitalize(a:login)]
|
||||
if name != ""
|
||||
return name
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! s:gecos_name(login)
|
||||
for line in s:try_reading_file('/etc/passwd')
|
||||
if line =~ '^' . a:login . ':'
|
||||
return substitute(s:passwd_field(line, 5), '&', s:capitalize(a:login), "")
|
||||
endif
|
||||
endfor
|
||||
return ""
|
||||
endfunction
|
||||
|
||||
function! s:try_reading_file(path)
|
||||
try
|
||||
return readfile(a:path)
|
||||
endtry
|
||||
return []
|
||||
endfunction
|
||||
|
||||
function! s:passwd_field(line, field)
|
||||
let fields = split(a:line, ':', 1)
|
||||
if len(fields) < field
|
||||
return ""
|
||||
endif
|
||||
return fields[field - 1]
|
||||
endfunction
|
||||
|
||||
function! s:capitalize(word)
|
||||
return toupper(a:word[0]) . strpart(a:word, 1)
|
||||
endfunction
|
||||
|
||||
function! s:hostname()
|
||||
return s:trimmed_system_with_default('hostname', 'localhost')
|
||||
endfunction
|
||||
|
||||
" Format used for new date entries.
|
||||
if !exists('g:changelog_new_date_format')
|
||||
@ -178,7 +183,7 @@ if &filetype == 'changelog'
|
||||
" Ok, now we look for the end of the date entry, and add an entry.
|
||||
call cursor(nextnonblank(line('.') + 1), 1)
|
||||
if search(g:changelog_date_end_entry_search, 'W') > 0
|
||||
let p = line('.') - 1
|
||||
let p = (line('.') == line('$')) ? line('.') : line('.') - 1
|
||||
else
|
||||
let p = line('.')
|
||||
endif
|
||||
@ -217,7 +222,7 @@ if &filetype == 'changelog'
|
||||
endfunction
|
||||
|
||||
if exists(":NewChangelogEntry") != 2
|
||||
map <buffer> <silent> <Leader>o <Esc>:call <SID>new_changelog_entry()<CR>
|
||||
noremap <buffer> <silent> <Leader>o <Esc>:call <SID>new_changelog_entry()<CR>
|
||||
command! -nargs=0 NewChangelogEntry call s:new_changelog_entry()
|
||||
endif
|
||||
|
||||
@ -236,14 +241,48 @@ if &filetype == 'changelog'
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
else
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Add the Changelog opening mapping
|
||||
nmap <silent> <Leader>o :call <SID>open_changelog()<CR>
|
||||
nnoremap <silent> <Leader>o :call <SID>open_changelog()<CR>
|
||||
|
||||
function! s:open_changelog()
|
||||
if !filereadable('ChangeLog')
|
||||
let path = expand('%:p:h')
|
||||
if exists('b:changelog_path')
|
||||
let changelog = b:changelog_path
|
||||
else
|
||||
if exists('b:changelog_name')
|
||||
let name = b:changelog_name
|
||||
else
|
||||
let name = 'ChangeLog'
|
||||
endif
|
||||
while isdirectory(path)
|
||||
let changelog = path . '/' . name
|
||||
if filereadable(changelog)
|
||||
break
|
||||
endif
|
||||
let parent = substitute(path, '/\+[^/]*$', "", "")
|
||||
if path == parent
|
||||
break
|
||||
endif
|
||||
let path = parent
|
||||
endwhile
|
||||
endif
|
||||
if !filereadable(changelog)
|
||||
return
|
||||
endif
|
||||
let buf = bufnr('ChangeLog')
|
||||
|
||||
if exists('b:changelog_entry_prefix')
|
||||
let prefix = call(b:changelog_entry_prefix, [])
|
||||
else
|
||||
let prefix = substitute(strpart(expand('%:p'), strlen(path)), '^/\+', "", "") . ':'
|
||||
endif
|
||||
if !empty(prefix)
|
||||
let prefix = ' ' . prefix
|
||||
endif
|
||||
|
||||
let buf = bufnr(changelog)
|
||||
if buf != -1
|
||||
if bufwinnr(buf) != -1
|
||||
execute bufwinnr(buf) . 'wincmd w'
|
||||
@ -251,9 +290,12 @@ else
|
||||
execute 'sbuffer' buf
|
||||
endif
|
||||
else
|
||||
split ChangeLog
|
||||
execute 'split' fnameescape(changelog)
|
||||
endif
|
||||
|
||||
call s:new_changelog_entry()
|
||||
call s:new_changelog_entry(prefix)
|
||||
endfunction
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: cobol
|
||||
" Author: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" $Id$
|
||||
" $Id: cobol.vim,v 1.1 2007/05/05 17:24:38 vimboss Exp $
|
||||
|
||||
" Insert mode mappings: <C-T> <C-D> <Tab>
|
||||
" Normal mode mappings: < > << >> [[ ]] [] ][
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: config
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2004 Jul 08
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: csc
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2003 Sep 29
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: csh
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2003 Sep 29
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: MS-DOS .bat files
|
||||
" Maintainer: Mike Williams <mrw@eandem.co.uk>
|
||||
" Last Change: 5th February 2003
|
||||
" Last Change: 27th May 2009
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@ -12,10 +12,10 @@ endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" BAT comment formatting
|
||||
setlocal comments=b:rem,b:@rem,b:REM,b:@REM,b:::
|
||||
setlocal comments=b:rem,b:@rem,b:REM,b:@REM,:::
|
||||
setlocal formatoptions-=t formatoptions+=rol
|
||||
|
||||
" Define patterns for the browse file filter
|
||||
if has("gui_win32") && !exists("b:browsefilter")
|
||||
let b:browsefilter = "DOS Batch Files (*.bat, *.btm, *.cmd)\t*.bat;*.btm;*.cmd\nAll Files (*.*)\t*.*\n"
|
||||
let b:browsefilter = "DOS Batch Files (*.bat, *.cmd)\t*.bat;*.cmd\nAll Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: dtd
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 30 Jun 2008
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: eRuby
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Info: $Id$
|
||||
" Info: $Id: eruby.vim,v 1.12 2008/06/29 04:18:43 tpope Exp $
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: generic git output
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Last Change: 2008 Jul 30
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2009 Dec 24
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
@ -29,6 +29,9 @@ if exists('*shellescape') && exists('b:git_dir') && b:git_dir != ''
|
||||
else
|
||||
setlocal keywordprg=git\ show
|
||||
endif
|
||||
if has('gui_running')
|
||||
let &l:keywordprg = substitute(&l:keywordprg,'^git\>','git --no-pager','')
|
||||
endif
|
||||
|
||||
setlocal includeexpr=substitute(v:fname,'^[^/]\\+/','','')
|
||||
let b:undo_ftplugin = "setl keywordprg< path< includeexpr<"
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: git config file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Last Change: 2008 Jun 04
|
||||
" Language: git commit file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2009 Dec 24
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: git config file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Last Change: 2007 Dec 16
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2009 Dec 24
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: git rebase --interactive
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Last Change: 2008 Apr 16
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2009 Dec 24
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
@ -22,12 +22,13 @@ function! s:choose(word)
|
||||
endfunction
|
||||
|
||||
function! s:cycle()
|
||||
call s:choose(get({'s':'edit','p':'squash'},getline('.')[0],'pick'))
|
||||
call s:choose(get({'s':'edit','p':'squash','e':'reword'},getline('.')[0],'pick'))
|
||||
endfunction
|
||||
|
||||
command! -buffer -bar Pick :call s:choose('pick')
|
||||
command! -buffer -bar Squash :call s:choose('squash')
|
||||
command! -buffer -bar Edit :call s:choose('edit')
|
||||
command! -buffer -bar Reword :call s:choose('reword')
|
||||
command! -buffer -bar Cycle :call s:cycle()
|
||||
" The above are more useful when they are mapped; for example:
|
||||
"nnoremap <buffer> <silent> S :Cycle<CR>
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Vim filetype plugin
|
||||
" Language: git send-email message
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Last Change: 2007 Dec 16
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2009 Dec 24
|
||||
|
||||
runtime! ftplugin/mail.vim
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: html
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2007 Nov 20
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Java
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Change: 2005 Mar 28
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Change: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: jsp
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2005 Oct 10
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Mail
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2007 Apr 30
|
||||
" Last Change: 2009 Jun 03
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@ -23,7 +23,7 @@ endif
|
||||
" Set 'formatoptions' to break text lines and keep the comment leader ">".
|
||||
setlocal fo+=tcql
|
||||
|
||||
" Add mappings, unless the user didn't want this.
|
||||
" Add mappings, unless the user doesn't want this.
|
||||
if !exists("no_plugin_maps") && !exists("no_mail_maps")
|
||||
" Quote text by inserting "> "
|
||||
if !hasmapto('<Plug>MailQuote')
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: man
|
||||
" Maintainer: Nam SungHyun <namsh@kldp.org>
|
||||
" Last Change: 2007 Nov 30
|
||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||
" Last Change: 2008 Sep 17
|
||||
|
||||
" To make the ":Man" command available before editing a manual page, source
|
||||
" this script from your startup vimrc file.
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: pascal
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2005 Sep 05
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Perl
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Change: 17 Jul 2008
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Change: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: php
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2007 Nov 10
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Ruby
|
||||
" Maintainer: Gavin Sinclair <gsinclair at gmail.com>
|
||||
" Info: $Id$
|
||||
" Info: $Id: ruby.vim,v 1.40 2008/06/29 04:18:43 tpope Exp $
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: sgml
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2003 Sep 30
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: sh
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2003 Sep 29
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,8 +1,8 @@
|
||||
" SQL filetype plugin file
|
||||
" Language: SQL (Common for Oracle, Microsoft SQL Server, Sybase)
|
||||
" Version: 4.0
|
||||
" Version: 6.0
|
||||
" Maintainer: David Fishburn <fishburn at ianywhere dot com>
|
||||
" Last Change: Wed 27 Feb 2008 04:35:21 PM Eastern Standard Time
|
||||
" Last Change: 2009 Aug 04
|
||||
" Download: http://vim.sourceforge.net/script.php?script_id=454
|
||||
|
||||
" For more details please use:
|
||||
@ -29,6 +29,27 @@
|
||||
"
|
||||
" To change the default dialect, add the following to your vimrc:
|
||||
" let g:sql_type_default = 'sqlanywhere'
|
||||
"
|
||||
" This file also creates a command, SQLGetType, which allows you to
|
||||
" determine what the current dialect is in use.
|
||||
" :SQLGetType
|
||||
"
|
||||
" History
|
||||
"
|
||||
" Version 6.0
|
||||
"
|
||||
" NF: Adds the command SQLGetType
|
||||
"
|
||||
" Version 5.0
|
||||
"
|
||||
" NF: Adds the ability to choose the keys to control SQL completion, just add
|
||||
" the following to your .vimrc:
|
||||
" let g:ftplugin_sql_omni_key = '<C-C>'
|
||||
" let g:ftplugin_sql_omni_key_right = '<Right>'
|
||||
" let g:ftplugin_sql_omni_key_left = '<Left>'
|
||||
"
|
||||
" BF: format-options - Auto-wrap comments using textwidth was turned off
|
||||
" by mistake.
|
||||
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
@ -44,7 +65,7 @@ set cpo=
|
||||
" c Auto-wrap comments using textwidth, inserting the current comment
|
||||
" leader automatically.
|
||||
setlocal formatoptions-=t
|
||||
setlocal formatoptions-=c
|
||||
setlocal formatoptions+=c
|
||||
|
||||
" Functions/Commands to allow the user to change SQL syntax dialects
|
||||
" through the use of :SQLSetType <tab> for completion.
|
||||
@ -154,6 +175,20 @@ if !exists("*SQL_SetType")
|
||||
|
||||
endif
|
||||
|
||||
" Functions/Commands to allow the user determine current SQL syntax dialect
|
||||
" This works with both Vim 6 and 7.
|
||||
|
||||
if !exists("*SQL_GetType")
|
||||
function SQL_GetType()
|
||||
if exists('b:sql_type_override')
|
||||
echomsg "Current SQL dialect in use:".b:sql_type_override
|
||||
else
|
||||
echomsg "Current SQL dialect in use:".g:sql_type_default
|
||||
endif
|
||||
endfunction
|
||||
command! -nargs=0 SQLGetType :call SQL_GetType()
|
||||
endif
|
||||
|
||||
if exists("b:sql_type_override")
|
||||
" echo 'sourcing buffer ftplugin/'.b:sql_type_override.'.vim'
|
||||
if globpath(&runtimepath, 'ftplugin/'.b:sql_type_override.'.vim') != ''
|
||||
@ -311,6 +346,19 @@ if !exists('g:ftplugin_sql_objects')
|
||||
\ ',index,subscription,synchronization,view,variable'
|
||||
endif
|
||||
|
||||
" Key to trigger SQL completion
|
||||
if !exists('g:ftplugin_sql_omni_key')
|
||||
let g:ftplugin_sql_omni_key = '<C-C>'
|
||||
endif
|
||||
" Key to trigger drill into column list
|
||||
if !exists('g:ftplugin_sql_omni_key_right')
|
||||
let g:ftplugin_sql_omni_key_right = '<Right>'
|
||||
endif
|
||||
" Key to trigger drill out of column list
|
||||
if !exists('g:ftplugin_sql_omni_key_left')
|
||||
let g:ftplugin_sql_omni_key_left = '<Left>'
|
||||
endif
|
||||
|
||||
" Replace all ,'s with bars, except ones with numbers after them.
|
||||
" This will most likely be a \{,1} string.
|
||||
let s:ftplugin_sql_objects =
|
||||
@ -382,32 +430,32 @@ if exists('&omnifunc')
|
||||
if !exists('g:omni_sql_no_default_maps')
|
||||
" Static maps which use populate the completion list
|
||||
" using Vim's syntax highlighting rules
|
||||
imap <buffer> <c-c>a <C-\><C-O>:call sqlcomplete#Map('syntax')<CR><C-X><C-O>
|
||||
imap <buffer> <c-c>k <C-\><C-O>:call sqlcomplete#Map('sqlKeyword')<CR><C-X><C-O>
|
||||
imap <buffer> <c-c>f <C-\><C-O>:call sqlcomplete#Map('sqlFunction')<CR><C-X><C-O>
|
||||
imap <buffer> <c-c>o <C-\><C-O>:call sqlcomplete#Map('sqlOption')<CR><C-X><C-O>
|
||||
imap <buffer> <c-c>T <C-\><C-O>:call sqlcomplete#Map('sqlType')<CR><C-X><C-O>
|
||||
imap <buffer> <c-c>s <C-\><C-O>:call sqlcomplete#Map('sqlStatement')<CR><C-X><C-O>
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'a <C-\><C-O>:call sqlcomplete#Map("syntax")<CR><C-X><C-O>'
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'k <C-\><C-O>:call sqlcomplete#Map("sqlKeyword")<CR><C-X><C-O>'
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'f <C-\><C-O>:call sqlcomplete#Map("sqlFunction")<CR><C-X><C-O>'
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'o <C-\><C-O>:call sqlcomplete#Map("sqlOption")<CR><C-X><C-O>'
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'T <C-\><C-O>:call sqlcomplete#Map("sqlType")<CR><C-X><C-O>'
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'s <C-\><C-O>:call sqlcomplete#Map("sqlStatement")<CR><C-X><C-O>'
|
||||
" Dynamic maps which use populate the completion list
|
||||
" using the dbext.vim plugin
|
||||
imap <buffer> <c-c>t <C-\><C-O>:call sqlcomplete#Map('table')<CR><C-X><C-O>
|
||||
imap <buffer> <c-c>p <C-\><C-O>:call sqlcomplete#Map('procedure')<CR><C-X><C-O>
|
||||
imap <buffer> <c-c>v <C-\><C-O>:call sqlcomplete#Map('view')<CR><C-X><C-O>
|
||||
imap <buffer> <c-c>c <C-\><C-O>:call sqlcomplete#Map('column')<CR><C-X><C-O>
|
||||
imap <buffer> <c-c>l <C-\><C-O>:call sqlcomplete#Map('column_csv')<CR><C-X><C-O>
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'t <C-\><C-O>:call sqlcomplete#Map("table")<CR><C-X><C-O>'
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'p <C-\><C-O>:call sqlcomplete#Map("procedure")<CR><C-X><C-O>'
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'v <C-\><C-O>:call sqlcomplete#Map("view")<CR><C-X><C-O>'
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'c <C-\><C-O>:call sqlcomplete#Map("column")<CR><C-X><C-O>'
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'l <C-\><C-O>:call sqlcomplete#Map("column_csv")<CR><C-X><C-O>'
|
||||
" The next 3 maps are only to be used while the completion window is
|
||||
" active due to the <CR> at the beginning of the map
|
||||
imap <buffer> <c-c>L <C-Y><C-\><C-O>:call sqlcomplete#Map('column_csv')<CR><C-X><C-O>
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'L <C-Y><C-\><C-O>:call sqlcomplete#Map("column_csv")<CR><C-X><C-O>'
|
||||
" <C-Right> is not recognized on most Unix systems, so only create
|
||||
" these additional maps on the Windows platform.
|
||||
" If you would like to use these maps, choose a different key and make
|
||||
" the same map in your vimrc.
|
||||
if has('win32')
|
||||
imap <buffer> <c-right> <C-R>=sqlcomplete#DrillIntoTable()<CR>
|
||||
imap <buffer> <c-left> <C-R>=sqlcomplete#DrillOutOfColumns()<CR>
|
||||
endif
|
||||
" if has('win32')
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key_right.' <C-R>=sqlcomplete#DrillIntoTable()<CR>'
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key_left.' <C-R>=sqlcomplete#DrillOutOfColumns()<CR>'
|
||||
" endif
|
||||
" Remove any cached items useful for schema changes
|
||||
imap <buffer> <c-c>R <C-\><C-O>:call sqlcomplete#Map('resetCache')<CR><C-X><C-O>
|
||||
exec 'imap <buffer> '.g:ftplugin_sql_omni_key.'R <C-\><C-O>:call sqlcomplete#Map("resetCache")<CR><C-X><C-O>'
|
||||
endif
|
||||
|
||||
if b:sql_compl_savefunc != ""
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: svg
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2003 Sep 29
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
36
runtime/ftplugin/tcl.vim
Normal file
36
runtime/ftplugin/tcl.vim
Normal file
@ -0,0 +1,36 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Tcl
|
||||
" Maintainer: Robert L Hicks <sigzero@gmail.com>
|
||||
" Latest Revision: 2009-05-01
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Make sure the continuation lines below do not cause problems in
|
||||
" compatibility mode.
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#%s
|
||||
setlocal formatoptions+=croql
|
||||
|
||||
" Change the browse dialog on Windows to show mainly Tcl-related files
|
||||
if has("gui_win32")
|
||||
let b:browsefilter = "Tcl Source Files (.tcl)\t*.tcl\n" .
|
||||
\ "Tcl Test Files (.test)\t*.test\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
endif
|
||||
|
||||
"-----------------------------------------------------------------------------
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp<" .
|
||||
\ " | unlet! b:browsefilter"
|
||||
|
||||
" Restore the saved compatibility options.
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
" vim: set et ts=4 sw=4 tw=78:
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: tcsh
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2003 Sep 29
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Verilog HDL
|
||||
" Maintainer: Chih-Tsun Huang <cthuang@larc.ee.nthu.edu.tw>
|
||||
" Last Change: Mon Sep 5 11:05:54 CST 2005 and 2006 April 30
|
||||
" Last Change: Wed Sep 3 15:24:49 CST 2008
|
||||
" URL: http://larc.ee.nthu.edu.tw/~cthuang/vim/ftplugin/verilog.vim
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
@ -12,6 +12,10 @@ endif
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Set 'cpoptions' to allow line continuations
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Undo the plugin effect
|
||||
let b:undo_ftplugin = "setlocal fo< com< tw<"
|
||||
\ . "| unlet! b:browsefilter b:match_ignorecase b:match_words"
|
||||
@ -28,8 +32,6 @@ if &textwidth == 0
|
||||
setlocal tw=78
|
||||
endif
|
||||
|
||||
set cpo-=C
|
||||
|
||||
" Win32 can filter files in the browse dialog
|
||||
if has("gui_win32") && !exists("b:browsefilter")
|
||||
let b:browsefilter = "Verilog Source Files (*.v)\t*.v\n" .
|
||||
@ -49,3 +51,7 @@ if exists("loaded_matchit")
|
||||
\ '\<task\>:\<endtask\>,' .
|
||||
\ '\<specify\>:\<endspecify\>'
|
||||
endif
|
||||
|
||||
" Reset 'cpoptions' back to the user's setting
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2008 Feb 27
|
||||
" Last Change: 2009 Jan 22
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@ -11,16 +11,20 @@ endif
|
||||
" Don't load another plugin for this buffer
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let cpo_save = &cpo
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< tw< commentstring<"
|
||||
let b:undo_ftplugin = "setl fo< isk< com< tw< commentstring<"
|
||||
\ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
|
||||
|
||||
" Set 'formatoptions' to break comment lines but not other lines,
|
||||
" and insert the comment leader when hitting <CR> or using "o".
|
||||
setlocal fo-=t fo+=croql
|
||||
|
||||
" To allow tag lookup via CTRL-] for autoload functions, '#' must be a
|
||||
" keyword character. E.g., for netrw#Nread().
|
||||
setlocal isk+=#
|
||||
|
||||
" Set 'comments' to format dashed lists in comments
|
||||
setlocal com=sO:\"\ -,mO:\"\ \ ,eO:\"\",:\"
|
||||
|
||||
@ -53,8 +57,7 @@ if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_words =
|
||||
\ '\<fu\%[nction]\>:\<retu\%[rn]\>:\<endf\%[unction]\>,' .
|
||||
\ '\<wh\%[ile]\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<endw\%[hile]\>,' .
|
||||
\ '\<for\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<endfo\%[r]\>,' .
|
||||
\ '\<\(wh\%[ile]\|for\)\>:\<brea\%[k]\>:\<con\%[tinue]\>:\<end\(w\%[hile]\|fo\%[r]\)\>,' .
|
||||
\ '\<if\>:\<el\%[seif]\>:\<en\%[dif]\>,' .
|
||||
\ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
|
||||
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' .
|
||||
@ -64,7 +67,8 @@ if exists("loaded_matchit")
|
||||
\ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"'
|
||||
endif
|
||||
|
||||
let &cpo = cpo_save
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" removed this, because 'cpoptions' is a global option.
|
||||
" setlocal cpo+=M " makes \%( match \)
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: xhtml
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2004 Jul 08
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: xml
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 30 Jun 2008
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: xsd
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2003 Sep 29
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: xslt
|
||||
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
|
||||
" Last Changed: 2004 Jul 08
|
||||
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
"------------------------------------------------------------------------------
|
||||
" Description: Vim Ada indent file
|
||||
" Language: Ada (2005)
|
||||
" $Id$
|
||||
" $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $
|
||||
" Copyright: Copyright (C) 2006 Martin Krischik
|
||||
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
|
||||
" Neil Bird <neil@fnxweb.com>
|
||||
" Ned Okie <nokie@radford.edu>
|
||||
" $Author$
|
||||
" $Date$
|
||||
" $Author: krischik $
|
||||
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
|
||||
" Version: 4.6
|
||||
" $Revision$
|
||||
" $Revision: 887 $
|
||||
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/indent/ada.vim $
|
||||
" History: 24.05.2006 MK Unified Headers
|
||||
" 16.07.2006 MK Ada-Mode as vim-ball
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: bst
|
||||
" Author: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" $Id$
|
||||
" $Id: bst.vim,v 1.1 2007/05/05 18:11:12 vimboss Exp $
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
|
@ -1,10 +1,10 @@
|
||||
" =============================================================================
|
||||
"
|
||||
" Program: CMake - Cross-Platform Makefile Generator
|
||||
" Module: $RCSfile$
|
||||
" Module: $RCSfile: cmake-indent.vim,v $
|
||||
" Language: VIM
|
||||
" Date: $Date$
|
||||
" Version: $Revision$
|
||||
" Date: $Date: 2006/09/23 21:09:08 $
|
||||
" Version: $Revision: 1.7 $
|
||||
"
|
||||
" =============================================================================
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
" Language: CMake (ft=cmake)
|
||||
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
|
||||
" Maintainer: Andy Cedilnik <andy.cedilnik@kitware.com>
|
||||
" Last Change: $Date$
|
||||
" Version: $Revision$
|
||||
" Last Change: $Date: 2006/09/23 21:09:08 $
|
||||
" Version: $Revision: 1.7 $
|
||||
"
|
||||
" Licence: The CMake license applies to this file. See
|
||||
" http://www.cmake.org/HTML/Copyright.html
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: cobol
|
||||
" Author: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" $Id$
|
||||
" $Id: cobol.vim,v 1.1 2007/05/05 18:08:19 vimboss Exp $
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: C++
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2001 Jun 12
|
||||
" Last Change: 2008 Nov 29
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
@ -11,3 +11,5 @@ let b:did_indent = 1
|
||||
|
||||
" C++ indenting is built-in, thus this is very simple
|
||||
setlocal cindent
|
||||
|
||||
let b:undo_indent = "setl cin<"
|
||||
|
15
runtime/indent/cuda.vim
Normal file
15
runtime/indent/cuda.vim
Normal file
@ -0,0 +1,15 @@
|
||||
" Vim indent file
|
||||
" Language: CUDA
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2008 Nov 29
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" It's just like C indenting
|
||||
setlocal cindent
|
||||
|
||||
let b:undo_indent = "setl cin<"
|
@ -2,8 +2,8 @@
|
||||
" Language: Eiffel
|
||||
" Maintainer: Jocelyn Fiat <eiffel@djoce.net>
|
||||
" Previous-Maintainer: David Clarke <gadicath@dishevelled.net>
|
||||
" $Date$
|
||||
" $Revision$
|
||||
" $Date: 2004/12/09 21:33:52 $
|
||||
" $Revision: 1.3 $
|
||||
" URL: http://www.djoce.net/page/vim/
|
||||
" Last Change: 2004 Sept 14 : removed specific value for tab (sw)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: eRuby
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Info: $Id$
|
||||
" Info: $Id: eruby.vim,v 1.16 2008/06/29 04:18:43 tpope Exp $
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: git config file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Last Change: 2008 Jun 04
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
|
||||
" Last Change: 2009 Dec 24
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
|
13
runtime/indent/mail.vim
Normal file
13
runtime/indent/mail.vim
Normal file
@ -0,0 +1,13 @@
|
||||
" Vim indent file
|
||||
" Language: Mail
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Last Change: 2009 Jun 03
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" What works best is auto-indenting, disable other indenting.
|
||||
" For formatting see the ftplugin.
|
||||
setlocal autoindent nosmartindent nocindent indentexpr=
|
@ -2,17 +2,10 @@
|
||||
" Language: PHP
|
||||
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
|
||||
" URL: http://www.2072productions.com/vim/indent/php.vim
|
||||
" Last Change: 2008 June 7th
|
||||
" Last Change: 2008 November 22nd
|
||||
" Newsletter: http://www.2072productions.com/?to=php-indent-for-vim-newsletter.php
|
||||
" Version: 1.28
|
||||
" Version: 1.30
|
||||
"
|
||||
" If you find a bug, please e-mail me at John.wellesz (AT) teaser (DOT) fr
|
||||
" with an example of code that breaks the algorithm.
|
||||
"
|
||||
" ---> The change log and all the comments have been removed from this file.
|
||||
"
|
||||
" For a complete change log and fully commented code, download the script on
|
||||
" 2072productions.com at the URI provided above.
|
||||
"
|
||||
" If you find a bug, please e-mail me at John.wellesz (AT) teaser (DOT) fr
|
||||
" with an example of code that breaks the algorithm.
|
||||
@ -24,7 +17,7 @@
|
||||
" NOTE: This script must be used with PHP syntax ON and with the php syntax
|
||||
" script by Lutz Eymers (http://www.isp.de/data/php.vim ) or with the
|
||||
" script by Peter Hodge (http://www.vim.org/scripts/script.php?script_id=1571 )
|
||||
" the later is bunbdled by default with vim 7.
|
||||
" the later is bunbdled by default with Vim 7.
|
||||
"
|
||||
"
|
||||
" In the case you have syntax errors in your script such as HereDoc end
|
||||
@ -33,50 +26,19 @@
|
||||
" they are followed by a ';').
|
||||
"
|
||||
"
|
||||
" NOTE: If you are editing file in Unix file format and that (by accident)
|
||||
" there are '\r' before new lines, this script won't be able to proceed
|
||||
" correctly and will make many mistakes because it won't be able to match
|
||||
" '\s*$' correctly.
|
||||
" So you have to remove those useless characters first with a command like:
|
||||
" NOTE: If you are editing files in Unix file format and that (by accident)
|
||||
" there are '\r' before new lines, this script won't be able to proceed
|
||||
" correctly and will make many mistakes because it won't be able to match
|
||||
" '\s*$' correctly.
|
||||
" So you have to remove those useless characters first with a command like:
|
||||
"
|
||||
" :%s /\r$//g
|
||||
" :%s /\r$//g
|
||||
"
|
||||
" or simply 'let' the option PHP_removeCRwhenUnix to 1 and the script will
|
||||
" silently remove them when VIM load this script (at each bufread).
|
||||
"
|
||||
"
|
||||
" Options: PHP_autoformatcomment = 0 to not enable autoformating of comment by
|
||||
" default, if set to 0, this script will let the 'formatoptions' setting intact.
|
||||
"
|
||||
" Options: PHP_default_indenting = # of sw (default is 0), # of sw will be
|
||||
" added to the indent of each line of PHP code.
|
||||
"
|
||||
" Options: PHP_removeCRwhenUnix = 1 to make the script automatically remove CR
|
||||
" at end of lines (by default this option is unset), NOTE that you
|
||||
" MUST remove CR when the fileformat is UNIX else the indentation
|
||||
" won't be correct!
|
||||
"
|
||||
" Options: PHP_BracesAtCodeLevel = 1 to indent the '{' and '}' at the same
|
||||
" level than the code they contain.
|
||||
" Exemple:
|
||||
" Instead of:
|
||||
" if ($foo)
|
||||
" {
|
||||
" foo();
|
||||
" }
|
||||
"
|
||||
" You will write:
|
||||
" if ($foo)
|
||||
" {
|
||||
" foo();
|
||||
" }
|
||||
"
|
||||
" NOTE: The script will be a bit slower if you use this option because
|
||||
" some optimizations won't be available.
|
||||
"
|
||||
" Options: PHP_vintage_case_default_indent = 1 (defaults to 0) to add a meaningless indent
|
||||
" befaore 'case:' and 'default":' statement in switch block
|
||||
" or simply 'let' the option PHP_removeCRwhenUnix to 1 and the script will
|
||||
" silently remove them when VIM load this script (at each bufread).
|
||||
"
|
||||
" Options: See :help php-indent for available options.
|
||||
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
@ -145,6 +107,7 @@ if &fileformat == "unix" && exists("PHP_removeCRwhenUnix") && PHP_removeCRwhenUn
|
||||
endif
|
||||
|
||||
if exists("*GetPhpIndent")
|
||||
call ResetPhpOptions()
|
||||
finish " XXX
|
||||
endif
|
||||
|
||||
@ -317,14 +280,13 @@ endfunction " }}}
|
||||
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|else\)'
|
||||
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|for\%(each\)\=\>\|declare\>\|class\>\|interface\>\|abstract\>\|try\>\|catch\>\)'
|
||||
|
||||
let s:autorestoptions = 0
|
||||
if ! s:autorestoptions
|
||||
au BufWinEnter,Syntax *.php,*.php3,*.php4,*.php5 call ResetOptions()
|
||||
let s:autorestoptions = 1
|
||||
let s:autoresetoptions = 0
|
||||
if ! s:autoresetoptions
|
||||
let s:autoresetoptions = 1
|
||||
endif
|
||||
|
||||
function! ResetOptions()
|
||||
if ! b:optionsset
|
||||
function! ResetPhpOptions()
|
||||
if ! b:optionsset && &filetype == "php"
|
||||
if b:PHP_autoformatcomment
|
||||
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,://,:#
|
||||
@ -341,6 +303,8 @@ function! ResetOptions()
|
||||
endif
|
||||
endfunc
|
||||
|
||||
call ResetPhpOptions()
|
||||
|
||||
function! GetPhpIndent()
|
||||
|
||||
let b:GetLastRealCodeLNum_ADD = 0
|
||||
@ -360,7 +324,7 @@ function! GetPhpIndent()
|
||||
if !b:PHP_indentinghuge && b:PHP_lastindented > b:PHP_indentbeforelast
|
||||
if b:PHP_indentbeforelast
|
||||
let b:PHP_indentinghuge = 1
|
||||
echom 'Large indenting detected, speed optimizations engaged (v1.28)'
|
||||
echom 'Large indenting detected, speed optimizations engaged (v1.30)'
|
||||
endif
|
||||
let b:PHP_indentbeforelast = b:PHP_lastindented
|
||||
endif
|
||||
@ -693,6 +657,7 @@ function! GetPhpIndent()
|
||||
|
||||
if !LastLineClosed
|
||||
|
||||
|
||||
if last_line =~# '[{(]'.endline || last_line =~? '\h\w*\s*(.*,$' && pline !~ '[,(]'.endline
|
||||
|
||||
if !b:PHP_BracesAtCodeLevel || last_line !~# '^\s*{'
|
||||
@ -715,11 +680,11 @@ function! GetPhpIndent()
|
||||
elseif last_line =~ '^\s*'.s:blockstart
|
||||
let ind = ind + &sw
|
||||
|
||||
elseif last_line =~# defaultORcase
|
||||
elseif last_line =~# defaultORcase && cline !~# defaultORcase
|
||||
let ind = ind + &sw
|
||||
|
||||
|
||||
elseif pline =~ '\%(;\%(\s*?>\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|{\)'.endline . '\|' . defaultORcase
|
||||
elseif pline =~ '\%(;\%(\s*?>\)\=\|<<<''\=\a\w*''\=$\|^\s*}\|{\)'.endline . '\|' . defaultORcase && cline !~# defaultORcase
|
||||
|
||||
let ind = ind + &sw
|
||||
endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Ruby
|
||||
" Maintainer: Nikolai Weibull <now at bitwi.se>
|
||||
" Info: $Id$
|
||||
" Info: $Id: ruby.vim,v 1.47 2008/06/29 04:18:43 tpope Exp $
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim indent file
|
||||
" Language: Shell Script
|
||||
" Language: Shell Script
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2006-04-19
|
||||
" Latest Revision: 2010-01-06
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
@ -9,8 +9,10 @@ endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetShIndent()
|
||||
setlocal indentkeys+==then,=do,=else,=elif,=esac,=fi,=fin,=fil,=done
|
||||
setlocal indentkeys+=0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,),0=;;,0=;&
|
||||
setlocal indentkeys+=0=fin,0=fil,0=fip,0=fir,0=fix
|
||||
setlocal indentkeys-=:,0#
|
||||
setlocal nosmartindent
|
||||
|
||||
if exists("*GetShIndent")
|
||||
finish
|
||||
@ -19,34 +21,138 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function GetShIndent()
|
||||
function s:buffer_shiftwidth()
|
||||
return &shiftwidth
|
||||
endfunction
|
||||
|
||||
let s:sh_indent_defaults = {
|
||||
\ 'default': function('s:buffer_shiftwidth'),
|
||||
\ 'continuation-line': function('s:buffer_shiftwidth'),
|
||||
\ 'case-labels': function('s:buffer_shiftwidth'),
|
||||
\ 'case-statements': function('s:buffer_shiftwidth'),
|
||||
\ 'case-breaks': 0 }
|
||||
|
||||
function! s:indent_value(option)
|
||||
let Value = exists('b:sh_indent_options')
|
||||
\ && has_key(b:sh_indent_options, a:option) ?
|
||||
\ b:sh_indent_options[a:option] :
|
||||
\ s:sh_indent_defaults[a:option]
|
||||
if type(Value) == type(function('type'))
|
||||
return Value()
|
||||
endif
|
||||
return Value
|
||||
endfunction
|
||||
|
||||
function! GetShIndent()
|
||||
let lnum = prevnonblank(v:lnum - 1)
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
" Add a 'shiftwidth' after if, while, else, case, until, for, function()
|
||||
" Skip if the line also contains the closure for the above
|
||||
let pnum = prevnonblank(lnum - 1)
|
||||
|
||||
let ind = indent(lnum)
|
||||
let line = getline(lnum)
|
||||
if line =~ '^\s*\(if\|then\|do\|else\|elif\|case\|while\|until\|for\)\>'
|
||||
\ || line =~ '^\s*\<\k\+\>\s*()\s*{'
|
||||
\ || line =~ '^\s*{'
|
||||
if line !~ '\(esac\|fi\|done\)\>\s*$' && line !~ '}\s*$'
|
||||
let ind = ind + &sw
|
||||
if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\)\>'
|
||||
if line !~ '\<\%(fi\|esac\|done\)\>\s*\%(#.*\)\=$'
|
||||
let ind += s:indent_value('default')
|
||||
endif
|
||||
elseif s:is_case_label(line, pnum)
|
||||
if !s:is_case_ended(line)
|
||||
let ind += s:indent_value('case-statements')
|
||||
endif
|
||||
elseif line =~ '^\s*\<\k\+\>\s*()\s*{' || line =~ '^\s*{'
|
||||
if line !~ '}\s*\%(#.*\)\=$'
|
||||
let ind += s:indent_value('default')
|
||||
endif
|
||||
elseif s:is_continuation_line(line)
|
||||
if pnum == 0 || !s:is_continuation_line(getline(pnum))
|
||||
let ind += s:indent_value('continuation-line')
|
||||
endif
|
||||
elseif pnum != 0 && s:is_continuation_line(getline(pnum))
|
||||
let ind = indent(s:find_continued_lnum(pnum))
|
||||
endif
|
||||
|
||||
" Subtract a 'shiftwidth' on a then, do, else, esac, fi, done
|
||||
" Retain the indentation level if line matches fin (for find)
|
||||
let pine = line
|
||||
let line = getline(v:lnum)
|
||||
if (line =~ '^\s*\(then\|do\|else\|elif\|esac\|fi\|done\)\>' || line =~ '^\s*}')
|
||||
\ && line !~ '^\s*fi[ln]\>'
|
||||
let ind = ind - &sw
|
||||
if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\)\>' || line =~ '^\s*}'
|
||||
let ind -= s:indent_value('default')
|
||||
elseif line =~ '^\s*esac\>'
|
||||
let ind -= (s:is_case_label(pine, lnum) && s:is_case_ended(pine) ?
|
||||
\ 0 : s:indent_value('case-statements')) +
|
||||
\ s:indent_value('case-labels')
|
||||
if s:is_case_break(pine)
|
||||
let ind += s:indent_value('case-breaks')
|
||||
endif
|
||||
elseif s:is_case_label(line, lnum)
|
||||
if s:is_case(pine)
|
||||
let ind = indent(lnum) + s:indent_value('case-labels')
|
||||
else
|
||||
let ind -= s:indent_value('case-statements') - s:indent_value('case-breaks')
|
||||
endif
|
||||
elseif s:is_case_break(line)
|
||||
let ind -= s:indent_value('case-breaks')
|
||||
endif
|
||||
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
function! s:is_continuation_line(line)
|
||||
return a:line =~ '\%(\%(^\|[^\\]\)\\\|&&\|||\)$'
|
||||
endfunction
|
||||
|
||||
function! s:find_continued_lnum(lnum)
|
||||
let i = a:lnum
|
||||
while i > 1 && s:is_continuation_line(getline(i - 1))
|
||||
let i -= 1
|
||||
endwhile
|
||||
return i
|
||||
endfunction
|
||||
|
||||
function! s:is_case_label(line, pnum)
|
||||
if a:line !~ '^\s*(\=.*)'
|
||||
return 0
|
||||
endif
|
||||
|
||||
if a:pnum > 0
|
||||
let pine = getline(a:pnum)
|
||||
if !(s:is_case(pine) || s:is_case_ended(pine))
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
|
||||
let suffix = substitute(a:line, '^\s*(\=', "", "")
|
||||
let nesting = 0
|
||||
let i = 0
|
||||
let n = strlen(suffix)
|
||||
while i < n
|
||||
let c = suffix[i]
|
||||
let i += 1
|
||||
if c == '\\'
|
||||
let i += 1
|
||||
elseif c == '('
|
||||
let nesting += 1
|
||||
elseif c == ')'
|
||||
if nesting == 0
|
||||
return 1
|
||||
endif
|
||||
let nesting -= 1
|
||||
endif
|
||||
endwhile
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:is_case(line)
|
||||
return a:line =~ '^\s*case\>'
|
||||
endfunction
|
||||
|
||||
function! s:is_case_break(line)
|
||||
return a:line =~ '^\s*;[;&]'
|
||||
endfunction
|
||||
|
||||
function! s:is_case_ended(line)
|
||||
return s:is_case_break(a:line) || a:line =~ ';[;&]\s*\%(#.*\)\=$'
|
||||
endfunction
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
@ -1,10 +1,11 @@
|
||||
" Language: xml
|
||||
" Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: Tue, 27 Apr 2004 14:54:59 CEST
|
||||
" Last Change: 2009-05-26 00:17:25
|
||||
" Notes: 1) does not indent pure non-xml code (e.g. embedded scripts)
|
||||
" 2) will be confused by unbalanced tags in comments
|
||||
" or CDATA sections.
|
||||
" TODO: implement pre-like tags, see xml_indent_open / xml_indent_close
|
||||
" 2009-05-26 patch by Nikolai Weibull
|
||||
" TODO: implement pre-like tags, see xml_indent_open / xml_indent_close
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
@ -46,6 +47,9 @@ fun! <SID>XmlIndentSynCheck(lnum)
|
||||
if '' != syn1 && syn1 !~ 'xml' && '' != syn2 && syn2 !~ 'xml'
|
||||
" don't indent pure non-xml code
|
||||
return 0
|
||||
elseif syn1 =~ '^xmlComment' && syn2 =~ '^xmlComment'
|
||||
" indent comments specially
|
||||
return -1
|
||||
endif
|
||||
endif
|
||||
return 1
|
||||
@ -74,8 +78,12 @@ fun! XmlIndentGet(lnum, use_syntax_check)
|
||||
endif
|
||||
|
||||
if a:use_syntax_check
|
||||
if 0 == <SID>XmlIndentSynCheck(lnum) || 0 == <SID>XmlIndentSynCheck(a:lnum)
|
||||
let check_lnum = <SID>XmlIndentSynCheck(lnum)
|
||||
let check_alnum = <SID>XmlIndentSynCheck(a:lnum)
|
||||
if 0 == check_lnum || 0 == check_alnum
|
||||
return indent(a:lnum)
|
||||
elseif -1 == check_lnum || -1 == check_alnum
|
||||
return -1
|
||||
endif
|
||||
endif
|
||||
|
||||
|
82
runtime/keymap/dvorak.vim
Normal file
82
runtime/keymap/dvorak.vim
Normal file
@ -0,0 +1,82 @@
|
||||
" Maintainer: Ashish SHUKLA <wahjava@members.fsf.org>
|
||||
" Last Changed: 2009 Jul 04
|
||||
"
|
||||
" All characters are ASCII, conversion to another encoding (e.g., UTF-8)
|
||||
" should work.
|
||||
|
||||
let b:keymap_name = "en-dv"
|
||||
|
||||
loadkeymap
|
||||
q '
|
||||
w ,
|
||||
e .
|
||||
r p
|
||||
t y
|
||||
y f
|
||||
u g
|
||||
i c
|
||||
o r
|
||||
p l
|
||||
[ /
|
||||
] =
|
||||
\\ \\
|
||||
a a
|
||||
s o
|
||||
d e
|
||||
f u
|
||||
g i
|
||||
h d
|
||||
j h
|
||||
k t
|
||||
l n
|
||||
; s
|
||||
' -
|
||||
z ;
|
||||
x q
|
||||
c j
|
||||
v k
|
||||
b x
|
||||
n b
|
||||
m m
|
||||
, w
|
||||
. v
|
||||
/ z
|
||||
Z :
|
||||
X Q
|
||||
C J
|
||||
V K
|
||||
B X
|
||||
N B
|
||||
M M
|
||||
< W
|
||||
> V
|
||||
? Z
|
||||
A A
|
||||
S O
|
||||
D E
|
||||
F U
|
||||
G I
|
||||
H D
|
||||
J H
|
||||
K T
|
||||
L N
|
||||
: S
|
||||
\" _
|
||||
Q "
|
||||
W <
|
||||
E >
|
||||
R P
|
||||
T Y
|
||||
Y F
|
||||
U G
|
||||
I C
|
||||
O R
|
||||
P L
|
||||
{ ?
|
||||
} +
|
||||
| |
|
||||
- [
|
||||
_ {
|
||||
= ]
|
||||
+ }
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Menu Translations: Czech for ISO-8859-2
|
||||
" Maintainer: Jiri Brezina <brzj@seznam.cz>
|
||||
" vim:set foldmethod=marker:
|
||||
" $Revision$
|
||||
" $Date$
|
||||
" $Revision: 1.3 $
|
||||
" $Date: 2005/12/19 22:08:24 $
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
if exists("did_menu_trans")
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Menu Translations: Czech for MS-Windows
|
||||
" Maintainer: Jiri Brezina <brzj@seznam.cz>
|
||||
" vim:set foldmethod=marker:
|
||||
" $Revision$
|
||||
" $Date$
|
||||
" $Revision: 1.3 $
|
||||
" $Date: 2005/12/19 22:13:30 $
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
if exists("did_menu_trans")
|
||||
|
@ -1,8 +1,8 @@
|
||||
" Menu Translations: Czech for systems without localization
|
||||
" Maintainer: Jiri Brezina <brzj@seznam.cz>
|
||||
" vim:set foldmethod=marker:
|
||||
" $Revision$
|
||||
" $Date$
|
||||
" $Revision: 1.3 $
|
||||
" $Date: 2005/12/19 22:06:56 $
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
if exists("did_menu_trans")
|
||||
|
@ -1,7 +1,8 @@
|
||||
" Menu Translations: Espa<70>ol
|
||||
" Maintainer: Alejandro L<>pez-Valencia <dradul@users.sourceforge.net>
|
||||
" Version: 6.4.p0-1
|
||||
" Last Change: 2005 Dec 01
|
||||
" Previous translator: Alejandro L<>pez-Valencia <dradul@users.sourceforge.net>
|
||||
" Last translator: Omar Campagne Polaino <ocampagne@gmail.com>
|
||||
" Version: 7.2.245
|
||||
" Last Change: 2009 Sep 03
|
||||
"
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
@ -28,13 +29,14 @@ menutrans O&rphans Ayude\ a\ los\ ni
|
||||
menutrans Co&pying &T<EFBFBD>rminos\ de\ Licencia
|
||||
menutrans Sponsor/Register Benefactor/Reg<EFBFBD>strese
|
||||
menutrans &Version &Versi<EFBFBD>n\ e\ \informaci<EFBFBD>n\ de\ configuraci<EFBFBD>n
|
||||
menutrans &About &Acerca\ de\ Vim.
|
||||
menutrans &About &Acerca\ de\ Vim
|
||||
|
||||
" File menu
|
||||
menutrans &File &Archivo
|
||||
menutrans &Open\.\.\.<Tab>:e &Abrir\.\.\.<Tab>:e
|
||||
menutrans Sp&lit-Open\.\.\.<Tab>:sp A&brir\ en\ otra\ ventana\.\.\.<Tab>:sp
|
||||
menutrans &New<Tab>:enew &Nuevo<Tab>:enew
|
||||
menutrans Open\ Tab\.\.\.<Tab>:tabnew Abrir\ pes&ta<EFBFBD>a\.\.\.<Tab>:tabnew
|
||||
menutrans &Close<Tab>:close &Cerrar<Tab>:close
|
||||
menutrans &Save<Tab>:w &Guardar<Tab>:w
|
||||
menutrans Save\ &As\.\.\.<Tab>:sav Guardar\ &como\.\.\.<Tab>:sav
|
||||
@ -65,11 +67,12 @@ menutrans Find\ and\ Rep&lace<Tab>:%s Buscar\ y\ R&eemplazar<Tab>:%s
|
||||
menutrans Find\ and\ Rep&lace Buscar\ y\ R&eemplazar
|
||||
menutrans Find\ and\ Rep&lace<Tab>:s Buscar\ y\ R&eemplazar<Tab>:s
|
||||
menutrans Settings\ &Window &Ventana\ de\ opciones
|
||||
menutrans Startup\ &Settings Opciones\ de\ arranque
|
||||
|
||||
" Edit/Global Settings
|
||||
menutrans &Global\ Settings Opciones\ &globales
|
||||
|
||||
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Activar/Desactivar\ &realzado\ de\ sintaxis<Tab>:set\ hls!
|
||||
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Activar/Desactivar\ &resaltado\ de\ sintaxis<Tab>:set\ hls!
|
||||
menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Activar/Desactivar\ &ignorar\ may<EFBFBD>sculas\ y\ min<EFBFBD>sculas<Tab>:set\ ic!
|
||||
menutrans Toggle\ &Showmatch<Tab>:set\ sm! Activar/Desactivar\ &mostrar\ coincidencias<Tab>:set\ sm!
|
||||
|
||||
@ -95,11 +98,11 @@ menutrans Toggle\ &Bottom\ Scrollbar Ocultar/Mostrar\ barra\ de\ desplazamiento\
|
||||
menutrans Toggle\ &Left\ Scrollbar Ocultar/Mostrar\ barra\ de\ desplazamiento\ i&zquierda
|
||||
menutrans Toggle\ &Right\ Scrollbar Ocultar/Mostrar\ barra\ de\ desplazamiento\ &derecha
|
||||
|
||||
let g:menutrans_path_dialog = "Introduzca la ruta de b<>squeda para los ficheros.\nSepare los nombres de los directorios con una coma."
|
||||
let g:menutrans_tags_dialog = "Introduzca los nombres de los fichero de tags.\nSepare los nombres con una coma."
|
||||
let g:menutrans_path_dialog = "Introduzca la ruta de b<>squeda para los archivos.\nSepare los nombres de los directorios con una coma."
|
||||
let g:menutrans_tags_dialog = "Introduzca los nombres de los archivos de tags.\nSepare los nombres con una coma."
|
||||
|
||||
" Edit/File Settings
|
||||
menutrans F&ile\ Settings Opciones\ del\ &fichero
|
||||
menutrans F&ile\ Settings Opciones\ del\ &archivo
|
||||
|
||||
" Boolean options
|
||||
menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Activar/Desactivar\ &numeraci<EFBFBD>n\ de\ l<EFBFBD>neas<Tab>:set\ nu!
|
||||
@ -118,8 +121,8 @@ menutrans Soft\ &Tabstop &Tabulado\
|
||||
menutrans Te&xt\ Width\.\.\. Anchura\ del\ te&xto\.\.\.
|
||||
let g:menutrans_textwidth_dialog = "Introduzca el nuevo ancho del texto (0 para desactivar el quiebre de l<>nea): "
|
||||
|
||||
menutrans &File\ Format\.\.\. &Formato\ del\ fichero\.\.\.
|
||||
let g:menutrans_fileformat_dialog = "Seleccione el formato para escribir el fichero"
|
||||
menutrans &File\ Format\.\.\. &Formato\ del\ archivo\.\.\.
|
||||
let g:menutrans_fileformat_dialog = "Seleccione el formato para escribir el archivo"
|
||||
|
||||
menutrans C&olor\ Scheme Esquema\ de\ c&olores
|
||||
menutrans blue azul
|
||||
@ -154,7 +157,7 @@ menutrans slovak eslovaco
|
||||
menutrans &Tools &Herramientas
|
||||
menutrans &Jump\ to\ this\ tag<Tab>g^] &Saltar\ a\ este\ etiqueta<Tab>g^]
|
||||
menutrans Jump\ &back<Tab>^T Saltar\ &atr<EFBFBD>s<Tab>^T
|
||||
menutrans Build\ &Tags\ File Crear\ fichero\ de\ &etiquetas\
|
||||
menutrans Build\ &Tags\ File Crear\ archivo\ de\ &etiquetas\
|
||||
menutrans &Diff Modo\ de\ &diferencias
|
||||
menutrans &Folding &Plegado
|
||||
menutrans &Make<Tab>:make Ejecutar\ <20>&Make<EFBFBD><Tab>:make
|
||||
@ -169,6 +172,24 @@ menutrans &Set\ Compiler Esco&ger\ el\ compilador\ a\ usar
|
||||
menutrans &Convert\ to\ HEX<Tab>:%!xxd Convertir\ a\ formato\ &hexadecimal<Tab>:%!xxd
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r &Convertir\ al\ formato\ original<Tab>:%!xxd\ -r
|
||||
|
||||
" Tools.Spelling Menu
|
||||
menutrans &Spelling Correcci<EFBFBD>n\ ortogr<EFBFBD>fica
|
||||
menutrans &Spell\ Check\ On &Activar\ correcci<EFBFBD>n\ ortogr<EFBFBD>fica
|
||||
menutrans Spell\ Check\ &Off &Desactivar\ correcci<EFBFBD>n\ ortogr<EFBFBD>fica
|
||||
menutrans To\ &Next\ error<Tab>]s &Siguiente\ error<Tab>]s
|
||||
menutrans To\ &Previous\ error<Tab>[s Error\ &precedente<Tab>[s
|
||||
menutrans Suggest\ &Corrections<Tab>z= Sugerir\ &correcci<EFBFBD>n<Tab>z=
|
||||
menutrans &Repeat\ correction<Tab>:spellrepall &Repetir\ correcci<EFBFBD>n<Tab>:spellrepall
|
||||
an 40.335.205 &Tools.&Spelling.Castellano\ (es) :set spl=es spell<CR>
|
||||
menutrans Set\ language\ to\ "en" Ingl<EFBFBD>s
|
||||
menutrans Set\ language\ to\ "en_au" Ingl<EFBFBD>s\ (en_au)
|
||||
menutrans Set\ language\ to\ "en_ca" Ingl<EFBFBD>s\ (en_ca)
|
||||
menutrans Set\ language\ to\ "en_gb" Ingl<EFBFBD>s\ (en_gb)
|
||||
menutrans Set\ language\ to\ "en_nz" Ingl<EFBFBD>s\ (en_nz)
|
||||
menutrans Set\ language\ to\ "en_us" Ingl<EFBFBD>s\ (en_us)
|
||||
|
||||
menutrans &Find\ More\ Languages &Buscar\ otras\ lenguas
|
||||
|
||||
" Tools.Fold Menu
|
||||
menutrans &Enable/Disable\ folds<Tab>zi &Activar/Desactivar\ pliegues<Tab>zi
|
||||
menutrans &View\ Cursor\ Line<Tab>zv &Ver\ l<EFBFBD>nea\ del\ cursor<Tab>zv
|
||||
@ -182,7 +203,7 @@ menutrans Fold\ Met&hod &M
|
||||
" create and delete folds
|
||||
menutrans Create\ &Fold<Tab>zf Crear\ &pliegue<Tab>zf
|
||||
menutrans &Delete\ Fold<Tab>zd &Suprimir\ pliegue<Tab>zd
|
||||
menutrans Delete\ &All\ Folds<Tab>zD Suprimir\ &todos\ los\ pligues<Tab>zD
|
||||
menutrans Delete\ &All\ Folds<Tab>zD Suprimir\ &todos\ los\ pliegues<Tab>zD
|
||||
" moving around in folds
|
||||
menutrans Fold\ col&umn\ width A&nchura\ de\ columna\ del\ pliegue
|
||||
|
||||
@ -203,7 +224,7 @@ menutrans &Delete &Suprimir
|
||||
menutrans &Alternate &Alternar
|
||||
menutrans &Next Si&guiente
|
||||
menutrans &Previous &Previo
|
||||
let g:menutrans_no_file = "[Sin fichero]"
|
||||
let g:menutrans_no_file = "[Sin archivo]"
|
||||
|
||||
" Window menu
|
||||
menutrans &Window &Ventana
|
||||
@ -211,7 +232,7 @@ menutrans &New<Tab>^Wn Ventana\ &nueva<Tab>^Wn
|
||||
menutrans S&plit<Tab>^Ws &Dividir\ la\ ventana<Tab>^Ws
|
||||
menutrans Sp&lit\ To\ #<Tab>^W^^ D&ividir\ en\ el\ marcador\ (#)<Tab>^W^^
|
||||
menutrans Split\ &Vertically<Tab>^Wv Dividir\ &verticalmente<Tab>^Wv
|
||||
menutrans Split\ File\ E&xplorer &Abrir\ el\ <20>Explorador\ de\ ficheros<EFBFBD>
|
||||
menutrans Split\ File\ E&xplorer &Abrir\ el\ <20>Explorador\ de\ archivos<EFBFBD>
|
||||
menutrans &Close<Tab>^Wc &Cerrar\ esta\ ventana<Tab>^Wc
|
||||
menutrans Close\ &Other(s)<Tab>^Wo Cerrar\ &otra(s)\ ventana(s)<Tab>^Wo
|
||||
menutrans Move\ &To Mov&er\ a
|
||||
@ -245,9 +266,9 @@ if has("toolbar")
|
||||
delfun Do_toolbar_tmenu
|
||||
endif
|
||||
fun Do_toolbar_tmenu()
|
||||
tmenu ToolBar.Open Abrir fichero
|
||||
tmenu ToolBar.Save Guardar fichero
|
||||
tmenu ToolBar.SaveAll Guardar todos los ficheros
|
||||
tmenu ToolBar.Open Abrir archivo
|
||||
tmenu ToolBar.Save Guardar archivo
|
||||
tmenu ToolBar.SaveAll Guardar todos los archivos
|
||||
tmenu ToolBar.Print Imprimir
|
||||
tmenu ToolBar.Undo Deshacer
|
||||
tmenu ToolBar.Redo Rehacer
|
||||
@ -273,7 +294,7 @@ if has("toolbar")
|
||||
tmenu ToolBar.RunScript Ejecutar un archivo de <20>rdenes
|
||||
tmenu ToolBar.Make Ejecutar <20>Make<EFBFBD>
|
||||
tmenu ToolBar.Shell Abrir un int<EFBFBD>rprete de comandos
|
||||
tmenu ToolBar.RunCtags Generar un fichero de etiquetas
|
||||
tmenu ToolBar.RunCtags Generar un archivo de etiquetas
|
||||
tmenu ToolBar.TagJump Saltar a una etiqueta
|
||||
tmenu ToolBar.Help Ayuda
|
||||
tmenu ToolBar.FindHelp Buscar en la ayuda...
|
||||
@ -282,15 +303,15 @@ endif
|
||||
|
||||
" Syntax menu
|
||||
menutrans &Syntax &Sintaxis
|
||||
menutrans &Show\ filetypes\ in\ menu &Mostrar\ listas\ de\ <20>tipo\ de\ fichero<EFBFBD>
|
||||
menutrans &Show\ filetypes\ in\ menu &Mostrar\ listas\ de\ <20>tipo\ de\ archivo<EFBFBD>
|
||||
menutrans Set\ '&syntax'\ only Activar\ s<EFBFBD>lo\ sintaxis
|
||||
menutrans Set\ '&filetype'\ too Activar\ tambi<EFBFBD>n\ <20>tipo\ de\ fichero<EFBFBD>
|
||||
menutrans Set\ '&filetype'\ too Activar\ tambi<EFBFBD>n\ <20>tipo\ de\ archivo<EFBFBD>
|
||||
menutrans &Off &Desactivar\ sintaxis
|
||||
menutrans &Manual sintaxis\ &manual
|
||||
menutrans A&utomatic sintaxis\ a&utom<EFBFBD>tica
|
||||
menutrans on/off\ for\ &This\ file Activar/Desactivar\ en\ es&te\ fichero
|
||||
menutrans &Manual Sintaxis\ &manual
|
||||
menutrans A&utomatic Sintaxis\ a&utom<EFBFBD>tica
|
||||
menutrans on/off\ for\ &This\ file Activar/Desactivar\ en\ es&te\ archivo
|
||||
menutrans Co&lor\ test &Prueba\ de\ colores
|
||||
menutrans &Highlight\ test Prueba\ de\ &realzado
|
||||
menutrans &Highlight\ test Prueba\ de\ &resaltado
|
||||
menutrans &Convert\ to\ HTML &Convertir\ a\ HTML
|
||||
|
||||
" Find Help dialog text
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Menu Translations: Korean
|
||||
" Maintainer: Nam SungHyun <namsh@kldp.org>
|
||||
" Last Change: 2003 Apr 25
|
||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||
" Last Change: 2008 Sep 17
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
if exists("did_menu_trans")
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Menu Translations: Korean
|
||||
" Maintainer: Nam SungHyun <namsh@kldp.org>
|
||||
" Last Change: 2003 Apr 25
|
||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||
" Last Change: 2008 Sep 17
|
||||
|
||||
" Quit when menu translations have already been done.
|
||||
if exists("did_menu_trans")
|
||||
|
@ -1,5 +1,5 @@
|
||||
" Menu Translations: Korean
|
||||
" Translated By: Nam SungHyun <namsh@kldp.org>
|
||||
" Last Change: 2003 Feb 24
|
||||
" Translated By: SungHyun Nam <goweol@gmail.com>
|
||||
" Last Change: 2008 Sep 17
|
||||
|
||||
source <sfile>:p:h/menu_ko_kr.euckr.vim
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Last Change: 26 Apr 2004
|
||||
" URL: cvs://cvs.sf.net:/cvsroot/ruvim/extras/menu/menu_ru_ru.vim
|
||||
"
|
||||
" $Id$
|
||||
" $Id: menu_ru_ru.koi8-r.vim,v 1.2 2004/06/16 11:19:21 vimboss Exp $
|
||||
"
|
||||
" Adopted for RuVim project by Vassily Ragosin.
|
||||
" First translation: Tim Alexeevsky <realtim [at] mail.ru>,
|
||||
|
@ -3,7 +3,7 @@
|
||||
" Last Change: 26 Apr 2004
|
||||
" URL: cvs://cvs.sf.net:/cvsroot/ruvim/extras/menu/menu_ru_ru.vim
|
||||
"
|
||||
" $Id$
|
||||
" $Id: menu_ru_ru.vim,v 1.1 2004/06/13 16:09:10 vimboss Exp $
|
||||
"
|
||||
" Adopted for RuVim project by Vassily Ragosin.
|
||||
" First translation: Tim Alexeevsky <realtim [at] mail.ru>,
|
||||
|
@ -357,7 +357,7 @@ fun! s:InsertRefs(groupBR, prefix, group, suffix, matchline)
|
||||
execute s:Ref(ini, d, "start", "len")
|
||||
let ini = strpart(ini, 0, start) . backref . strpart(ini, start+len)
|
||||
let tailBR = substitute(tailBR, s:notslash . '\zs\\' . d,
|
||||
\ escape(backref, '\\'), 'g')
|
||||
\ escape(backref, '\\&'), 'g')
|
||||
endif
|
||||
let d = d-1
|
||||
endwhile
|
||||
|
@ -2,7 +2,7 @@
|
||||
" You can also use this as a start for your own set of menus.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2008 Jun 30
|
||||
" Last Change: 2009 Feb 26
|
||||
|
||||
" Note that ":an" (short for ":anoremenu") is often used to make a menu work
|
||||
" in all modes and avoid side effects from mappings defined by the user.
|
||||
@ -138,6 +138,7 @@ endfunc
|
||||
func! s:FnameEscape(fname)
|
||||
if exists('*fnameescape')
|
||||
return fnameescape(a:fname)
|
||||
endif
|
||||
return escape(a:fname, " \t\n*?[{`$\\%#'\"|!<")
|
||||
endfunc
|
||||
|
||||
@ -1016,10 +1017,9 @@ else
|
||||
tmenu ToolBar.Copy Copy to clipboard
|
||||
tmenu ToolBar.Paste Paste from Clipboard
|
||||
if !has("gui_athena")
|
||||
tmenu ToolBar.Find Find...
|
||||
tmenu ToolBar.Replace Find / Replace...
|
||||
tmenu ToolBar.FindNext Find Next
|
||||
tmenu ToolBar.FindPrev Find Previous
|
||||
tmenu ToolBar.Replace Find / Replace...
|
||||
endif
|
||||
tmenu ToolBar.LoadSesn Choose a session to load
|
||||
tmenu ToolBar.SaveSesn Save current session
|
||||
|
@ -19,7 +19,7 @@ if &cp || exists("g:loaded_getscriptPlugin")
|
||||
endif
|
||||
finish
|
||||
endif
|
||||
let g:loaded_getscriptPlugin = "v31"
|
||||
let g:loaded_getscriptPlugin = "v32"
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Vim plugin for editing compressed files.
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2005 Jul 26
|
||||
" Last Change: 2009 Jul 01
|
||||
|
||||
" Exit quickly when:
|
||||
" - this plugin was already loaded
|
||||
@ -20,17 +20,21 @@ augroup gzip
|
||||
"
|
||||
" Set binary mode before reading the file.
|
||||
" Use "gzip -d", gunzip isn't always available.
|
||||
autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z setlocal bin
|
||||
autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma setlocal bin
|
||||
autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn")
|
||||
autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d")
|
||||
autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress")
|
||||
autocmd BufReadPost,FileReadPost *.lzma call gzip#read("lzma -d")
|
||||
autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip")
|
||||
autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2")
|
||||
autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f")
|
||||
autocmd BufWritePost,FileWritePost *.lzma call gzip#write("lzma -z")
|
||||
autocmd FileAppendPre *.gz call gzip#appre("gzip -dn")
|
||||
autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d")
|
||||
autocmd FileAppendPre *.Z call gzip#appre("uncompress")
|
||||
autocmd FileAppendPre *.lzma call gzip#appre("lzma -d")
|
||||
autocmd FileAppendPost *.gz call gzip#write("gzip")
|
||||
autocmd FileAppendPost *.bz2 call gzip#write("bzip2")
|
||||
autocmd FileAppendPost *.Z call gzip#write("compress -f")
|
||||
autocmd FileAppendPost *.lzma call gzip#write("lzma -z")
|
||||
augroup END
|
||||
|
@ -1,6 +1,6 @@
|
||||
" Vim plugin for showing matching parens
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2008 Feb 27
|
||||
" Last Change: 2008 Sep 03
|
||||
|
||||
" Exit quickly when:
|
||||
" - this plugin was already loaded (or disabled)
|
||||
@ -21,7 +21,7 @@ if exists("*s:Highlight_Matching_Pair")
|
||||
finish
|
||||
endif
|
||||
|
||||
let cpo_save = &cpo
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
" The function that is invoked (very often) to define a ":match" highlighting
|
||||
@ -147,4 +147,5 @@ command! NoMatchParen windo 3match none | unlet! g:loaded_matchparen |
|
||||
\ au! matchparen
|
||||
command! DoMatchParen runtime plugin/matchparen.vim | windo doau CursorMoved
|
||||
|
||||
let &cpo = cpo_save
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
@ -1,6 +1,6 @@
|
||||
" netrwPlugin.vim: Handles file transfer and remote directory listing across a network
|
||||
" PLUGIN SECTION
|
||||
" Date: Aug 01, 2008
|
||||
" Date: Aug 10, 2008
|
||||
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
|
||||
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
||||
" Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1
|
||||
@ -16,19 +16,16 @@
|
||||
" But be doers of the Word, and not only hearers, deluding your own selves {{{1
|
||||
" (James 1:22 RSV)
|
||||
" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Load Once: {{{1
|
||||
if &cp || exists("g:loaded_netrwPlugin")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwPlugin = "v132"
|
||||
let s:keepcpo = &cpo
|
||||
if v:version < 700
|
||||
echohl WarningMsg | echo "***netrw*** you need vim version 7.0 for this version of netrw" | echohl None
|
||||
let g:loaded_netrwPlugin = "v136"
|
||||
if v:version < 702
|
||||
echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
@ -52,8 +49,8 @@ augroup Network
|
||||
au BufReadCmd file://* exe "silent doau BufReadPre ".fnameescape(netrw#RFC2396(expand("<amatch>")))|exe 'e '.fnameescape(substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',""))|exe "bwipe ".fnameescape(expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(netrw#RFC2396(expand("<amatch>")))
|
||||
au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".fnameescape(netrw#RFC2396(expand("<amatch>")))|exe 'e '.fnameescape(substitute(netrw#RFC2396(expand("<amatch>")),'file://localhost/\(.*\)','\1',""))|exe "bwipe ".fnameescape(substitute(expand("<amatch>"),'file://\(\k\+@\)\=','',''))|exe "silent doau BufReadPost ".fnameescape(netrw#RFC2396(expand("<amatch>")))
|
||||
endif
|
||||
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufReadPre ".fnameescape(expand("<amatch>"))|exe '2Nread '.fnameescape(expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(expand("<amatch>"))
|
||||
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau FileReadPre ".fnameescape(expand("<amatch>"))|exe 'Nread '.fnameescape(expand("<amatch>"))|exe "silent doau FileReadPost ".fnameescape(expand("<amatch>"))
|
||||
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "silent doau BufReadPost ".fnameescape(expand("<amatch>"))
|
||||
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "silent doau FileReadPost ".fnameescape(expand("<amatch>"))
|
||||
au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "silent doau BufWritePost ".fnameescape(expand("<amatch>"))
|
||||
au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,davs://*,rsync://*,sftp://* exe "silent doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "silent doau FileWritePost ".fnameescape(expand("<amatch>"))
|
||||
try
|
||||
@ -155,24 +152,6 @@ fun! NetUserPass(...)
|
||||
" call Dret("NetUserPass")
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" NetReadFixup: this sort of function is typically written by the user {{{1
|
||||
" to handle extra junk that their system's ftp dumps
|
||||
" into the transfer. This function is provided as an
|
||||
" example and as a fix for a Windows 95 problem: in my
|
||||
" experience, win95's ftp always dumped four blank lines
|
||||
" at the end of the transfer.
|
||||
if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
|
||||
fun! NetReadFixup(method, line1, line2)
|
||||
" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
|
||||
if method == 3 " ftp (no <.netrc>)
|
||||
let fourblanklines= line2 - 3
|
||||
silent fourblanklines.",".line2."g/^\s*/d"
|
||||
endif
|
||||
" call Dret("NetReadFixup")
|
||||
endfun
|
||||
endif
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" Modelines And Restoration: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
|
@ -14,7 +14,7 @@
|
||||
if &cp || exists("g:loaded_tarPlugin")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_tarPlugin = "v23"
|
||||
let g:loaded_tarPlugin = "v24"
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
@ -34,13 +34,15 @@ augroup tar
|
||||
au FileWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
|
||||
endif
|
||||
|
||||
au BufReadCmd *.tar.gz call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.tar call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.lrp call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.tgz call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.tar.gz call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.tar call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.lrp call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.tgz call tar#Browse(expand("<amatch>"))
|
||||
au BufReadCmd *.tar.lzma call tar#Browse(expand("<amatch>"))
|
||||
augroup END
|
||||
com! -nargs=? -complete=file Vimuntar call tar#Vimuntar(<q-args>)
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Restoration And Modelines: {{{1
|
||||
|
@ -1,6 +1,6 @@
|
||||
" vimballPlugin : construct a file containing both paths and files
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Copyright: (c) 2004-2007 by Charles E. Campbell, Jr.
|
||||
" Copyright: (c) 2004-2009 by Charles E. Campbell, Jr.
|
||||
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
|
||||
" (see |copyright|) except use "Vimball" instead of "Vim".
|
||||
" No warranty, express or implied.
|
||||
@ -16,18 +16,18 @@
|
||||
if &cp || exists("g:loaded_vimballPlugin")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_vimballPlugin = "v29"
|
||||
let g:loaded_vimballPlugin = "v30"
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
" Public Interface: {{{1
|
||||
com! -ra -complete=file -na=+ -bang MkVimball call vimball#MkVimball(<line1>,<line2>,<bang>0,<f-args>)
|
||||
com! -na=? -complete=dir UseVimball call vimball#Vimball(1,<f-args>)
|
||||
com! -na=0 VimballList call vimball#Vimball(0)
|
||||
com! -na=* -complete=dir RmVimball call vimball#SaveSettings()|call vimball#RmVimball(<f-args>)|call vimball#RestoreSettings()
|
||||
au BufEnter *.vba.gz,*.vba.bz2,*.vba.zip call vimball#Decompress(expand("<amatch>"))
|
||||
au BufEnter *.vba setlocal ff=unix noma bt=nofile fmr=[[[,]]] fdm=marker|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")
|
||||
com! -na=? -complete=dir UseVimball call vimball#Vimball(1,<f-args>)
|
||||
com! -na=0 VimballList call vimball#Vimball(0)
|
||||
com! -na=* -complete=dir RmVimball call vimball#SaveSettings()|call vimball#RmVimball(<f-args>)|call vimball#RestoreSettings()
|
||||
au SourceCmd *.vba.gz,*.vba.bz2,*.vba.zip call vimball#Decompress(expand("<amatch>"))|call vimball#Vimball(1)
|
||||
au BufEnter *.vba,*.vba.gz,*.vba.bz2,*.vba.zip setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'| setlocal ff=unix|endif|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")
|
||||
|
||||
" =====================================================================
|
||||
" Restoration And Modelines: {{{1
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types in scripts
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2008 Aug 09
|
||||
" Last change: 2009 Dec 24
|
||||
|
||||
" This file is called by an autocommand for every file that has just been
|
||||
" loaded into a buffer. It checks if the type of file can be recognized by
|
||||
@ -318,30 +318,31 @@ else
|
||||
set ft=scheme
|
||||
|
||||
" Git output
|
||||
elseif s:line1 =~ '^\(commit\|tree\|object\) \x\{40\}$\|^tag \S\+$'
|
||||
elseif s:line1 =~ '^\(commit\|tree\|object\) \x\{40\}\>\|^tag \S\+$'
|
||||
set ft=git
|
||||
|
||||
" CVS diff
|
||||
else
|
||||
let lnum = 1
|
||||
while getline(lnum) =~ "^? " && lnum < line("$")
|
||||
let lnum = lnum + 1
|
||||
let s:lnum = 1
|
||||
while getline(s:lnum) =~ "^? " && s:lnum < line("$")
|
||||
let s:lnum += 1
|
||||
endwhile
|
||||
if getline(lnum) =~ '^Index:\s\+\f\+$'
|
||||
if getline(s:lnum) =~ '^Index:\s\+\f\+$'
|
||||
set ft=diff
|
||||
|
||||
" locale input files: Formal Definitions of Cultural Conventions
|
||||
" filename must be like en_US, fr_FR@euro or en_US.UTF-8
|
||||
elseif expand("%") =~ '\a\a_\a\a\($\|[.@]\)\|i18n$\|POSIX$\|translit_'
|
||||
let lnum = 1
|
||||
while lnum < 100 && lnum < line("$")
|
||||
if getline(lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$'
|
||||
let s:lnum = 1
|
||||
while s:lnum < 100 && s:lnum < line("$")
|
||||
if getline(s:lnum) =~ '^LC_\(IDENTIFICATION\|CTYPE\|COLLATE\|MONETARY\|NUMERIC\|TIME\|MESSAGES\|PAPER\|TELEPHONE\|MEASUREMENT\|NAME\|ADDRESS\)$'
|
||||
setf fdcc
|
||||
break
|
||||
endif
|
||||
let lnum = lnum + 1
|
||||
let s:lnum += 1
|
||||
endwhile
|
||||
endif
|
||||
unlet s:lnum
|
||||
|
||||
endif
|
||||
|
||||
|
@ -72,7 +72,7 @@ This procedure should work well:
|
||||
change too much, the OpenOffice people are not stupid. However, you may
|
||||
want to remove obvious mistakes. And remove single-letter words that
|
||||
aren't really words, they mess up the suggestions (English has this
|
||||
problem). You can use the "fixdup" Vim script to find duplicate words.
|
||||
problem). You can use the "fixdup.vim" Vim script to find duplicate words.
|
||||
|
||||
3. Make the diff file. "aap diff" will do this for you. If a diff would be
|
||||
too big you might consider writing a Vim script to do systematic changes.
|
||||
|
27
runtime/spell/fixdup.vim
Normal file
27
runtime/spell/fixdup.vim
Normal file
@ -0,0 +1,27 @@
|
||||
" Vim script to fix duplicate words in a .dic file vim: set ft=vim:
|
||||
"
|
||||
" Usage: Edit the .dic file and source this script.
|
||||
|
||||
let deleted = 0
|
||||
|
||||
" Start below the word count.
|
||||
let lnum = 2
|
||||
while lnum <= line('$')
|
||||
let word = getline(lnum)
|
||||
if word !~ '/'
|
||||
if search('^' . word . '/', 'w') != 0
|
||||
let deleted += 1
|
||||
exe lnum . "d"
|
||||
continue " don't increment lnum, it's already at the next word
|
||||
endif
|
||||
endif
|
||||
let lnum += 1
|
||||
endwhile
|
||||
|
||||
if deleted == 0
|
||||
echomsg "No duplicate words found"
|
||||
elseif deleted == 1
|
||||
echomsg "Deleted 1 duplicate word"
|
||||
else
|
||||
echomsg printf("Deleted %d duplicate words", deleted)
|
||||
endif
|
@ -1,13 +1,18 @@
|
||||
" Vim syntax support file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2008 Jul 17
|
||||
" Last Change: 2009 Jul 14
|
||||
" (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
|
||||
" (XHTML support by Panagiotis Issaris <takis@lumumba.luc.ac.be>)
|
||||
" (made w3 compliant by Edd Barrett <vext01@gmail.com>)
|
||||
" (added html_font. Edd Barrett <vext01@gmail.com>)
|
||||
" (dynamic folding by Ben Fritz <fritzophrenic@gmail.com>)
|
||||
|
||||
" Transform a file into HTML, using the current syntax highlighting.
|
||||
|
||||
" this file uses line continuations
|
||||
let s:cpo_sav = &cpo
|
||||
set cpo-=C
|
||||
|
||||
" Number lines when explicitely requested or when `number' is set
|
||||
if exists("html_number_lines")
|
||||
let s:numblines = html_number_lines
|
||||
@ -22,6 +27,37 @@ else
|
||||
let s:htmlfont = "monospace"
|
||||
endif
|
||||
|
||||
" make copies of the user-defined settings that we may overrule
|
||||
if exists("html_dynamic_folds")
|
||||
let s:html_dynamic_folds = 1
|
||||
endif
|
||||
if exists("html_hover_unfold")
|
||||
let s:html_hover_unfold = 1
|
||||
endif
|
||||
if exists("html_use_css")
|
||||
let s:html_use_css = 1
|
||||
endif
|
||||
|
||||
" hover opening implies dynamic folding
|
||||
if exists("s:html_hover_unfold")
|
||||
let s:html_dynamic_folds = 1
|
||||
endif
|
||||
|
||||
" dynamic folding with no foldcolumn implies hover opens
|
||||
if exists("s:html_dynamic_folds") && exists("html_no_foldcolumn")
|
||||
let s:html_hover_unfold = 1
|
||||
endif
|
||||
|
||||
" ignore folding overrides dynamic folding
|
||||
if exists("html_ignore_folding") && exists("s:html_dynamic_folds")
|
||||
unlet s:html_dynamic_folds
|
||||
endif
|
||||
|
||||
" dynamic folding implies css
|
||||
if exists("s:html_dynamic_folds")
|
||||
let s:html_use_css = 1
|
||||
endif
|
||||
|
||||
" When not in gui we can only guess the colors.
|
||||
if has("gui_running")
|
||||
let s:whatterm = "gui"
|
||||
@ -62,7 +98,7 @@ else
|
||||
endfun
|
||||
endif
|
||||
|
||||
if !exists("html_use_css")
|
||||
if !exists("s:html_use_css")
|
||||
" Return opening HTML tag for given highlight id
|
||||
function! s:HtmlOpening(id)
|
||||
let a = ""
|
||||
@ -150,6 +186,26 @@ function! s:CSS1(id)
|
||||
return a
|
||||
endfun
|
||||
|
||||
if exists("s:html_dynamic_folds")
|
||||
|
||||
" compares two folds as stored in our list of folds
|
||||
" A fold is "less" than another if it starts at an earlier line number,
|
||||
" or ends at a later line number, ties broken by fold level
|
||||
function! s:FoldCompare(f1, f2)
|
||||
if a:f1.firstline != a:f2.firstline
|
||||
" put it before if it starts earlier
|
||||
return a:f1.firstline - a:f2.firstline
|
||||
elseif a:f1.lastline != a:f2.lastline
|
||||
" put it before if it ends later
|
||||
return a:f2.lastline - a:f1.lastline
|
||||
else
|
||||
" if folds begin and end on the same lines, put lowest fold level first
|
||||
return a:f1.level - a:f2.level
|
||||
endif
|
||||
endfunction
|
||||
|
||||
endif
|
||||
|
||||
" Figure out proper MIME charset from the 'encoding' option.
|
||||
if exists("html_use_encoding")
|
||||
let s:html_encoding = html_use_encoding
|
||||
@ -223,13 +279,13 @@ else
|
||||
let s:tag_close = '>'
|
||||
endif
|
||||
|
||||
" Cache html_no_pre incase we have to turn it on for non-css mode
|
||||
" Cache html_no_pre in case we have to turn it on for non-css mode
|
||||
if exists("html_no_pre")
|
||||
let s:old_html_no_pre = html_no_pre
|
||||
endif
|
||||
|
||||
if !exists("html_use_css")
|
||||
" Cant put font tags in <pre>
|
||||
if !exists("s:html_use_css")
|
||||
" Can't put font tags in <pre>
|
||||
let html_no_pre=1
|
||||
endif
|
||||
|
||||
@ -251,9 +307,86 @@ if s:html_encoding != ""
|
||||
exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . '"' . s:tag_close . "\n\e"
|
||||
endif
|
||||
|
||||
if exists("html_use_css")
|
||||
exe "normal! a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
|
||||
if exists("s:html_use_css")
|
||||
if exists("s:html_dynamic_folds")
|
||||
if exists("s:html_hover_unfold")
|
||||
" if we are doing hover_unfold, use css 2 with css 1 fallback for IE6
|
||||
exe "normal! a".
|
||||
\ "<style type=\"text/css\">\n<!--\n".
|
||||
\ ".FoldColumn { text-decoration: none; white-space: pre; }\n\n".
|
||||
\ "body * { margin: 0; padding: 0; }\n".
|
||||
\ "\n".
|
||||
\ ".open-fold > .Folded { display: none; }\n".
|
||||
\ ".open-fold > .fulltext { display: inline; }\n".
|
||||
\ ".closed-fold > .fulltext { display: none; }\n".
|
||||
\ ".closed-fold > .Folded { display: inline; }\n".
|
||||
\ "\n".
|
||||
\ ".open-fold > .toggle-open { display: none; }\n".
|
||||
\ ".open-fold > .toggle-closed { display: inline; }\n".
|
||||
\ ".closed-fold > .toggle-open { display: inline; }\n".
|
||||
\ ".closed-fold > .toggle-closed { display: none; }\n"
|
||||
exe "normal! a\n/* opening a fold while hovering won't be supported by IE6 and other\n".
|
||||
\ "similar browsers, but it should fail gracefully. */\n".
|
||||
\ ".closed-fold:hover > .fulltext { display: inline; }\n".
|
||||
\ ".closed-fold:hover > .toggle-filler { display: none; }\n".
|
||||
\ ".closed-fold:hover > .Folded { display: none; }\n"
|
||||
exe "normal! a-->\n</style>\n"
|
||||
exe "normal! a<!--[if lt IE 7]>".
|
||||
\ "<style type=\"text/css\">\n".
|
||||
\ ".open-fold .Folded { display: none; }\n".
|
||||
\ ".open-fold .fulltext { display: inline; }\n".
|
||||
\ ".open-fold .toggle-open { display: none; }\n".
|
||||
\ ".closed-fold .toggle-closed { display: inline; }\n".
|
||||
\ "\n".
|
||||
\ ".closed-fold .fulltext { display: none; }\n".
|
||||
\ ".closed-fold .Folded { display: inline; }\n".
|
||||
\ ".closed-fold .toggle-open { display: inline; }\n".
|
||||
\ ".closed-fold .toggle-closed { display: none; }\n".
|
||||
\ "</style>\n".
|
||||
\ "<![endif]-->\n"
|
||||
else
|
||||
" if we aren't doing hover_unfold, use CSS 1 only
|
||||
exe "normal! a<style type=\"text/css\">\n<!--\n".
|
||||
\ ".FoldColumn { text-decoration: none; white-space: pre; }\n\n".
|
||||
\ ".open-fold .Folded { display: none; }\n".
|
||||
\ ".open-fold .fulltext { display: inline; }\n".
|
||||
\ ".open-fold .toggle-open { display: none; }\n".
|
||||
\ ".closed-fold .toggle-closed { display: inline; }\n".
|
||||
\ "\n".
|
||||
\ ".closed-fold .fulltext { display: none; }\n".
|
||||
\ ".closed-fold .Folded { display: inline; }\n".
|
||||
\ ".closed-fold .toggle-open { display: inline; }\n".
|
||||
\ ".closed-fold .toggle-closed { display: none; }\n".
|
||||
\ "-->\n</style>\n"
|
||||
endif
|
||||
else
|
||||
" if we aren't doing any dynamic folding, no need for any special rules
|
||||
exe "normal! a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
|
||||
endif
|
||||
endif
|
||||
|
||||
" insert javascript to toggle folds open and closed
|
||||
if exists("s:html_dynamic_folds")
|
||||
exe "normal! a\n".
|
||||
\ "<script type='text/javascript'>\n".
|
||||
\ "<!--\n".
|
||||
\ "function toggleFold(objID)\n".
|
||||
\ "{\n".
|
||||
\ " var fold;\n".
|
||||
\ " fold = document.getElementById(objID);\n".
|
||||
\ " if(fold.className == 'closed-fold')\n".
|
||||
\ " {\n".
|
||||
\ " fold.className = 'open-fold';\n".
|
||||
\ " }\n".
|
||||
\ " else if (fold.className == 'open-fold')\n".
|
||||
\ " {\n".
|
||||
\ " fold.className = 'closed-fold';\n".
|
||||
\ " }\n".
|
||||
\ "}\n".
|
||||
\ "-->\n".
|
||||
\ "</script>\n\e"
|
||||
endif
|
||||
|
||||
if exists("html_no_pre")
|
||||
exe "normal! a</head>\n<body>\n\e"
|
||||
else
|
||||
@ -265,7 +398,81 @@ exe s:orgwin . "wincmd w"
|
||||
" List of all id's
|
||||
let s:idlist = ","
|
||||
|
||||
" Loop over all lines in the original text.
|
||||
" First do some preprocessing for dynamic folding. Do this for the entire file
|
||||
" so we don't accidentally start within a closed fold or something.
|
||||
let s:allfolds = []
|
||||
|
||||
if exists("s:html_dynamic_folds")
|
||||
let s:lnum = 1
|
||||
let s:end = line('$')
|
||||
" save the fold text and set it to the default so we can find fold levels
|
||||
let s:foldtext_save = &foldtext
|
||||
set foldtext&
|
||||
|
||||
" we will set the foldcolumn in the html to the greater of the maximum fold
|
||||
" level and the current foldcolumn setting
|
||||
let s:foldcolumn = &foldcolumn
|
||||
|
||||
" get all info needed to describe currently closed folds
|
||||
while s:lnum < s:end
|
||||
if foldclosed(s:lnum) == s:lnum
|
||||
" default fold text has '+-' and then a number of dashes equal to fold
|
||||
" level, so subtract 2 from index of first non-dash after the dashes
|
||||
" in order to get the fold level of the current fold
|
||||
let s:level = match(foldtextresult(s:lnum), '+-*\zs[^-]') - 2
|
||||
if s:level+1 > s:foldcolumn
|
||||
let s:foldcolumn = s:level+1
|
||||
endif
|
||||
" store fold info for later use
|
||||
let s:newfold = {'firstline': s:lnum, 'lastline': foldclosedend(s:lnum), 'level': s:level,'type': "closed-fold"}
|
||||
call add(s:allfolds, s:newfold)
|
||||
" open the fold so we can find any contained folds
|
||||
execute s:lnum."foldopen"
|
||||
else
|
||||
let s:lnum = s:lnum + 1
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" close all folds to get info for originally open folds
|
||||
silent! %foldclose!
|
||||
let s:lnum = 1
|
||||
|
||||
" the originally open folds will be all folds we encounter that aren't
|
||||
" already in the list of closed folds
|
||||
while s:lnum < s:end
|
||||
if foldclosed(s:lnum) == s:lnum
|
||||
" default fold text has '+-' and then a number of dashes equal to fold
|
||||
" level, so subtract 2 from index of first non-dash after the dashes
|
||||
" in order to get the fold level of the current fold
|
||||
let s:level = match(foldtextresult(s:lnum), '+-*\zs[^-]') - 2
|
||||
if s:level+1 > s:foldcolumn
|
||||
let s:foldcolumn = s:level+1
|
||||
endif
|
||||
let s:newfold = {'firstline': s:lnum, 'lastline': foldclosedend(s:lnum), 'level': s:level,'type': "closed-fold"}
|
||||
" only add the fold if we don't already have it
|
||||
if empty(s:allfolds) || index(s:allfolds, s:newfold) == -1
|
||||
let s:newfold.type = "open-fold"
|
||||
call add(s:allfolds, s:newfold)
|
||||
endif
|
||||
" open the fold so we can find any contained folds
|
||||
execute s:lnum."foldopen"
|
||||
else
|
||||
let s:lnum = s:lnum + 1
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" sort the folds so that we only ever need to look at the first item in the
|
||||
" list of folds
|
||||
call sort(s:allfolds, "s:FoldCompare")
|
||||
|
||||
let &foldtext = s:foldtext_save
|
||||
unlet s:foldtext_save
|
||||
|
||||
" close all folds again so we can get the fold text as we go
|
||||
silent! %foldclose!
|
||||
endif
|
||||
|
||||
" Now loop over all lines in the original text to convert to html.
|
||||
" Use html_start_line and html_end_line if they are set.
|
||||
if exists("html_start_line")
|
||||
let s:lnum = html_start_line
|
||||
@ -284,6 +491,15 @@ else
|
||||
let s:end = line("$")
|
||||
endif
|
||||
|
||||
" stack to keep track of all the folds containing the current line
|
||||
let s:foldstack = []
|
||||
|
||||
if s:numblines
|
||||
let s:margin = strlen(s:end) + 1
|
||||
else
|
||||
let s:margin = 0
|
||||
endif
|
||||
|
||||
if has('folding') && !exists('html_ignore_folding')
|
||||
let s:foldfillchar = &fillchars[matchend(&fillchars, 'fold:')]
|
||||
if s:foldfillchar == ''
|
||||
@ -295,6 +511,7 @@ if s:difffillchar == ''
|
||||
let s:difffillchar = '-'
|
||||
endif
|
||||
|
||||
let s:foldId = 0
|
||||
|
||||
while s:lnum <= s:end
|
||||
|
||||
@ -303,12 +520,7 @@ while s:lnum <= s:end
|
||||
if s:filler > 0
|
||||
let s:n = s:filler
|
||||
while s:n > 0
|
||||
if s:numblines
|
||||
" Indent if line numbering is on
|
||||
let s:new = repeat(s:LeadingSpace, strlen(s:end) + 1) . repeat(s:difffillchar, 3)
|
||||
else
|
||||
let s:new = repeat(s:difffillchar, 3)
|
||||
endif
|
||||
let s:new = repeat(s:difffillchar, 3)
|
||||
|
||||
if s:n > 2 && s:n < s:filler && !exists("html_whole_filler")
|
||||
let s:new = s:new . " " . s:filler . " inserted lines "
|
||||
@ -317,10 +529,16 @@ while s:lnum <= s:end
|
||||
|
||||
if !exists("html_no_pre")
|
||||
" HTML line wrapping is off--go ahead and fill to the margin
|
||||
let s:new = s:new . repeat(s:difffillchar, &columns - strlen(s:new))
|
||||
let s:new = s:new . repeat(s:difffillchar, &columns - strlen(s:new) - s:margin)
|
||||
else
|
||||
let s:new = s:new . repeat(s:difffillchar, 3)
|
||||
endif
|
||||
|
||||
let s:new = s:HtmlFormat(s:new, "DiffDelete")
|
||||
if s:numblines
|
||||
" Indent if line numbering is on; must be after escaping.
|
||||
let s:new = repeat(s:LeadingSpace, s:margin) . s:new
|
||||
endif
|
||||
exe s:newwin . "wincmd w"
|
||||
exe "normal! a" . s:new . s:HtmlEndline . "\n\e"
|
||||
exe s:orgwin . "wincmd w"
|
||||
@ -333,16 +551,18 @@ while s:lnum <= s:end
|
||||
|
||||
" Start the line with the line number.
|
||||
if s:numblines
|
||||
let s:new = repeat(' ', strlen(s:end) - strlen(s:lnum)) . s:lnum . ' '
|
||||
let s:numcol = repeat(' ', s:margin - 1 - strlen(s:lnum)) . s:lnum . ' '
|
||||
else
|
||||
let s:new = ""
|
||||
let s:numcol = ""
|
||||
endif
|
||||
|
||||
if has('folding') && !exists('html_ignore_folding') && foldclosed(s:lnum) > -1
|
||||
let s:new = ""
|
||||
|
||||
if has('folding') && !exists('html_ignore_folding') && foldclosed(s:lnum) > -1 && !exists('s:html_dynamic_folds')
|
||||
"
|
||||
" This is the beginning of a folded block
|
||||
" This is the beginning of a folded block (with no dynamic folding)
|
||||
"
|
||||
let s:new = s:new . foldtextresult(s:lnum)
|
||||
let s:new = s:numcol . foldtextresult(s:lnum)
|
||||
if !exists("html_no_pre")
|
||||
" HTML line wrapping is off--go ahead and fill to the margin
|
||||
let s:new = s:new . repeat(s:foldfillchar, &columns - strlen(s:new))
|
||||
@ -355,14 +575,96 @@ while s:lnum <= s:end
|
||||
|
||||
else
|
||||
"
|
||||
" A line that is not folded.
|
||||
" A line that is not folded, or doing dynamic folding.
|
||||
"
|
||||
let s:line = getline(s:lnum)
|
||||
|
||||
let s:len = strlen(s:line)
|
||||
|
||||
if exists("s:html_dynamic_folds")
|
||||
" First insert a closing for any open folds that end on this line
|
||||
while !empty(s:foldstack) && get(s:foldstack,0).lastline == s:lnum-1
|
||||
let s:new = s:new."</span></span>"
|
||||
call remove(s:foldstack, 0)
|
||||
endwhile
|
||||
|
||||
" Now insert an opening any new folds that start on this line
|
||||
let s:firstfold = 1
|
||||
while !empty(s:allfolds) && get(s:allfolds,0).firstline == s:lnum
|
||||
let s:foldId = s:foldId + 1
|
||||
let s:new = s:new . "<span id='fold".s:foldId."' class='".s:allfolds[0].type."'>"
|
||||
|
||||
" Unless disabled, add a fold column for the opening line of a fold.
|
||||
"
|
||||
" Note that dynamic folds require using css so we just use css to take
|
||||
" care of the leading spaces rather than using in the case of
|
||||
" html_no_pre to make it easier
|
||||
if !exists("html_no_foldcolumn")
|
||||
" add fold column that can open the new fold
|
||||
if s:allfolds[0].level > 1 && s:firstfold
|
||||
let s:new = s:new . "<a class='toggle-open FoldColumn' href='javascript:toggleFold(\"fold".s:foldstack[0].id."\")'>"
|
||||
let s:new = s:new . repeat('|', s:allfolds[0].level - 1) . "</a>"
|
||||
endif
|
||||
let s:new = s:new . "<a class='toggle-open FoldColumn' href='javascript:toggleFold(\"fold".s:foldId."\")'>+</a>"
|
||||
let s:new = s:new . "<a class='toggle-open "
|
||||
" If this is not the last fold we're opening on this line, we need
|
||||
" to keep the filler spaces hidden if the fold is opened by mouse
|
||||
" hover. If it is the last fold to open in the line, we shouldn't hide
|
||||
" them, so don't apply the toggle-filler class.
|
||||
if get(s:allfolds, 1, {'firstline': 0}).firstline == s:lnum
|
||||
let s:new = s:new . "toggle-filler "
|
||||
endif
|
||||
let s:new = s:new . "FoldColumn' href='javascript:toggleFold(\"fold".s:foldId."\")'>"
|
||||
let s:new = s:new . repeat(" ", s:foldcolumn - s:allfolds[0].level) . "</a>"
|
||||
|
||||
" add fold column that can close the new fold
|
||||
let s:new = s:new . "<a class='toggle-closed FoldColumn' href='javascript:toggleFold(\"fold".s:foldId."\")'>"
|
||||
if s:firstfold
|
||||
let s:new = s:new . repeat('|', s:allfolds[0].level - 1)
|
||||
endif
|
||||
let s:new = s:new . "-"
|
||||
" only add spaces if we aren't opening another fold on the same line
|
||||
if get(s:allfolds, 1, {'firstline': 0}).firstline != s:lnum
|
||||
let s:new = s:new . repeat(" ", s:foldcolumn - s:allfolds[0].level)
|
||||
endif
|
||||
let s:new = s:new . "</a>"
|
||||
let s:firstfold = 0
|
||||
endif
|
||||
|
||||
" add fold text, moving the span ending to the next line so collapsing
|
||||
" of folds works correctly
|
||||
let s:new = s:new . substitute(s:HtmlFormat(s:numcol . foldtextresult(s:lnum), "Folded"), '</span>', s:HtmlEndline.'\r\0', '')
|
||||
let s:new = s:new . "<span class='fulltext'>"
|
||||
|
||||
" open the fold now that we have the fold text to allow retrieval of
|
||||
" fold text for subsequent folds
|
||||
execute s:lnum."foldopen"
|
||||
call insert(s:foldstack, remove(s:allfolds,0))
|
||||
let s:foldstack[0].id = s:foldId
|
||||
endwhile
|
||||
|
||||
" Unless disabled, add a fold column for other lines.
|
||||
"
|
||||
" Note that dynamic folds require using css so we just use css to take
|
||||
" care of the leading spaces rather than using in the case of
|
||||
" html_no_pre to make it easier
|
||||
if !exists("html_no_foldcolumn")
|
||||
if empty(s:foldstack)
|
||||
" add the empty foldcolumn for unfolded lines
|
||||
let s:new = s:new . s:HtmlFormat(repeat(' ', s:foldcolumn), "FoldColumn")
|
||||
else
|
||||
" add the fold column for folds not on the opening line
|
||||
if get(s:foldstack, 0).firstline < s:lnum
|
||||
let s:new = s:new . "<a class='FoldColumn' href='javascript:toggleFold(\"fold".s:foldstack[0].id."\")'>"
|
||||
let s:new = s:new . repeat('|', s:foldstack[0].level)
|
||||
let s:new = s:new . repeat(' ', s:foldcolumn - s:foldstack[0].level) . "</a>"
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" Now continue with the unfolded line text
|
||||
if s:numblines
|
||||
let s:new = s:HtmlFormat(s:new, "lnr")
|
||||
let s:new = s:new . s:HtmlFormat(s:numcol, "lnr")
|
||||
endif
|
||||
|
||||
" Get the diff attribute, if any.
|
||||
@ -380,7 +682,7 @@ while s:lnum <= s:end
|
||||
while s:col <= s:len && s:id == diff_hlID(s:lnum, s:col) | let s:col = s:col + 1 | endwhile
|
||||
if s:len < &columns && !exists("html_no_pre")
|
||||
" Add spaces at the end to mark the changed line.
|
||||
let s:line = s:line . repeat(' ', &columns - s:len)
|
||||
let s:line = s:line . repeat(' ', &columns - virtcol([s:lnum, s:len]) - s:margin)
|
||||
let s:len = &columns
|
||||
endif
|
||||
else
|
||||
@ -393,11 +695,27 @@ while s:lnum <= s:end
|
||||
|
||||
" Expand tabs
|
||||
let s:expandedtab = strpart(s:line, s:startcol - 1, s:col - s:startcol)
|
||||
let idx = stridx(s:expandedtab, "\t")
|
||||
while idx >= 0
|
||||
let i = &ts - ((idx + s:startcol - 1) % &ts)
|
||||
let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', i), '')
|
||||
let idx = stridx(s:expandedtab, "\t")
|
||||
let s:offset = 0
|
||||
let s:idx = stridx(s:expandedtab, "\t")
|
||||
while s:idx >= 0
|
||||
if has("multi_byte_encoding")
|
||||
if s:startcol + s:idx == 1
|
||||
let s:i = &ts
|
||||
else
|
||||
if s:idx == 0
|
||||
let s:prevc = matchstr(s:line, '.\%' . (s:startcol + s:idx + s:offset) . 'c')
|
||||
else
|
||||
let s:prevc = matchstr(s:expandedtab, '.\%' . (s:idx + 1) . 'c')
|
||||
endif
|
||||
let s:vcol = virtcol([s:lnum, s:startcol + s:idx + s:offset - len(s:prevc)])
|
||||
let s:i = &ts - (s:vcol % &ts)
|
||||
endif
|
||||
let s:offset -= s:i - 1
|
||||
else
|
||||
let s:i = &ts - ((s:idx + s:startcol - 1) % &ts)
|
||||
endif
|
||||
let s:expandedtab = substitute(s:expandedtab, '\t', repeat(' ', s:i), '')
|
||||
let s:idx = stridx(s:expandedtab, "\t")
|
||||
endwhile
|
||||
|
||||
" Output the text with the same synID, with class set to {s:id_name}
|
||||
@ -415,8 +733,22 @@ endwhile
|
||||
" Finish with the last line
|
||||
exe s:newwin . "wincmd w"
|
||||
|
||||
if exists("s:html_dynamic_folds")
|
||||
" finish off any open folds
|
||||
while !empty(s:foldstack)
|
||||
exe "normal! a</span></span>"
|
||||
call remove(s:foldstack, 0)
|
||||
endwhile
|
||||
|
||||
" add fold column to the style list if not already there
|
||||
let s:id = hlID('FoldColumn')
|
||||
if stridx(s:idlist, "," . s:id . ",") == -1
|
||||
let s:idlist = s:idlist . s:id . ","
|
||||
endif
|
||||
endif
|
||||
|
||||
" Close off the font tag that encapsulates the whole <body>
|
||||
if !exists("html_use_css")
|
||||
if !exists("s:html_use_css")
|
||||
exe "normal! a</font>\e"
|
||||
endif
|
||||
|
||||
@ -428,7 +760,7 @@ endif
|
||||
|
||||
|
||||
" Now, when we finally know which, we define the colors and styles
|
||||
if exists("html_use_css")
|
||||
if exists("s:html_use_css")
|
||||
1;/<style type="text/+1
|
||||
endif
|
||||
|
||||
@ -445,7 +777,7 @@ endif
|
||||
" Normal/global attributes
|
||||
" For Netscape 4, set <body> attributes too, though, strictly speaking, it's
|
||||
" incorrect.
|
||||
if exists("html_use_css")
|
||||
if exists("s:html_use_css")
|
||||
if exists("html_no_pre")
|
||||
execute "normal! A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: ". s:htmlfont ."; }\e"
|
||||
else
|
||||
@ -455,12 +787,12 @@ if exists("html_use_css")
|
||||
execute "normal! ^cwbody\e"
|
||||
endif
|
||||
else
|
||||
execute '%s:<body>:<body bgcolor="' . s:bgc . '" text="' . s:fgc . '"><font face="'. s:htmlfont .'">'
|
||||
execute '%s:<body>:<body bgcolor="' . s:bgc . '" text="' . s:fgc . '"><font face="'. s:htmlfont .'">'
|
||||
endif
|
||||
|
||||
" Line numbering attributes
|
||||
if s:numblines
|
||||
if exists("html_use_css")
|
||||
if exists("s:html_use_css")
|
||||
execute "normal! A\n.lnr { " . s:CSS1(hlID("LineNr")) . "}\e"
|
||||
else
|
||||
execute '%s+^<span class="lnr">\([^<]*\)</span>+' . s:HtmlOpening(hlID("LineNr")) . '\1' . s:HtmlClosing(hlID("LineNr")) . '+g'
|
||||
@ -479,14 +811,14 @@ while s:idlist != ""
|
||||
" If the class has some attributes, export the style, otherwise DELETE all
|
||||
" its occurences to make the HTML shorter
|
||||
if s:attr != ""
|
||||
if exists("html_use_css")
|
||||
if exists("s:html_use_css")
|
||||
execute "normal! A\n." . s:id_name . " { " . s:attr . "}"
|
||||
else
|
||||
execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+g'
|
||||
endif
|
||||
else
|
||||
execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+\1+ge'
|
||||
if exists("html_use_css")
|
||||
if exists("s:html_use_css")
|
||||
1;/<style type="text/+1
|
||||
endif
|
||||
endif
|
||||
@ -531,16 +863,28 @@ endif
|
||||
" Save a little bit of memory (worth doing?)
|
||||
unlet s:htmlfont
|
||||
unlet s:old_et s:old_paste s:old_icon s:old_report s:old_title s:old_search
|
||||
unlet s:whatterm s:idlist s:lnum s:end s:fgc s:bgc s:old_magic
|
||||
unlet s:whatterm s:idlist s:lnum s:end s:margin s:fgc s:bgc s:old_magic
|
||||
unlet! s:col s:id s:attr s:len s:line s:new s:expandedtab s:numblines
|
||||
unlet s:orgwin s:newwin s:orgbufnr
|
||||
unlet! s:orgwin s:newwin s:orgbufnr s:idx s:i s:offset
|
||||
if !v:profiling
|
||||
delfunc s:HtmlColor
|
||||
delfunc s:HtmlFormat
|
||||
delfunc s:CSS1
|
||||
if !exists("html_use_css")
|
||||
if !exists("s:html_use_css")
|
||||
delfunc s:HtmlOpening
|
||||
delfunc s:HtmlClosing
|
||||
endif
|
||||
endif
|
||||
silent! unlet s:diffattr s:difffillchar s:foldfillchar s:HtmlSpace s:LeadingSpace s:HtmlEndline
|
||||
silent! unlet s:diffattr s:difffillchar s:foldfillchar s:HtmlSpace s:LeadingSpace s:HtmlEndline s:firstfold s:foldcolumn
|
||||
unlet s:foldstack s:allfolds s:foldId s:numcol
|
||||
|
||||
if exists("s:html_dynamic_folds")
|
||||
delfunc s:FoldCompare
|
||||
endif
|
||||
|
||||
silent! unlet s:html_dynamic_folds s:html_hover_unfold s:html_use_css
|
||||
|
||||
let &cpo = s:cpo_sav
|
||||
unlet s:cpo_sav
|
||||
|
||||
" vim: noet sw=2 sts=2
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user