Skip to content
Snippets Groups Projects
Commit 9964e468 authored by Bram Moolenaar's avatar Bram Moolenaar
Browse files

updated for version 7.1a

parent d5ab34bd
No related merge requests found
Showing
with 5958 additions and 3843 deletions
README.txt for version 7.0 of Vim: Vi IMproved. README.txt for version 7.1a of Vim: Vi IMproved.
WHAT IS VIM WHAT IS VIM
......
README_amibin.txt for version 7.0 of Vim: Vi IMproved. README_amibin.txt for version 7.1a of Vim: Vi IMproved.
See "README.txt" for general information about Vim. See "README.txt" for general information about Vim.
See "README_ami.txt" for installation instructions for the Amiga. See "README_ami.txt" for installation instructions for the Amiga.
......
README_dos.txt for version 7.0 of Vim: Vi IMproved. README_dos.txt for version 7.1a of Vim: Vi IMproved.
This file explains the installation of Vim on MS-DOS and MS-Windows systems. This file explains the installation of Vim on MS-DOS and MS-Windows systems.
See "README.txt" for general information about Vim. See "README.txt" for general information about Vim.
......
README_extra.txt for version 7.0 of Vim: Vi IMproved. README_extra.txt for version 7.1a of Vim: Vi IMproved.
The extra archive of Vim is to be used in combination with the source archive The extra archive of Vim is to be used in combination with the source archive
(vim-7.0-src.tar.gz). The extra archive is useless without it. (vim-7.0-src.tar.gz). The extra archive is useless without it.
......
README_mac.txt for version 7.0 of Vim: Vi IMproved. README_mac.txt for version 7.1a of Vim: Vi IMproved.
This file explains the installation of Vim on Macintosh systems. This file explains the installation of Vim on Macintosh systems.
See "README.txt" for general information about Vim. See "README.txt" for general information about Vim.
......
README_ole.txt for version 7.0 of Vim: Vi IMproved. README_ole.txt for version 7.1a of Vim: Vi IMproved.
This archive contains gvim.exe with OLE interface and VisVim. This archive contains gvim.exe with OLE interface and VisVim.
This version of gvim.exe can also load a number of interface dynamically (you This version of gvim.exe can also load a number of interface dynamically (you
......
"------------------------------------------------------------------------------
" Description: Vim Ada omnicompletion file
" Language: Ada (2005)
" $Id$
" Maintainer: Martin Krischik
" $Author$
" $Date$
" Version: 4.2
" $Revision$
" $HeadURL: https://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.
" 16.07.2006 MK Ada-Mode as vim-ball
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested agaist using setlocal omnifunc
" 05.11.2006 MK Bram suggested to save on spaces
" Help Page: ft-ada-omni
"------------------------------------------------------------------------------
if version < 700
finish
endif
" Section: adacomplete#Complete () {{{1
"
" This function is used for the 'omnifunc' option.
"
function! adacomplete#Complete (findstart, base)
if a:findstart == 1
return ada#User_Complete (a:findstart, a:base)
else
"
" look up matches
"
if exists ("g:ada_omni_with_keywords")
call ada#User_Complete (a:findstart, a:base)
endif
"
" search tag file for matches
"
let l:Pattern = '^' . a:base . '.*$'
let l:Tag_List = taglist (l:Pattern)
"
" add symbols
"
for Tag_Item in l:Tag_List
if l:Tag_Item['kind'] == ''
"
" Tag created by gnat xref
"
let l:Match_Item = {
\ 'word': l:Tag_Item['name'],
\ 'menu': l:Tag_Item['filename'],
\ 'info': "Symbol from file " . l:Tag_Item['filename'] . " line " . l:Tag_Item['cmd'],
\ 'kind': 's',
\ 'icase': 1}
else
"
" Tag created by ctags
"
let l:Info = 'Symbol : ' . l:Tag_Item['name'] . "\n"
let l:Info .= 'Of type : ' . g:ada#Ctags_Kinds[l:Tag_Item['kind']][1] . "\n"
let l:Info .= 'Defined in File : ' . l:Tag_Item['filename'] . "\n"
if has_key( l:Tag_Item, 'package')
let l:Info .= 'Package : ' . l:Tag_Item['package'] . "\n"
let l:Menu = l:Tag_Item['package']
elseif has_key( l:Tag_Item, 'separate')
let l:Info .= 'Separate from Package : ' . l:Tag_Item['separate'] . "\n"
let l:Menu = l:Tag_Item['separate']
elseif has_key( l:Tag_Item, 'packspec')
let l:Info .= 'Package Specification : ' . l:Tag_Item['packspec'] . "\n"
let l:Menu = l:Tag_Item['packspec']
elseif has_key( l:Tag_Item, 'type')
let l:Info .= 'Datetype : ' . l:Tag_Item['type'] . "\n"
let l:Menu = l:Tag_Item['type']
else
let l:Menu = l:Tag_Item['filename']
endif
let l:Match_Item = {
\ 'word': l:Tag_Item['name'],
\ 'menu': l:Menu,
\ 'info': l:Info,
\ 'kind': l:Tag_Item['kind'],
\ 'icase': 1}
endif
if complete_add (l:Match_Item) == 0
return []
endif
if complete_check ()
return []
endif
endfor
return []
endif
endfunction adacomplete#Complete
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker
This diff is collapsed.
"------------------------------------------------------------------------------
" Description: Vim Ada/Dec Ada compiler file
" Language: Ada (Dec Ada)
" $Id$
" Copyright: Copyright (C) 2006 Martin Krischik
" Maintainer: Martin Krischik
" $Author$
" $Date$
" Version: 4.2
" $Revision$
" $HeadURL: https://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
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested to save on spaces
" Help Page: compiler-decada
"------------------------------------------------------------------------------
if version < 700
finish
endif
function decada#Unit_Name () dict " {{{1
" Convert filename into acs unit:
" 1: remove the file extenstion.
" 2: replace all double '_' or '-' with an dot (which denotes a separate)
" 3: remove a trailing '_' (wich denotes a specification)
return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
endfunction decada#Unit_Name " }}}1
function decada#Make () dict " {{{1
let l:make_prg = substitute (g:self.Make_Command, '%<', self.Unit_Name(), '')
let &errorformat = g:self.Error_Format
let &makeprg = l:make_prg
wall
make
copen
set wrap
wincmd W
endfunction decada#Build " }}}1
function decada#Set_Session (...) dict " {{{1
if a:0 > 0
call ada#Switch_Session (a:1)
elseif argc() == 0 && strlen (v:servername) > 0
call ada#Switch_Session (
\ expand('~')[0:-2] . ".vimfiles.session]" .
\ v:servername . ".vim")
endif
return
endfunction decada#Set_Session " }}}1
function decada#New () " }}}1
let Retval = {
\ 'Make' : function ('decada#Make'),
\ 'Unit_Name' : function ('decada#Unit_Name'),
\ 'Set_Session' : function ('decada#Set_Session'),
\ 'Project_Dir' : '',
\ 'Make_Command' : 'ACS COMPILE /Wait /Log /NoPreLoad /Optimize=Development /Debug %<',
\ 'Error_Format' : '%+A%%ADAC-%t-%m,%C %#%m,%Zat line number %l in file %f,' .
\ '%+I%%ada-I-%m,%C %#%m,%Zat line number %l in file %f'}
return Retval
endfunction decada#New " }}}1
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker
" ---------------------------------------------------------------------
" getscript.vim
" Author: Charles E. Campbell, Jr.
" Date: Nov 27, 2006
" Version: 23
" Installing: :help glvs-install
" Usage: :help glvs
"
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
" ---------------------------------------------------------------------
" Initialization: {{{1
" if you're sourcing this file, surely you can't be
" expecting vim to be in its vi-compatible mode
if &cp
echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
finish
endif
let s:keepfo = &fo
let s:keepcpo = &cpo
set cpo&vim
if exists("g:loaded_getscript")
finish
endif
let g:loaded_getscript= "v23"
" ---------------------------------------------------------------------
" Global Variables: {{{1
" allow user to change the command for obtaining scripts (does fetch work?)
if !exists("g:GetLatestVimScripts_wget")
if executable("wget")
let g:GetLatestVimScripts_wget= "wget"
elseif executable("curl")
let g:GetLatestVimScripts_wget= "curl"
else
let g:GetLatestVimScripts_wget = 'echo "GetLatestVimScripts needs wget or curl"'
let g:GetLatestVimScripts_options = ""
endif
endif
" options that wget and curl require:
if !exists("g:GetLatestVimScripts_options")
if g:GetLatestVimScripts_wget == "wget"
let g:GetLatestVimScripts_options= "-q -O"
elseif g:GetLatestVimScripts_wget == "curl"
let g:GetLatestVimScripts_options= "-s -O"
else
let g:GetLatestVimScripts_options= ""
endif
endif
" by default, allow autoinstall lines to work
if !exists("g:GetLatestVimScripts_allowautoinstall")
let g:GetLatestVimScripts_allowautoinstall= 1
endif
"" For debugging:
"let g:GetLatestVimScripts_wget = "echo"
"let g:GetLatestVimScripts_options = "options"
" ---------------------------------------------------------------------
" Check If AutoInstall Capable: {{{1
let s:autoinstall= ""
if g:GetLatestVimScripts_allowautoinstall
if (has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")) && &shell != "bash"
" windows (but not cygwin/bash)
let s:dotvim= "vimfiles"
if !exists("g:GetLatestVimScripts_mv")
let g:GetLatestVimScripts_mv= "ren"
endif
else
" unix
let s:dotvim= ".vim"
if !exists("g:GetLatestVimScripts_mv")
let g:GetLatestVimScripts_mv= "mv"
endif
endif
if exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim)
let s:autoinstall= $HOME."/".s:dotvim
endif
" call Decho("s:autoinstall<".s:autoinstall.">")
"else "Decho
" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled")
endif
" ---------------------------------------------------------------------
" Public Interface: {{{1
com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
com! -nargs=0 GetScript call getscript#GetLatestVimScripts()
silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
" ---------------------------------------------------------------------
" 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.
fun! s:GetOneScript(...)
" call Dfunc("GetOneScript()")
" set options to allow progress to be shown on screen
let t_ti= &t_ti
let t_te= &t_te
let rs = &rs
set t_ti= t_te= nors
" put current line on top-of-screen and interpret it into
" a script identifer : used to obtain webpage
" source identifier : used to identify current version
" and an associated comment: used to report on what's being considered
if a:0 >= 3
let scriptid = a:1
let srcid = a:2
let fname = a:3
let cmmnt = ""
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("fname <".fname.">")
else
let curline = getline(".")
if curline =~ '^\s*#'
" call Dret("GetOneScript : skipping a pure comment line")
return
endif
let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$'
try
let scriptid = substitute(curline,parsepat,'\1','e')
catch /^Vim\%((\a\+)\)\=:E486/
let scriptid= 0
endtry
try
let srcid = substitute(curline,parsepat,'\2','e')
catch /^Vim\%((\a\+)\)\=:E486/
let srcid= 0
endtry
try
let fname= substitute(curline,parsepat,'\3','e')
catch /^Vim\%((\a\+)\)\=:E486/
let fname= ""
endtry
try
let cmmnt= substitute(curline,parsepat,'\4','e')
catch /^Vim\%((\a\+)\)\=:E486/
let cmmnt= ""
endtry
" call Decho("curline <".curline.">")
" call Decho("parsepat<".parsepat.">")
" call Decho("scriptid<".scriptid.">")
" call Decho("srcid <".srcid.">")
" call Decho("fname <".fname.">")
endif
if scriptid == 0 || srcid == 0
" When looking for :AutoInstall: lines, skip scripts that
" have 0 0 scriptname
" call Dret("GetOneScript : skipping a scriptid==srcid==0 line")
return
endif
let doautoinstall= 0
if fname =~ ":AutoInstall:"
" call Decho("fname<".fname."> has :AutoInstall:...")
let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','')
" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall)
if s:autoinstall != ""
let doautoinstall = g:GetLatestVimScripts_allowautoinstall
endif
else
let aicmmnt= fname
endif
" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall)
exe "norm z\<CR>"
redraw!
" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid)
echomsg '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
let tmpfile = tempname()
let v:errmsg = ""
" make three tries at downloading the description
let itry= 1
while itry <= 3
" call Decho("try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr)
if has("win32") || has("win16") || has("win95")
" call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile.' "'.scriptaddr.'"')
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile.' "'.scriptaddr.'"'
else
" call Decho("silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile." '".scriptaddr."'")
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".tmpfile." '".scriptaddr."'"
endif
if itry == 1
exe "silent vsplit ".tmpfile
else
silent! e %
endif
" find the latest source-id in the plugin's webpage
silent! 1
let findpkg= search('Click on the package to download','W')
if findpkg > 0
break
endif
let itry= itry + 1
endwhile
" call Decho(" --- end downloading tries while loop --- itry=".itry)
" testing: did finding /Click on the package.../ fail?
if findpkg == 0 || itry >= 4
silent q!
call delete(tmpfile)
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">"
" call Dret("GetOneScript : srch for /Click on the package/ failed")
return
endif
" call Decho('found "Click on the package to download"')
let findsrcid= search('src_id=','W')
if findsrcid == 0
silent q!
call delete(tmpfile)
" restore options
let &t_ti = t_ti
let &t_te = t_te
let &rs = rs
let s:downerrors = s:downerrors + 1
" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">")
echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">"
" call Dret("GetOneScript : srch for /src_id/ failed")
return
endif
" call Decho('found "src_id=" in description page')
let srcidpat = '^\s*<td class.*src_id=\(\d\+\)">\([^<]\+\)<.*$'
let latestsrcid= substitute(getline("."),srcidpat,'\1','')
let fname = substitute(getline("."),srcidpat,'\2','')
" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> fname<".fname.">")
silent q!
call delete(tmpfile)
" convert the strings-of-numbers into numbers
let srcid = srcid + 0
let latestsrcid = latestsrcid + 0
" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." fname<".fname.">")
" has the plugin's most-recent srcid increased, which indicates
" that it has been updated
if latestsrcid > srcid
let s:downloads= s:downloads + 1
if fname == bufname("%")
" GetLatestVimScript has to be careful about downloading itself
let fname= "NEW_".fname
endif
" the plugin has been updated since we last obtained it, so download a new copy
" call Decho("...downloading new <".fname.">")
echomsg "...downloading new <".fname.">"
if has("win32") || has("gui_win32") || has("gui_win32s") || has("win16") || has("win64") || has("win32unix") || has("win95")
" call Decho("windows: silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname.' "'.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.'"')
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname.' "'.'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid.'"'
else
" call Decho("unix: silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname." '".'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid."'")
exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".fname." '".'http://vim.sf.net/scripts/download_script.php?src_id='.latestsrcid."'"
endif
" AutoInstall: only if doautoinstall is so indicating
if doautoinstall
" call Decho("attempting to do autoinstall: getcwd<".getcwd()."> filereadable(".fname.")=".filereadable(fname))
if filereadable(fname)
" call Decho("move <".fname."> to ".s:autoinstall)
" call Decho("DISABLED for testing")
exe "silent !".g:GetLatestVimScripts_mv." ".fname." ".s:autoinstall
let curdir= escape(substitute(getcwd(),'\','/','ge'),"|[]*'\" #")
exe "cd ".s:autoinstall
if fname =~ '\.bz2$'
" call Decho("attempt to bunzip2 ".fname)
exe "silent !bunzip2 ".fname
let fname= substitute(fname,'\.bz2$','','')
elseif fname =~ '\.gz$'
" call Decho("attempt to gunzip ".fname)
exe "silent !gunzip ".fname
let fname= substitute(fname,'\.gz$','','')
endif
if fname =~ '\.zip$'
" call Decho("attempt to unzip ".fname)
exe "silent !unzip -o".fname
elseif fname =~ '\.tar$'
" call Decho("attempt to untar ".fname)
exe "silent !tar -xvf ".fname
elseif fname =~ '\.vba$'
" call Decho("attempt to handle a vimball: ".fname)
1split
exe "e ".fname
so %
q
endif
if fname =~ '.vim$'
" call Decho("attempt to simply move ".fname." to plugin")
exe "silent !".g:GetLatestVimScripts_mv." ".fname." plugin"
endif
let docdir= substitute(&rtp,',.*','','e')."/doc"
" call Decho("helptags docdir<".docdir.">")
exe "helptags ".docdir
exe "cd ".curdir
endif
endif
" update the data in the <GetLatestVimScripts.dat> file
let modline=scriptid." ".latestsrcid." ".fname.cmmnt
call setline(line("."),modline)
" call Decho("modline<".modline."> (updated GetLatestVimScripts.dat file)")
endif
" restore options
let &t_ti= t_ti
let &t_te= t_te
let &rs = rs
" call Dret("GetOneScript")
endfun
" ---------------------------------------------------------------------
" GetLatestVimScripts: this function gets the latest versions of {{{1
" scripts based on the list in
" (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat
fun! getscript#GetLatestVimScripts()
" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">")
" insure that wget is executable
if executable(g:GetLatestVimScripts_wget) != 1
echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system"
" call Dret("GetLatestVimScripts : wget not executable/availble")
return
endif
" Find the .../GetLatest subdirectory under the runtimepath
for datadir in split(&rtp,',') + ['']
if isdirectory(datadir."/GetLatest")
" call Decho("found directory<".datadir.">")
let datadir= datadir . "/GetLatest"
break
endif
if filereadable(datadir."GetLatestVimScripts.dat")
" call Decho("found ".datadir."/GetLatestVimScripts.dat")
break
endif
endfor
" Sanity checks: readability and writability
if datadir == ""
echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install'
" 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.">")
return
endif
let datafile= datadir."/GetLatestVimScripts.dat"
if !filereadable(datafile)
echoerr "Your data file<".datafile."> isn't readable"
" call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">")
return
endif
if !filewritable(datafile)
echoerr "Your data file<".datafile."> isn't writable"
" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">")
return
endif
" call Decho("datadir <".datadir.">")
" call Decho("datafile <".datafile.">")
" don't let any events interfere (like winmanager's, taglist's, etc)
let eikeep= &ei
set ei=all
" record current directory, change to datadir, open split window with
" datafile
let origdir= getcwd()
exe "cd ".escape(substitute(datadir,'\','/','ge'),"|[]*'\" #")
split
exe "e ".escape(substitute(datafile,'\','/','ge'),"|[]*'\" #")
res 1000
let s:downloads = 0
let s:downerrors= 0
" Check on dependencies mentioned in plugins
" call Decho(" ")
" call Decho("searching plugins for GetLatestVimScripts dependencies")
let lastline = line("$")
let plugins = globpath(&rtp,"plugin/*.vim")
let foundscript = 0
" call Decho("plugins<".plugins."> lastline#".lastline)
while plugins != ""
let plugin = substitute(plugins,'\n.*$','','e')
let plugins= (plugins =~ '\n')? substitute(plugins,'^.\{-}\n\(.*\)$','\1','e') : ""
$
" call Decho(".dependency checking<".plugin."> line$=".line("$"))
exe "silent r ".plugin
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
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("..newscript<".newscript."> noai_script<".noai_script."> srch=".srchline." 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
endif
endwhile
let llp1= lastline + 1
" call Decho(".deleting lines: ".llp1.",$d")
exe "silent! ".llp1.",$d"
endwhile
if foundscript == 0
set nomod
endif
" Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat
set lz
" call Decho(" --- end of dependency checking loop --- ")
" call Decho("call GetOneScript on lines at end of datafile<".datafile.">")
1
/^-----/,$g/^\s*\d/call <SID>GetOneScript()
" Final report (an echomsg)
try
silent! ?^-------?
catch /^Vim\%((\a\+)\)\=:E114/
" call Dret("GetLatestVimScripts : nothing done!")
return
endtry
exe "norm! kz\<CR>"
redraw!
let s:msg = ""
if s:downloads == 1
let s:msg = "Downloaded one updated script to <".datadir.">"
elseif s:downloads == 2
let s:msg= "Downloaded two updated scripts to <".datadir.">"
elseif s:downloads > 1
let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">"
else
let s:msg= "Everything was already current"
endif
if s:downerrors > 0
let s:msg= s:msg." (".s:downerrors." downloading errors)"
endif
echomsg s:msg
" save the file
if &mod
silent! w!
endif
q
" restore events and current directory
exe "cd ".escape(substitute(origdir,'\','/','ge'),"|[]*'\" #")
let &ei= eikeep
set nolz
" call Dret("GetLatestVimScripts : did ".s:downloads." downloads")
endfun
" ---------------------------------------------------------------------
" Restore Options: {{{1
let &fo = s:keepfo
let &cpo= s:keepcpo
" vim: ts=8 sts=2 fdm=marker nowrap
This diff is collapsed.
"pythoncomplete.vim - Omni Completion for python "pythoncomplete.vim - Omni Completion for python
" Maintainer: Aaron Griffin <aaronmgriffin@gmail.com> " Maintainer: Aaron Griffin <aaronmgriffin@gmail.com>
" Version: 0.5 " Version: 0.7
" Last Updated: 19 April 2006 " Last Updated: 19 Oct 2006
"
" Yeah, I skipped a version number - 0.4 was never public.
" It was a bugfix version on top of 0.3. This is a complete
" rewrite.
" "
" Changes
" TODO: " TODO:
" User defined docstrings aren't handled right... " User defined docstrings aren't handled right...
" 'info' item output can use some formatting work " 'info' item output can use some formatting work
" Add an "unsafe eval" mode, to allow for return type evaluation " Add an "unsafe eval" mode, to allow for return type evaluation
" Complete basic syntax along with import statements
" i.e. "import url<c-x,c-o>"
" Continue parsing on invalid line??
"
" v 0.7
" * Fixed function list sorting (_ and __ at the bottom)
" * Removed newline removal from docs. It appears vim handles these better in
" recent patches
"
" v 0.6:
" * Fixed argument completion
" * Removed the 'kind' completions, as they are better indicated
" with real syntax
" * Added tuple assignment parsing (whoops, that was forgotten)
" * Fixed import handling when flattening scope
"
" v 0.5:
" Yeah, I skipped a version number - 0.4 was never public.
" It was a bugfix version on top of 0.3. This is a complete
" rewrite.
"
if !has('python') if !has('python')
echo "Error: Required vim compiled with +python" echo "Error: Required vim compiled with +python"
...@@ -28,7 +46,7 @@ function! pythoncomplete#Complete(findstart, base) ...@@ -28,7 +46,7 @@ function! pythoncomplete#Complete(findstart, base)
if c =~ '\w' if c =~ '\w'
continue continue
elseif ! c =~ '\.' elseif ! c =~ '\.'
idx = -1 let idx = -1
break break
else else
break break
...@@ -45,7 +63,7 @@ function! pythoncomplete#Complete(findstart, base) ...@@ -45,7 +63,7 @@ function! pythoncomplete#Complete(findstart, base)
while idx > 0 while idx > 0
let idx -= 1 let idx -= 1
let c = line[idx] let c = line[idx]
if c =~ '\w' || c =~ '\.' if c =~ '\w' || c =~ '\.' || c == '('
let cword = c . cword let cword = c . cword
continue continue
elseif strlen(cword) > 0 || idx == 0 elseif strlen(cword) > 0 || idx == 0
...@@ -73,7 +91,24 @@ def vimcomplete(context,match): ...@@ -73,7 +91,24 @@ def vimcomplete(context,match):
try: try:
import vim import vim
def complsort(x,y): def complsort(x,y):
return x['abbr'] > y['abbr'] try:
xa = x['abbr']
ya = y['abbr']
if xa[0] == '_':
if xa[1] == '_' and ya[0:2] == '__':
return xa > ya
elif ya[0:2] == '__':
return -1
elif y[0] == '_':
return xa > ya
else:
return 1
elif ya[0] == '_':
return -1
else:
return xa > ya
except:
return 0
cmpl = Completer() cmpl = Completer()
cmpl.evalsource('\n'.join(vim.current.buffer),vim.eval("line('.')")) cmpl.evalsource('\n'.join(vim.current.buffer),vim.eval("line('.')"))
all = cmpl.get_completions(context,match) all = cmpl.get_completions(context,match)
...@@ -86,7 +121,7 @@ def vimcomplete(context,match): ...@@ -86,7 +121,7 @@ def vimcomplete(context,match):
dictstr += '"icase":0},' dictstr += '"icase":0},'
if dictstr[-1] == ',': dictstr = dictstr[:-1] if dictstr[-1] == ',': dictstr = dictstr[:-1]
dictstr += ']' dictstr += ']'
dbg("dict: %s" % dictstr) #dbg("dict: %s" % dictstr)
vim.command("silent let g:pythoncomplete_completions = %s" % dictstr) vim.command("silent let g:pythoncomplete_completions = %s" % dictstr)
#dbg("Completion dict:\n%s" % all) #dbg("Completion dict:\n%s" % all)
except vim.error: except vim.error:
...@@ -108,11 +143,7 @@ class Completer(object): ...@@ -108,11 +143,7 @@ class Completer(object):
except: dbg("locals: %s, %s [%s]" % (sys.exc_info()[0],sys.exc_info()[1],l)) except: dbg("locals: %s, %s [%s]" % (sys.exc_info()[0],sys.exc_info()[1],l))
def _cleanstr(self,doc): def _cleanstr(self,doc):
return doc.replace('"',' ')\ return doc.replace('"',' ').replace("'",' ')
.replace("'",' ')\
.replace('\n',' ')\
.replace('\r',' ')\
.replace(' ',' ')
def get_arguments(self,func_obj): def get_arguments(self,func_obj):
def _ctor(obj): def _ctor(obj):
...@@ -128,23 +159,23 @@ class Completer(object): ...@@ -128,23 +159,23 @@ class Completer(object):
elif type(func_obj) == types.MethodType: func_obj = func_obj.im_func elif type(func_obj) == types.MethodType: func_obj = func_obj.im_func
else: arg_offset = 0 else: arg_offset = 0
arg_text = ')' arg_text=''
if type(func_obj) in [types.FunctionType, types.LambdaType]: if type(func_obj) in [types.FunctionType, types.LambdaType]:
try: try:
cd = func_obj.func_code cd = func_obj.func_code
real_args = cd.co_varnames[arg_offset:cd.co_argcount] real_args = cd.co_varnames[arg_offset:cd.co_argcount]
defaults = func_obj.func_defaults or [] defaults = func_obj.func_defaults or ''
defaults = [map(lambda name: "=%s" % name, defaults)] defaults = map(lambda name: "=%s" % name, defaults)
defaults = [""] * (len(real_args)-len(defaults)) + defaults defaults = [""] * (len(real_args)-len(defaults)) + defaults
items = map(lambda a,d: a+d, real_args, defaults) items = map(lambda a,d: a+d, real_args, defaults)
if func_obj.func_code.co_flags & 0x4: if func_obj.func_code.co_flags & 0x4:
items.append("...") items.append("...")
if func_obj.func_code.co_flags & 0x8: if func_obj.func_code.co_flags & 0x8:
items.append("***") items.append("***")
arg_text = ", ".join(items) + ')' arg_text = (','.join(items)) + ')'
except: except:
dbg("completion: %s: %s" % (sys.exc_info()[0],sys.exc_info()[1])) dbg("arg completion: %s: %s" % (sys.exc_info()[0],sys.exc_info()[1]))
pass pass
if len(arg_text) == 0: if len(arg_text) == 0:
# The doc string sometimes contains the function signature # The doc string sometimes contains the function signature
...@@ -160,6 +191,7 @@ class Completer(object): ...@@ -160,6 +191,7 @@ class Completer(object):
ridx = sigline.find(')') ridx = sigline.find(')')
if lidx > 0 and ridx > 0: if lidx > 0 and ridx > 0:
arg_text = sigline[lidx+1:ridx] + ')' arg_text = sigline[lidx+1:ridx] + ')'
if len(arg_text) == 0: arg_text = ')'
return arg_text return arg_text
def get_completions(self,context,match): def get_completions(self,context,match):
...@@ -172,12 +204,11 @@ class Completer(object): ...@@ -172,12 +204,11 @@ class Completer(object):
all = {} all = {}
ridx = stmt.rfind('.') ridx = stmt.rfind('.')
if len(stmt) > 0 and stmt[-1] == '(': if len(stmt) > 0 and stmt[-1] == '(':
#TODO
result = eval(_sanitize(stmt[:-1]), self.compldict) result = eval(_sanitize(stmt[:-1]), self.compldict)
doc = result.__doc__ doc = result.__doc__
if doc == None: doc = '' if doc == None: doc = ''
args = self.get_arguments(res) args = self.get_arguments(result)
return [{'word':self._cleanstr(args),'info':self._cleanstr(doc),'kind':'p'}] return [{'word':self._cleanstr(args),'info':self._cleanstr(doc)}]
elif ridx == -1: elif ridx == -1:
match = stmt match = stmt
all = self.compldict all = self.compldict
...@@ -206,22 +237,18 @@ class Completer(object): ...@@ -206,22 +237,18 @@ class Completer(object):
if doc == None or doc == '': doc = maindoc if doc == None or doc == '': doc = maindoc
wrd = m[len(match):] wrd = m[len(match):]
c = {'word':wrd, 'abbr':m, 'info':self._cleanstr(doc),'kind':'m'} c = {'word':wrd, 'abbr':m, 'info':self._cleanstr(doc)}
if "function" in typestr: if "function" in typestr:
c['word'] += '(' c['word'] += '('
c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst)) c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst))
c['kind'] = 'f'
elif "method" in typestr: elif "method" in typestr:
c['word'] += '(' c['word'] += '('
c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst)) c['abbr'] += '(' + self._cleanstr(self.get_arguments(inst))
c['kind'] = 'f'
elif "module" in typestr: elif "module" in typestr:
c['word'] += '.' c['word'] += '.'
c['kind'] = 'm'
elif "class" in typestr: elif "class" in typestr:
c['word'] += '(' c['word'] += '('
c['abbr'] += '(' c['abbr'] += '('
c['kind']='c'
completions.append(c) completions.append(c)
except: except:
i = sys.exc_info() i = sys.exc_info()
...@@ -277,10 +304,13 @@ class Scope(object): ...@@ -277,10 +304,13 @@ class Scope(object):
# we need to start with this, to fix up broken completions # we need to start with this, to fix up broken completions
# hopefully this name is unique enough... # hopefully this name is unique enough...
str = '"""'+self.docstr+'"""\n' str = '"""'+self.docstr+'"""\n'
for l in self.locals:
if l.startswith('import'): str += l+'\n'
str += 'class _PyCmplNoType:\n def __getattr__(self,name):\n return None\n' str += 'class _PyCmplNoType:\n def __getattr__(self,name):\n return None\n'
for sub in self.subscopes: for sub in self.subscopes:
str += sub.get_code() str += sub.get_code()
#str += '\n'.join(self.locals)+'\n' for l in self.locals:
if not l.startswith('import'): str += l+'\n'
return str return str
...@@ -420,6 +450,8 @@ class PyParser: ...@@ -420,6 +450,8 @@ class PyParser:
tokentype, token, indent = self.next() tokentype, token, indent = self.next()
if tokentype == tokenize.STRING or token == 'str': if tokentype == tokenize.STRING or token == 'str':
return '""' return '""'
elif token == '(' or token == 'tuple':
return '()'
elif token == '[' or token == 'list': elif token == '[' or token == 'list':
return '[]' return '[]'
elif token == '{' or token == 'dict': elif token == '{' or token == 'dict':
...@@ -494,9 +526,9 @@ class PyParser: ...@@ -494,9 +526,9 @@ class PyParser:
freshscope=True freshscope=True
while True: while True:
tokentype, token, indent = self.next() tokentype, token, indent = self.next()
#print 'main: token=[%s] indent=[%s]' % (token,indent) #dbg( 'main: token=[%s] indent=[%s]' % (token,indent))
if tokentype == DEDENT: if tokentype == DEDENT or token == "pass":
self.scope = self.scope.pop(indent) self.scope = self.scope.pop(indent)
elif token == 'def': elif token == 'def':
func = self._parsefunction(indent) func = self._parsefunction(indent)
......
This diff is collapsed.
" Vim completion script " Vim completion script
" Language: All languages, uses existing syntax highlighting rules " Language: All languages, uses existing syntax highlighting rules
" Maintainer: David Fishburn <fishburn@ianywhere.com> " Maintainer: David Fishburn <fishburn@ianywhere.com>
" Version: 2.0 " Version: 3.0
" Last Change: Fri May 05 2006 10:34:57 PM " Last Change: Wed Nov 08 2006 10:46:46 AM
" Usage: For detailed help, ":help ft-syntax-omni" " Usage: For detailed help, ":help ft-syntax-omni"
" Set completion with CTRL-X CTRL-O to autoloaded function. " Set completion with CTRL-X CTRL-O to autoloaded function.
...@@ -19,13 +19,31 @@ endif ...@@ -19,13 +19,31 @@ endif
if exists('g:loaded_syntax_completion') if exists('g:loaded_syntax_completion')
finish finish
endif endif
let g:loaded_syntax_completion = 20 let g:loaded_syntax_completion = 30
" Set ignorecase to the ftplugin standard " Set ignorecase to the ftplugin standard
" This is the default setting, but if you define a buffer local
" variable you can override this on a per filetype.
if !exists('g:omni_syntax_ignorecase') if !exists('g:omni_syntax_ignorecase')
let g:omni_syntax_ignorecase = &ignorecase let g:omni_syntax_ignorecase = &ignorecase
endif endif
" Indicates whether we should use the iskeyword option to determine
" how to split words.
" This is the default setting, but if you define a buffer local
" variable you can override this on a per filetype.
if !exists('g:omni_syntax_use_iskeyword')
let g:omni_syntax_use_iskeyword = 1
endif
" Only display items in the completion window that are at least
" this many characters in length.
" This is the default setting, but if you define a buffer local
" variable you can override this on a per filetype.
if !exists('g:omni_syntax_minimum_length')
let g:omni_syntax_minimum_length = 0
endif
" This script will build a completion list based on the syntax " This script will build a completion list based on the syntax
" elements defined by the files in $VIMRUNTIME/syntax. " elements defined by the files in $VIMRUNTIME/syntax.
let s:syn_remove_words = 'match,matchgroup=,contains,'. let s:syn_remove_words = 'match,matchgroup=,contains,'.
...@@ -38,21 +56,28 @@ let s:prepended = '' ...@@ -38,21 +56,28 @@ let s:prepended = ''
" This function is used for the 'omnifunc' option. " This function is used for the 'omnifunc' option.
function! syntaxcomplete#Complete(findstart, base) function! syntaxcomplete#Complete(findstart, base)
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_ignorecase')
if exists('g:omni_syntax_ignorecase')
let b:omni_syntax_ignorecase = g:omni_syntax_ignorecase
else
let b:omni_syntax_ignorecase = &ignorecase
endif
endif
if a:findstart if a:findstart
" Locate the start of the item, including "." " Locate the start of the item, including "."
let line = getline('.') let line = getline('.')
let start = col('.') - 1 let start = col('.') - 1
let lastword = -1 let lastword = -1
while start > 0 while start > 0
if line[start - 1] =~ '\w' " if line[start - 1] =~ '\S'
" let start -= 1
" elseif line[start - 1] =~ '\.'
if line[start - 1] =~ '\k'
let start -= 1 let start -= 1
elseif line[start - 1] =~ '\.' let lastword = a:findstart
" The user must be specifying a column name
if lastword == -1
let lastword = start
endif
let start -= 1
let b:sql_compl_type = 'column'
else else
break break
endif endif
...@@ -64,11 +89,12 @@ function! syntaxcomplete#Complete(findstart, base) ...@@ -64,11 +89,12 @@ function! syntaxcomplete#Complete(findstart, base)
let s:prepended = '' let s:prepended = ''
return start return start
endif endif
let s:prepended = strpart(line, start, lastword - start) let s:prepended = strpart(line, start, (col('.') - 1) - start)
return lastword return start
endif endif
let base = s:prepended . a:base " let base = s:prepended . a:base
let base = s:prepended
let filetype = substitute(&filetype, '\.', '_', 'g') let filetype = substitute(&filetype, '\.', '_', 'g')
let list_idx = index(s:cache_name, filetype, 0, &ignorecase) let list_idx = index(s:cache_name, filetype, 0, &ignorecase)
...@@ -82,11 +108,16 @@ function! syntaxcomplete#Complete(findstart, base) ...@@ -82,11 +108,16 @@ function! syntaxcomplete#Complete(findstart, base)
" Return list of matches. " Return list of matches.
if base =~ '\w' if base != ''
let compstr = join(compl_list, ' ') " let compstr = join(compl_list, ' ')
let expr = (g:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*' " let expr = (b:omni_syntax_ignorecase==0?'\C':'').'\<\%('.base.'\)\@!\w\+\s*'
let compstr = substitute(compstr, expr, '', 'g') " let compstr = substitute(compstr, expr, '', 'g')
let compl_list = split(compstr, '\s\+') " let compl_list = split(compstr, '\s\+')
" Filter the list based on the first few characters the user
" entered
let expr = 'v:val '.(g:omni_syntax_ignorecase==1?'=~?':'=~#')." '^".escape(base, '\\/.*$^~[]').".*'"
let compl_list = filter(deepcopy(compl_list), expr)
endif endif
return compl_list return compl_list
...@@ -100,6 +131,26 @@ function! OmniSyntaxList() ...@@ -100,6 +131,26 @@ function! OmniSyntaxList()
" let use_dictionary = a:1 " let use_dictionary = a:1
" endif " endif
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_use_iskeyword')
if exists('g:omni_syntax_use_iskeyword')
let b:omni_syntax_use_iskeyword = g:omni_syntax_use_iskeyword
else
let b:omni_syntax_use_iskeyword = 1
endif
endif
" Only display items in the completion window that are at least
" this many characters in length
if !exists('b:omni_syntax_minimum_length')
if exists('g:omni_syntax_minimum_length')
let b:omni_syntax_minimum_length = g:omni_syntax_minimum_length
else
let b:omni_syntax_minimum_length = 0
endif
endif
let saveL = @l let saveL = @l
" Loop through all the syntax groupnames, and build a " Loop through all the syntax groupnames, and build a
...@@ -294,14 +345,32 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full ) ...@@ -294,14 +345,32 @@ function! s:SyntaxCSyntaxGroupItems( group_name, syntax_full )
\ , "", 'g' \ , "", 'g'
\ ) \ )
" There are a number of items which have non-word characters in if b:omni_syntax_use_iskeyword == 0
" them, *'T_F1'*. vim.vim is one such file. " There are a number of items which have non-word characters in
" This will replace non-word characters with spaces. " them, *'T_F1'*. vim.vim is one such file.
let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' ) " This will replace non-word characters with spaces.
let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' )
else
let accept_chars = ','.&iskeyword.','
" Remove all character ranges
let accept_chars = substitute(accept_chars, ',[^,]\+-[^,]\+,', ',', 'g')
" Remove all numeric specifications
let accept_chars = substitute(accept_chars, ',\d\{-},', ',', 'g')
" Remove all commas
let accept_chars = substitute(accept_chars, ',', '', 'g')
" Escape special regex characters
let accept_chars = escape(accept_chars, '\\/.*$^~[]' )
" Remove all characters that are not acceptable
let syn_list = substitute( syn_list, '[^0-9A-Za-z_ '.accept_chars.']', ' ', 'g' )
endif
if b:omni_syntax_minimum_length > 0
" If the user specified a minimum length, enforce it
let syn_list = substitute(' '.syn_list.' ', ' \S\{,'.b:omni_syntax_minimum_length.'}\ze ', ' ', 'g')
endif
else else
let syn_list = '' let syn_list = ''
endif endif
return syn_list return syn_list
endfunction endfunction
" Vim completion script " Vim completion script
" Language: XML " Language: XML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2006 Apr 30 " Last Change: 2006 Jul 18
" Version: 1.8
"
" Changelog:
" 1.8 - 2006 Jul 18
" - allow for closing of xml tags even when data file isn't available
" This function will create Dictionary with users namespace strings and values " This function will create Dictionary with users namespace strings and values
" canonical (system) names of data files. Names should be lowercase, " canonical (system) names of data files. Names should be lowercase,
...@@ -80,7 +85,7 @@ function! xmlcomplete#CompleteTags(findstart, base) ...@@ -80,7 +85,7 @@ function! xmlcomplete#CompleteTags(findstart, base)
let context_line = getline(curline-i) let context_line = getline(curline-i)
if context_line =~ '<[^>]*$' if context_line =~ '<[^>]*$'
" Yep, this is this line " Yep, this is this line
let context_lines = getline(curline-i, curline) let context_lines = getline(curline-i, curline-1) + [b:compl_context]
let b:compl_context = join(context_lines, ' ') let b:compl_context = join(context_lines, ' ')
break break
elseif context_line =~ '>[^<]*$' || i == curline elseif context_line =~ '>[^<]*$' || i == curline
...@@ -106,10 +111,6 @@ function! xmlcomplete#CompleteTags(findstart, base) ...@@ -106,10 +111,6 @@ function! xmlcomplete#CompleteTags(findstart, base)
return start return start
else else
" There is no connection of namespace and data file. Abandon action
if !exists("g:xmldata_connection") || g:xmldata_connection == {}
return []
endif
" Initialize base return lists " Initialize base return lists
let res = [] let res = []
let res2 = [] let res2 = []
...@@ -119,6 +120,17 @@ function! xmlcomplete#CompleteTags(findstart, base) ...@@ -119,6 +120,17 @@ function! xmlcomplete#CompleteTags(findstart, base)
endif endif
let context = matchstr(b:compl_context, '^<\zs.*') let context = matchstr(b:compl_context, '^<\zs.*')
unlet! b:compl_context unlet! b:compl_context
" There is no connection of namespace and data file.
if !exists("g:xmldata_connection") || g:xmldata_connection == {}
" There is still possibility we may do something - eg. close tag
let b:unaryTagsStack = "base meta link hr br param img area input col"
if context =~ '^\/'
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
return [opentag.">"]
else
return []
endif
endif
" Make entities completion " Make entities completion
if exists("b:entitiescompl") if exists("b:entitiescompl")
......
" zip.vim: Handles browsing zipfiles " zip.vim: Handles browsing zipfiles
" AUTOLOAD PORTION " AUTOLOAD PORTION
" Date: May 01, 2006 " Date: Sep 29, 2006
" Version: 9 " Version: 12
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz> " Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" License: Vim License (see vim's :help license) " License: Vim License (see vim's :help license)
" Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1 " Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code, " Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright " with or without modifications, provided that this copyright
...@@ -15,15 +15,28 @@ ...@@ -15,15 +15,28 @@
" of this software. " of this software.
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Initialization: {{{1 " Load Once: {{{1
let s:keepcpo= &cpo let s:keepcpo= &cpo
set cpo&vim set cpo&vim
if exists("g:loaded_zip") if &cp || exists("g:loaded_zip") || v:version < 700
finish finish
endif endif
let g:loaded_zip = "v9" let g:loaded_zip = "v12"
let s:zipfile_escape = ' ?&;\' let s:zipfile_escape = ' ?&;\'
let s:ERROR = 2
let s:WARNING = 1
let s:NOTE = 0
" ---------------------------------------------------------------------
" Global Values: {{{1
if !exists("g:zip_shq")
if has("unix")
let g:zip_shq= "'"
else
let g:zip_shq= '"'
endif
endif
" ---------------- " ----------------
" Functions: {{{1 " Functions: {{{1
...@@ -38,8 +51,9 @@ fun! zip#Browse(zipfile) ...@@ -38,8 +51,9 @@ fun! zip#Browse(zipfile)
" sanity checks " sanity checks
if !executable("unzip") if !executable("unzip")
redraw!
echohl Error | echo "***error*** (zip#Browse) unzip not available on your system" echohl Error | echo "***error*** (zip#Browse) unzip not available on your system"
call inputsave()|call input("Press <cr> to continue")|call inputrestore() " call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep let &report= repkeep
" call Dret("zip#Browse") " call Dret("zip#Browse")
return return
...@@ -47,8 +61,9 @@ fun! zip#Browse(zipfile) ...@@ -47,8 +61,9 @@ fun! zip#Browse(zipfile)
if !filereadable(a:zipfile) if !filereadable(a:zipfile)
if a:zipfile !~# '^\a\+://' if a:zipfile !~# '^\a\+://'
" if its an url, don't complain, let url-handlers such as vim do its thing " if its an url, don't complain, let url-handlers such as vim do its thing
redraw!
echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore() " call inputsave()|call input("Press <cr> to continue")|call inputrestore()
endif endif
let &report= repkeep let &report= repkeep
" call Dret("zip#Browse : file<".a:zipfile."> not readable") " call Dret("zip#Browse : file<".a:zipfile."> not readable")
...@@ -75,11 +90,12 @@ fun! zip#Browse(zipfile) ...@@ -75,11 +90,12 @@ fun! zip#Browse(zipfile)
0d 0d
$ $
" call Decho("exe silent r! unzip -l '".a:zipfile."'") " call Decho("exe silent r! unzip -l ".s:QuoteFileDir(a:zipfile))
exe "silent r! unzip -l '".a:zipfile."'" exe "silent r! unzip -l ".s:QuoteFileDir(a:zipfile)
if v:shell_error != 0 if v:shell_error != 0
redraw!
echohl WarningMsg | echo "***warning*** (zip#Browse) ".a:zipfile." is not a zip file" | echohl None echohl WarningMsg | echo "***warning*** (zip#Browse) ".a:zipfile." is not a zip file" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore() " call inputsave()|call input("Press <cr> to continue")|call inputrestore()
silent %d silent %d
let eikeep= &ei let eikeep= &ei
set ei=BufReadCmd,FileReadCmd set ei=BufReadCmd,FileReadCmd
...@@ -121,8 +137,9 @@ fun! s:ZipBrowseSelect() ...@@ -121,8 +137,9 @@ fun! s:ZipBrowseSelect()
return return
endif endif
if fname =~ '/$' if fname =~ '/$'
redraw!
echohl Error | echo "***error*** (zip#Browse) Please specify a file, not a directory" | echohl None echohl Error | echo "***error*** (zip#Browse) Please specify a file, not a directory" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore() " call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep let &report= repkeep
" call Dret("ZipBrowseSelect") " call Dret("ZipBrowseSelect")
return return
...@@ -131,7 +148,7 @@ fun! s:ZipBrowseSelect() ...@@ -131,7 +148,7 @@ fun! s:ZipBrowseSelect()
" call Decho("fname<".fname.">") " call Decho("fname<".fname.">")
" get zipfile to the new-window " get zipfile to the new-window
let zipfile= substitute(w:zipfile,'.zip$','','e') let zipfile = w:zipfile
let curfile= expand("%") let curfile= expand("%")
" call Decho("zipfile<".zipfile.">") " call Decho("zipfile<".zipfile.">")
" call Decho("curfile<".curfile.">") " call Decho("curfile<".curfile.">")
...@@ -160,12 +177,15 @@ fun! zip#Read(fname,mode) ...@@ -160,12 +177,15 @@ fun! zip#Read(fname,mode)
else else
let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','') let zipfile = substitute(a:fname,'^.\{-}zipfile:\(.\{-}\)::[^\\].*$','\1','')
let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','') let fname = substitute(a:fname,'^.\{-}zipfile:.\{-}::\([^\\].*\)$','\1','')
" TODO Needs to predicated to using InfoZIP's unzip on Windows
let fname = substitute(fname, '[', '[[]', 'g')
endif endif
" call Decho("zipfile<".zipfile.">") " call Decho("zipfile<".zipfile.">")
" call Decho("fname <".fname.">") " call Decho("fname <".fname.">")
" call Decho("exe r! unzip -p '".zipfile."' '".fname."'") " call Decho("exe r! unzip -p ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname))
exe "silent r! unzip -p '".zipfile."' '".fname."'" exe "silent r! unzip -p ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname)
" cleanup " cleanup
0d 0d
...@@ -184,15 +204,17 @@ fun! zip#Write(fname) ...@@ -184,15 +204,17 @@ fun! zip#Write(fname)
" sanity checks " sanity checks
if !executable("zip") if !executable("zip")
redraw!
echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the zip pgm" | echohl None echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the zip pgm" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore() " call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep let &report= repkeep
" call Dret("zip#Write") " call Dret("zip#Write")
return return
endif endif
if !exists("*mkdir") if !exists("*mkdir")
redraw!
echohl Error | echo "***error*** (zip#Write) sorry, mkdir() doesn't work on your system" | echohl None echohl Error | echo "***error*** (zip#Write) sorry, mkdir() doesn't work on your system" | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore() " call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep let &report= repkeep
" call Dret("zip#Write") " call Dret("zip#Write")
return return
...@@ -208,15 +230,11 @@ fun! zip#Write(fname) ...@@ -208,15 +230,11 @@ fun! zip#Write(fname)
call mkdir(tmpdir,"p") call mkdir(tmpdir,"p")
" attempt to change to the indicated directory " attempt to change to the indicated directory
try if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot cd to temporary directory")
exe "cd ".escape(tmpdir,' \')
catch /^Vim\%((\a\+)\)\=:E344/
echohl Error | echo "***error*** (zip#Write) cannot cd to temporary directory" | Echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
let &report= repkeep let &report= repkeep
" call Dret("zip#Write") " call Dret("zip#Write")
return return
endtry endif
" call Decho("current directory now: ".getcwd()) " call Decho("current directory now: ".getcwd())
" place temporary files under .../_ZIPVIM_/ " place temporary files under .../_ZIPVIM_/
...@@ -255,21 +273,27 @@ fun! zip#Write(fname) ...@@ -255,21 +273,27 @@ fun! zip#Write(fname)
let zipfile = substitute(system("cygpath ".zipfile),'\n','','e') let zipfile = substitute(system("cygpath ".zipfile),'\n','','e')
endif endif
" call Decho("zip -u '".zipfile.".zip' '".fname."'") " TODO Needs to predicated to using InfoZIP's unzip
call system("zip -u '".zipfile.".zip' '".fname."'") if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
let fname = substitute(fname, '[', '[[]', 'g')
endif
" call Decho("zip -u ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname))
call system("zip -u ".s:QuoteFileDir(zipfile)." ".s:QuoteFileDir(fname))
if v:shell_error != 0 if v:shell_error != 0
redraw!
echohl Error | echo "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname | echohl None echohl Error | echo "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname | echohl None
call inputsave()|call input("Press <cr> to continue")|call inputrestore() " call inputsave()|call input("Press <cr> to continue")|call inputrestore()
elseif s:zipfile_{winnr()} =~ '^\a\+://' elseif s:zipfile_{winnr()} =~ '^\a\+://'
" support writing zipfiles across a network " support writing zipfiles across a network
let netzipfile= s:zipfile_{winnr()} let netzipfile= s:zipfile_{winnr()}
" call Decho("handle writing <".zipfile.".zip> across network as <".netzipfile.">") " call Decho("handle writing <".zipfile."> across network as <".netzipfile.">")
1split|enew 1split|enew
let binkeep= &binary let binkeep= &binary
let eikeep = &ei let eikeep = &ei
set binary ei=all set binary ei=all
exe "e! ".zipfile.".zip" exe "e! ".zipfile
call netrw#NetWrite(netzipfile) call netrw#NetWrite(netzipfile)
let &ei = eikeep let &ei = eikeep
let &binary = binkeep let &binary = binkeep
...@@ -280,25 +304,61 @@ fun! zip#Write(fname) ...@@ -280,25 +304,61 @@ fun! zip#Write(fname)
" cleanup and restore current directory " cleanup and restore current directory
cd .. cd ..
call s:Rmdir("_ZIPVIM_") call s:Rmdir("_ZIPVIM_")
exe "cd ".escape(curdir,' \') call s:ChgDir(curdir,s:WARNING,"(zip#Write) unable to return to ".curdir."!")
call s:Rmdir(tmpdir)
setlocal nomod setlocal nomod
let &report= repkeep let &report= repkeep
" call Dret("zip#Write") " call Dret("zip#Write")
endfun endfun
" ---------------------------------------------------------------------
" QuoteFileDir: {{{2
fun! s:QuoteFileDir(fname)
" call Dfunc("QuoteFileDir(fname<".a:fname.">)")
" call Dret("QuoteFileDir")
return g:zip_shq.a:fname.g:zip_shq
endfun
" ---------------------------------------------------------------------
" ChgDir: {{{2
fun! s:ChgDir(newdir,errlvl,errmsg)
" call Dfunc("ChgDir(newdir<".a:newdir."> errlvl=".a:errlvl." errmsg<".a:errmsg.">)")
if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
let newdir= escape(a:newdir,' ')
else
let newdir= escape(a:newdir,'\ ')
endif
try
exe "cd ".newdir
catch /^Vim\%((\a\+)\)\=:E344/
redraw!
if a:errlvl == s:NOTE
echo "***note*** ".a:errmsg
elseif a:errlvl == s:WARNING
echohl WarningMsg | echo "***warning*** ".a:errmsg | echohl NONE
elseif a:errlvl == s:ERROR
echohl Error | echo "***error*** ".a:errmsg | echohl NONE
endif
" call inputsave()|call input("Press <cr> to continue")|call inputrestore()
" call Dret("ChgDir 1")
return 1
endtry
" call Dret("ChgDir 0")
return 0
endfun
" --------------------------------------------------------------------- " ---------------------------------------------------------------------
" Rmdir: {{{2 " Rmdir: {{{2
fun! s:Rmdir(fname) fun! s:Rmdir(fname)
" call Dfunc("Rmdir(fname<".a:fname.">)") " call Dfunc("Rmdir(fname<".a:fname.">)")
if has("unix") if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$'
call system("/bin/rm -rf ".a:fname) call system("rmdir /S/Q ".s:QuoteFileDir(a:fname))
elseif has("win32") || has("win95") || has("win64") || has("win16") else
if &shell =~? "sh$" call system("/bin/rm -rf ".s:QuoteFileDir(a:fname))
call system("/bin/rm -rf ".a:fname)
else
call system("del /S ".a:fname)
endif
endif endif
" call Dret("Rmdir") " call Dret("Rmdir")
endfun endfun
...@@ -307,4 +367,4 @@ endfun ...@@ -307,4 +367,4 @@ endfun
" Modelines And Restoration: {{{1 " Modelines And Restoration: {{{1
let &cpo= s:keepcpo let &cpo= s:keepcpo
unlet s:keepcpo unlet s:keepcpo
" vim:ts=8 fdm=marker " vim:ts=8 fdm=marker
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
" vim: tw=0 ts=4 sw=4 " vim: tw=0 ts=4 sw=4
" Vim color file " Vim color file
" Maintainer: Steven Vertigan <steven@vertigan.wattle.id.au> " Maintainer: Steven Vertigan <steven@vertigan.wattle.id.au>
" Last Change: 2003 May 11 " Last Change: 2006 Sep 23
" Revision #4: Support for new "Underline" group. Removed superfluous html " Revision #5: Switch main text from white to yellow for easier contrast,
" formatting. " fixed some problems with terminal backgrounds.
set background=dark set background=dark
hi clear hi clear
...@@ -12,66 +12,44 @@ if exists("syntax_on") ...@@ -12,66 +12,44 @@ if exists("syntax_on")
syntax reset syntax reset
endif endif
let g:colors_name = "blue" let g:colors_name = "blue"
hi Normal guifg=white guibg=darkBlue hi Normal guifg=yellow guibg=darkBlue ctermfg=yellow ctermbg=darkBlue
hi Normal ctermfg=white ctermbg=darkBlue
hi NonText guifg=magenta ctermfg=lightMagenta hi NonText guifg=magenta ctermfg=lightMagenta
hi comment guifg=gray gui=bold hi comment guifg=gray ctermfg=gray ctermbg=darkBlue gui=bold
hi comment ctermfg=gray
hi constant guifg=cyan ctermfg=cyan hi constant guifg=cyan ctermfg=cyan
hi identifier guifg=gray ctermfg=gray hi identifier guifg=gray ctermfg=red
hi statement guifg=yellow gui=none ctermfg=yellow hi statement guifg=white ctermfg=white ctermbg=darkBlue gui=none
hi preproc guifg=green ctermfg=green hi preproc guifg=green ctermfg=green
hi type guifg=orange ctermfg=darkYellow hi type guifg=orange ctermfg=lightRed ctermbg=darkBlue
hi special guifg=magenta ctermfg=lightMagenta hi special guifg=magenta ctermfg=lightMagenta ctermbg=darkBlue
hi Underlined guifg=cyan ctermfg=cyan hi Underlined guifg=cyan ctermfg=cyan gui=underline cterm=underline
hi Underlined gui=underline cterm=underline hi label guifg=yellow ctermfg=yellow
hi operator guifg=orange gui=bold ctermfg=lightRed ctermbg=darkBlue
hi ErrorMsg guifg=orange guibg=darkBlue
hi ErrorMsg ctermfg=lightRed hi ErrorMsg guifg=orange guibg=darkBlue ctermfg=lightRed
hi WarningMsg guifg=cyan guibg=darkBlue gui=bold hi WarningMsg guifg=cyan guibg=darkBlue ctermfg=cyan gui=bold
hi WarningMsg ctermfg=cyan hi ModeMsg guifg=yellow gui=NONE ctermfg=yellow
hi ModeMsg guifg=yellow gui=NONE hi MoreMsg guifg=yellow gui=NONE ctermfg=yellow
hi ModeMsg ctermfg=yellow hi Error guifg=red guibg=darkBlue gui=underline ctermfg=red
hi MoreMsg guifg=yellow gui=NONE
hi MoreMsg ctermfg=yellow hi Todo guifg=black guibg=orange ctermfg=black ctermbg=darkYellow
hi Error guifg=red guibg=darkBlue gui=underline hi Cursor guifg=black guibg=white ctermfg=black ctermbg=white
hi Error ctermfg=red hi Search guifg=black guibg=orange ctermfg=black ctermbg=darkYellow
hi IncSearch guifg=black guibg=yellow ctermfg=black ctermbg=darkYellow
hi Todo guifg=black guibg=orange hi LineNr guifg=cyan ctermfg=cyan
hi Todo ctermfg=black ctermbg=darkYellow
hi Cursor guifg=black guibg=white
hi Cursor ctermfg=black ctermbg=white
hi Search guifg=black guibg=orange
hi Search ctermfg=black ctermbg=darkYellow
hi IncSearch guifg=black guibg=yellow
hi IncSearch ctermfg=black ctermbg=darkYellow
hi LineNr guifg=pink ctermfg=lightMagenta
hi title guifg=white gui=bold cterm=bold hi title guifg=white gui=bold cterm=bold
hi StatusLineNC gui=NONE guifg=black guibg=blue hi StatusLineNC gui=NONE guifg=black guibg=blue ctermfg=black ctermbg=blue
hi StatusLineNC ctermfg=black ctermbg=blue hi StatusLine gui=bold guifg=cyan guibg=blue ctermfg=cyan ctermbg=blue
hi StatusLine gui=bold guifg=cyan guibg=blue hi VertSplit gui=none guifg=blue guibg=blue ctermfg=blue ctermbg=blue
hi StatusLine ctermfg=cyan ctermbg=blue
hi label guifg=yellow ctermfg=yellow hi Visual term=reverse ctermfg=black ctermbg=darkCyan guifg=black guibg=darkCyan
hi operator guifg=orange gui=bold ctermfg=darkYellow
hi clear Visual
hi Visual term=reverse
hi Visual ctermfg=black ctermbg=darkCyan
hi Visual guifg=black guibg=darkCyan
hi DiffChange guibg=darkGreen guifg=black hi DiffChange guibg=darkGreen guifg=black ctermbg=darkGreen ctermfg=black
hi DiffChange ctermbg=darkGreen ctermfg=black hi DiffText guibg=olivedrab guifg=black ctermbg=lightGreen ctermfg=black
hi DiffText guibg=olivedrab guifg=black hi DiffAdd guibg=slateblue guifg=black ctermbg=blue ctermfg=black
hi DiffText ctermbg=lightGreen ctermfg=black hi DiffDelete guibg=coral guifg=black ctermbg=cyan ctermfg=black
hi DiffAdd guibg=slateblue guifg=black
hi DiffAdd ctermbg=blue ctermfg=black
hi DiffDelete guibg=coral guifg=black
hi DiffDelete ctermbg=cyan ctermfg=black
hi Folded guibg=orange guifg=black hi Folded guibg=orange guifg=black ctermbg=yellow ctermfg=black
hi Folded ctermbg=yellow ctermfg=black hi FoldColumn guibg=gray30 guifg=black ctermbg=gray ctermfg=black
hi FoldColumn guibg=gray30 guifg=black
hi FoldColumn ctermbg=gray ctermfg=black
hi cIf0 guifg=gray ctermfg=gray hi cIf0 guifg=gray ctermfg=gray
" Vim color file " Vim color file
" Maintainer: Thorsten Maerz <info@netztorte.de> " Maintainer: Thorsten Maerz <info@netztorte.de>
" Last Change: 2001 Jul 23 " Last Change: 2006 Dec 07
" grey on black " grey on black
" optimized for TFT panels " optimized for TFT panels
...@@ -18,7 +18,7 @@ let g:colors_name = "torte" ...@@ -18,7 +18,7 @@ let g:colors_name = "torte"
" GUI " GUI
highlight Normal guifg=Grey80 guibg=Black highlight Normal guifg=Grey80 guibg=Black
highlight Search guifg=Black guibg=Red gui=bold highlight Search guifg=Black guibg=Red gui=bold
highlight Visual guifg=Grey25 gui=bold highlight Visual guifg=#404040 gui=bold
highlight Cursor guifg=Black guibg=Green gui=bold highlight Cursor guifg=Black guibg=Green gui=bold
highlight Special guifg=Orange highlight Special guifg=Orange
highlight Comment guifg=#80a0ff highlight Comment guifg=#80a0ff
...@@ -42,7 +42,7 @@ if has("unix") ...@@ -42,7 +42,7 @@ if has("unix")
if v:version<600 if v:version<600
highlight Normal ctermfg=Grey ctermbg=Black cterm=NONE guifg=Grey80 guibg=Black gui=NONE highlight Normal ctermfg=Grey ctermbg=Black cterm=NONE guifg=Grey80 guibg=Black gui=NONE
highlight Search ctermfg=Black ctermbg=Red cterm=bold guifg=Black guibg=Red gui=bold highlight Search ctermfg=Black ctermbg=Red cterm=bold guifg=Black guibg=Red gui=bold
highlight Visual ctermfg=Black ctermbg=yellow cterm=bold guifg=Grey25 gui=bold highlight Visual ctermfg=Black ctermbg=yellow cterm=bold guifg=#404040 gui=bold
highlight Special ctermfg=LightBlue cterm=NONE guifg=LightBlue gui=NONE highlight Special ctermfg=LightBlue cterm=NONE guifg=LightBlue gui=NONE
highlight Comment ctermfg=Cyan cterm=NONE guifg=LightBlue gui=NONE highlight Comment ctermfg=Cyan cterm=NONE guifg=LightBlue gui=NONE
endif endif
......
*change.txt* For Vim version 7.0. Last change: 2006 May 05 *change.txt* For Vim version 7.1a. Last change: 2007 Jan 07
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
...@@ -640,7 +640,7 @@ The flags that you can use for the substitute commands: ...@@ -640,7 +640,7 @@ The flags that you can use for the substitute commands:
[#] Like [p] and prepend the line number. [#] Like [p] and prepend the line number.
[l] Like [l] but print the text like |:list|. [l] Like [p] but print the text like |:list|.
[r] Only useful in combination with ":&" or ":s" without arguments. ":&r" [r] Only useful in combination with ":&" or ":s" without arguments. ":&r"
works the same way as ":~": When the search pattern is empty, use the works the same way as ":~": When the search pattern is empty, use the
...@@ -670,14 +670,20 @@ pattern from the last substitute or ":global" command. With the [r] flag, the ...@@ -670,14 +670,20 @@ pattern from the last substitute or ":global" command. With the [r] flag, the
command uses the pattern from the last substitute, ":global", or search command uses the pattern from the last substitute, ":global", or search
command. command.
If the {string} is omitted the substitute is done as if it's empty. Thus the
matched pattern is deleted. The separator after {pattern} can also be left
out then. Example: >
:%s/TESTING
This deletes "TESTING" from all lines, but only one per line.
For compatibility with Vi these two exceptions are allowed: For compatibility with Vi these two exceptions are allowed:
"\/{string}/" and "\?{string}?" do the same as "//{string}/r". "\/{string}/" and "\?{string}?" do the same as "//{string}/r".
"\&{string}&" does the same as "//{string}/". "\&{string}&" does the same as "//{string}/".
*E146* *E146*
Instead of the '/' which surrounds the pattern and replacement string, you Instead of the '/' which surrounds the pattern and replacement string, you
can use any other character, but not an alphanumeric character, '\', '"' or can use any other single-byte character, but not an alphanumeric character,
'|'. This is useful if you want to include a '/' in the search pattern or '\', '"' or '|'. This is useful if you want to include a '/' in the search
replacement string. Example: > pattern or replacement string. Example: >
:s+/+//+ :s+/+//+
For the definition of a pattern, see |pattern|. For the definition of a pattern, see |pattern|.
...@@ -1075,7 +1081,7 @@ and ":put" commands and with CTRL-R. {not in Vi} ...@@ -1075,7 +1081,7 @@ and ":put" commands and with CTRL-R. {not in Vi}
{not available when compiled without the |+cmdline_hist| {not available when compiled without the |+cmdline_hist|
feature} feature}
6. Expression register "= *quote_=* *quote=* 6. Expression register "= *quote_=* *quote=* *@=*
This is not really a register that stores text, but is a way to use an This is not really a register that stores text, but is a way to use an
expression in commands which use a register. The expression register is expression in commands which use a register. The expression register is
read-only; you cannot put text into it. After the '=', the cursor moves to read-only; you cannot put text into it. After the '=', the cursor moves to
...@@ -1365,7 +1371,7 @@ readability. ...@@ -1365,7 +1371,7 @@ readability.
letter meaning when present in 'formatoptions' ~ letter meaning when present in 'formatoptions' ~
t Auto-wrap text using textwidth (does not apply to comments) t Auto-wrap text using textwidth
c Auto-wrap comments using textwidth, inserting the current comment c Auto-wrap comments using textwidth, inserting the current comment
leader automatically. leader automatically.
r Automatically insert the current comment leader after hitting r Automatically insert the current comment leader after hitting
......
*cmdline.txt* For Vim version 7.0. Last change: 2006 Apr 30 *cmdline.txt* For Vim version 7.1a. Last change: 2006 Jul 18
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
...@@ -301,6 +301,10 @@ CTRL-^ Toggle the use of language |:lmap| mappings and/or Input ...@@ -301,6 +301,10 @@ CTRL-^ Toggle the use of language |:lmap| mappings and/or Input
for the next command or Search pattern. for the next command or Search pattern.
{not in Vi} {not in Vi}
*c_CTRL-]*
CTRL-] Trigger abbreviation, without inserting a character. {not in
Vi}
For Emacs-style editing on the command-line see |emacs-keys|. For Emacs-style editing on the command-line see |emacs-keys|.
The <Up> and <Down> keys take the current command-line as a search string. The <Up> and <Down> keys take the current command-line as a search string.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment