From 57657d85c6c3d812e99b5e5d5161c07c66ac7dc7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 21 Apr 2006 22:12:41 +0000 Subject: updated for version 7.0e05 --- runtime/autoload/netrw.vim | 124 +++- runtime/autoload/paste.vim | 6 +- runtime/colors/darkblue.vim | 4 +- runtime/compiler/bdf.vim | 8 +- runtime/compiler/gcc.vim | 4 +- runtime/compiler/rst.vim | 6 +- runtime/doc/eval.txt | 8 +- runtime/doc/index.txt | 3 + runtime/doc/mbyte.txt | 4 +- runtime/doc/options.txt | 30 +- runtime/doc/pi_netrw.txt | 52 +- runtime/doc/print.txt | 4 +- runtime/doc/quickref.txt | 3 +- runtime/doc/sponsor.txt | 6 +- runtime/doc/tabpage.txt | 17 +- runtime/doc/todo.txt | 5 +- runtime/doc/undo.txt | 7 +- runtime/doc/version7.txt | 21 +- runtime/doc/windows.txt | 10 + runtime/filetype.vim | 5 +- runtime/ftplugin/a2ps.vim | 4 +- runtime/ftplugin/ada.vim | 5 +- runtime/ftplugin/alsaconf.vim | 4 +- runtime/ftplugin/arch.vim | 4 +- runtime/ftplugin/automake.vim | 4 +- runtime/ftplugin/bdf.vim | 4 +- runtime/ftplugin/calendar.vim | 4 +- runtime/ftplugin/changelog.vim | 225 +++---- runtime/ftplugin/conf.vim | 4 +- runtime/ftplugin/context.vim | 6 +- runtime/ftplugin/crm.vim | 4 +- runtime/ftplugin/css.vim | 4 +- runtime/ftplugin/cvsrc.vim | 4 +- runtime/ftplugin/dictconf.vim | 4 +- runtime/ftplugin/dictdconf.vim | 4 +- runtime/ftplugin/dircolors.vim | 4 +- runtime/ftplugin/elinks.vim | 4 +- runtime/ftplugin/eterm.vim | 4 +- runtime/ftplugin/fetchmail.vim | 4 +- runtime/ftplugin/gpg.vim | 4 +- runtime/ftplugin/group.vim | 4 +- runtime/ftplugin/grub.vim | 4 +- runtime/ftplugin/haskell.vim | 4 +- runtime/ftplugin/help.vim | 4 +- runtime/ftplugin/indent.vim | 4 +- runtime/ftplugin/ld.vim | 4 +- runtime/ftplugin/lftp.vim | 4 +- runtime/ftplugin/libao.vim | 4 +- runtime/ftplugin/limits.vim | 4 +- runtime/ftplugin/loginaccess.vim | 4 +- runtime/ftplugin/logindefs.vim | 4 +- runtime/ftplugin/m4.vim | 4 +- runtime/ftplugin/mailcap.vim | 4 +- runtime/ftplugin/manconf.vim | 4 +- runtime/ftplugin/mf.vim | 4 +- runtime/ftplugin/modconf.vim | 4 +- runtime/ftplugin/mp.vim | 4 +- runtime/ftplugin/mplayerconf.vim | 4 +- runtime/ftplugin/muttrc.vim | 4 +- runtime/ftplugin/nanorc.vim | 4 +- runtime/ftplugin/netrc.vim | 4 +- runtime/ftplugin/pamconf.vim | 4 +- runtime/ftplugin/passwd.vim | 4 +- runtime/ftplugin/pinfo.vim | 4 +- runtime/ftplugin/procmail.vim | 4 +- runtime/ftplugin/prolog.vim | 4 +- runtime/ftplugin/protocols.vim | 4 +- runtime/ftplugin/quake.vim | 4 +- runtime/ftplugin/racc.vim | 4 +- runtime/ftplugin/readline.vim | 4 +- runtime/ftplugin/rnc.vim | 4 +- runtime/ftplugin/rst.vim | 4 +- runtime/ftplugin/screen.vim | 4 +- runtime/ftplugin/sensors.vim | 4 +- runtime/ftplugin/services.vim | 4 +- runtime/ftplugin/setserial.vim | 4 +- runtime/ftplugin/sieve.vim | 4 +- runtime/ftplugin/slpconf.vim | 4 +- runtime/ftplugin/slpreg.vim | 4 +- runtime/ftplugin/slpspi.vim | 4 +- runtime/ftplugin/sshconfig.vim | 4 +- runtime/ftplugin/sudoers.vim | 4 +- runtime/ftplugin/sysctl.vim | 4 +- runtime/ftplugin/terminfo.vim | 4 +- runtime/ftplugin/udevconf.vim | 4 +- runtime/ftplugin/udevperm.vim | 4 +- runtime/ftplugin/udevrules.vim | 4 +- runtime/ftplugin/updatedb.vim | 4 +- runtime/ftplugin/xdefaults.vim | 4 +- runtime/ftplugin/xf86conf.vim | 4 +- runtime/ftplugin/xinetd.vim | 4 +- runtime/ftplugin/xmodmap.vim | 4 +- runtime/ftplugin/yaml.vim | 4 +- runtime/ftplugin/zsh.vim | 4 +- runtime/indent/automake.vim | 4 +- runtime/indent/cmake.vim | 6 +- runtime/indent/config.vim | 4 +- runtime/indent/css.vim | 4 +- runtime/indent/dictconf.vim | 4 +- runtime/indent/dictdconf.vim | 4 +- runtime/indent/docbk.vim | 4 +- runtime/indent/eterm.vim | 4 +- runtime/indent/ld.vim | 4 +- runtime/indent/make.vim | 47 +- runtime/indent/python.vim | 2 +- runtime/indent/readline.vim | 4 +- runtime/indent/rst.vim | 4 +- runtime/indent/sh.vim | 4 +- runtime/indent/sml.vim | 6 +- runtime/indent/tcl.vim | 4 +- runtime/indent/xf86conf.vim | 4 +- runtime/indent/xinetd.vim | 4 +- runtime/indent/yacc.vim | 4 +- runtime/indent/zsh.vim | 4 +- runtime/keymap/persian-iranian_utf-8.vim | 4 +- runtime/lang/menu_chinese_gb.936.vim | 2 +- runtime/lang/menu_zh_cn.gb2312.vim | 2 +- runtime/lang/menu_zh_cn.utf-8.vim | 2 +- runtime/makemenu.vim | 3 +- runtime/optwin.vim | 4 +- runtime/spell/es/es_ES.diff | 105 +-- runtime/spell/es/main.aap | 2 +- runtime/syntax/a2ps.vim | 4 +- runtime/syntax/alsaconf.vim | 4 +- runtime/syntax/arch.vim | 4 +- runtime/syntax/bdf.vim | 4 +- runtime/syntax/calendar.vim | 4 +- runtime/syntax/chordpro.vim | 67 ++ runtime/syntax/cmake.vim | 2 +- runtime/syntax/context.vim | 81 +-- runtime/syntax/crm.vim | 4 +- runtime/syntax/cvsrc.vim | 4 +- runtime/syntax/dictconf.vim | 4 +- runtime/syntax/dictdconf.vim | 4 +- runtime/syntax/dircolors.vim | 4 +- runtime/syntax/elinks.vim | 4 +- runtime/syntax/esterel.vim | 2 +- runtime/syntax/eterm.vim | 36 +- runtime/syntax/fetchmail.vim | 4 +- runtime/syntax/gpg.vim | 4 +- runtime/syntax/group.vim | 6 +- runtime/syntax/grub.vim | 4 +- runtime/syntax/indent.vim | 6 +- runtime/syntax/ld.vim | 4 +- runtime/syntax/lftp.vim | 4 +- runtime/syntax/libao.vim | 4 +- runtime/syntax/limits.vim | 4 +- runtime/syntax/loginaccess.vim | 4 +- runtime/syntax/logindefs.vim | 4 +- runtime/syntax/manconf.vim | 4 +- runtime/syntax/modconf.vim | 4 +- runtime/syntax/mplayerconf.vim | 4 +- runtime/syntax/nanorc.vim | 4 +- runtime/syntax/netrc.vim | 4 +- runtime/syntax/pamconf.vim | 4 +- runtime/syntax/passwd.vim | 12 +- runtime/syntax/pinfo.vim | 4 +- runtime/syntax/protocols.vim | 4 +- runtime/syntax/quake.vim | 56 +- runtime/syntax/racc.vim | 4 +- runtime/syntax/readline.vim | 4 +- runtime/syntax/rnc.vim | 4 +- runtime/syntax/screen.vim | 4 +- runtime/syntax/sensors.vim | 4 +- runtime/syntax/services.vim | 4 +- runtime/syntax/setserial.vim | 4 +- runtime/syntax/sieve.vim | 4 +- runtime/syntax/slpconf.vim | 4 +- runtime/syntax/slpreg.vim | 4 +- runtime/syntax/slpspi.vim | 4 +- runtime/syntax/sqlj.vim | 2 + runtime/syntax/sudoers.vim | 4 +- runtime/syntax/sysctl.vim | 4 +- runtime/syntax/terminfo.vim | 6 +- runtime/syntax/udevconf.vim | 4 +- runtime/syntax/udevperm.vim | 4 +- runtime/syntax/udevrules.vim | 4 +- runtime/syntax/updatedb.vim | 4 +- runtime/syntax/xinetd.vim | 4 +- runtime/syntax/xmodmap.vim | 4 +- runtime/syntax/yaml.vim | 4 +- src/auto/configure | 2 +- src/configure.in | 2 +- src/digraph.c | 5 +- src/ex_eval.c | 34 +- src/gui.c | 22 +- src/gui_gtk_x11.c | 2 +- src/gui_motif.c | 5 +- src/gui_w48.c | 2 +- src/message.c | 7 +- src/misc2.c | 6 +- src/option.c | 13 +- src/option.h | 1 + src/po/it.po | 68 +- src/po/zh_CN.UTF-8.po | 1048 +++++++++++++++--------------- src/po/zh_CN.cp936.po | 1048 +++++++++++++++--------------- src/po/zh_CN.po | 1048 +++++++++++++++--------------- src/proto/gui.pro | 126 ++-- src/undo.c | 9 +- src/version.h | 6 +- src/window.c | 2 + 201 files changed, 2669 insertions(+), 2351 deletions(-) create mode 100644 runtime/syntax/chordpro.vim diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 79abec5947..f0767abeaa 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -1,7 +1,7 @@ " netrw.vim: Handles file transfer and remote directory listing across a network " AUTOLOAD PORTION -" Date: Apr 14, 2006 -" Version: 88 +" Date: Apr 21, 2006 +" Version: 91 " Maintainer: Charles E Campbell, Jr " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1 @@ -23,7 +23,7 @@ if &cp || exists("g:loaded_netrw") finish endif -let g:loaded_netrw = "v88" +let g:loaded_netrw = "v91" if v:version < 700 echohl WarningMsg | echo "***netrw*** you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw" | echohl None finish @@ -396,7 +396,7 @@ fun! netrw#NetRead(mode,...) let choice = substitute(choice,'\\','/','ge') " call Decho("fixing up windows url to <".choice."> tmpfile<".tmpfile) - exe 'lcd ' . fnamemodify(tmpfile,':h') + exe 'cd ' . fnamemodify(tmpfile,':h') let tmpfile = fnamemodify(tmpfile,':t') endif @@ -890,7 +890,7 @@ fun! netrw#NetWrite(...) range if has("win32") || has("win95") || has("win64") || has("win16") let choice= substitute(choice,'\\','/','ge') "ER: see NetRead() - exe 'lcd ' . fnamemodify(tmpfile,':h') + exe 'cd ' . fnamemodify(tmpfile,':h') let tmpfile = fnamemodify(tmpfile,':t') endif @@ -1233,6 +1233,7 @@ fun! s:NetBrowse(dirname) " call Decho("new path<".path.">") " remote-read the requested file into current buffer + mark ' keepjumps keepalt enew! set ma " call Decho("exe file ".method."://".user.machine."/".escape(path,s:netrw_cd_escape)) @@ -1257,6 +1258,7 @@ fun! s:NetBrowse(dirname) let bufname = method.'://'.user.machine.'/'.path let bufnamenr = bufnr(bufname.'$') " call Decho("bufname<".bufname."> bufnamenr=".bufnamenr) + mark ' if bufnamenr != -1 " buffer already exists, switch to it! " call Decho("buffer already exists, switching to it") @@ -1324,7 +1326,7 @@ fun! s:NetBrowse(dirname) setlocal ma nonu nowrap " Set up the banner -" call Decho("set up the banner: sortby<".g:netrw_sort_by."> method<".method.">") +" call Decho("set up the banner: sortby<".g:netrw_sort_by."> method<".method."> direction<".g:netrw_sort_direction.">") keepjumps put ='\" ===========================================================================' keepjumps put ='\" Netrw Remote Directory Listing (netrw '.g:loaded_netrw.')' keepjumps put ='\" '.bufname @@ -2148,10 +2150,10 @@ fun! s:NetrwWideListing() let b:netrw_cpf= 0 if line("$") >= w:netrw_bannercnt exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif' - else -" call Dret("NetrwWideListing") - return - endif + else +" call Dret("NetrwWideListing") + return + endif " call Decho("max file strlen+1=".b:netrw_cpf) let b:netrw_cpf= b:netrw_cpf + 1 @@ -2163,7 +2165,7 @@ fun! s:NetrwWideListing() " call Decho("fpl= ".winwidth(0)."/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl) " make wide display - exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^.*$/\=printf("%-'.b:netrw_cpf.'s",submatch(0))/' + exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^.*$/\=printf("%-'.b:netrw_cpf.'s",escape(submatch(0),"\\"))/' let fpc = (line("$") - w:netrw_bannercnt + w:netrw_fpl)/w:netrw_fpl let newcolstart = w:netrw_bannercnt + fpc let newcolend = newcolstart + fpc - 1 @@ -2252,11 +2254,15 @@ fun! s:NetMakeDir(usrhost) call mkdir(fullnewdir,"p") else let netrw_origdir= s:NetGetcwd(1) - exe 'cd '.b:netrw_curdir -" call Decho("netrw_origdir<".netrw_origdir."> b:netrw_curdir<".b:netrw_curdir.">") + exe 'keepjumps cd '.b:netrw_curdir +" call Decho("netrw_origdir<".netrw_origdir.">: cd b:netrw_curdir<".b:netrw_curdir.">") " call Decho("exe silent! !".g:netrw_local_mkdir.' "'.newdirname.'"') exe "silent! !".g:netrw_local_mkdir.' "'.newdirname.'"' if !g:netrw_keepdir | exe 'keepjumps cd '.netrw_origdir | endif + if !g:netrw_keepdir + exe 'keepjumps cd '.netrw_origdir +" call Decho("netrw_keepdir=".g:netrw_keepdir.": cd ".netrw_origdir) + endif endif if v:shell_error == 0 @@ -2770,6 +2776,11 @@ fun! netrw#DirBrowse(dirname) endif call s:NetOptionSave() + if w:acdkeep + exe 'cd '.escape(a:dirname,s:netrw_cd_escape) +" call Decho("cd ".escape(a:dirname,s:netrw_cd_escape)) +" call Decho("getcwd<".getcwd().">") + endif if v:version < 603 if !exists("g:netrw_quiet") @@ -2807,6 +2818,7 @@ fun! netrw#DirBrowse(dirname) endif " get cleared buffer + mark ' if bufnum < 0 || !bufexists(bufnum) keepjumps keepalt enew! " call Decho("enew buffer") @@ -2815,8 +2827,8 @@ fun! netrw#DirBrowse(dirname) if exists("s:last_sort_by") && g:netrw_sort_by == s:last_sort_by if getline(2) =~ '^" Netrw Directory Listing ' if !g:netrw_keepdir -" call Decho("change directory: cd ".b:netrw_curdir) exe 'cd '.escape(b:netrw_curdir,s:netrw_cd_escape) +" call Decho("netrw_keepdir=".g:netrw_keepdir.": cd ".escape(b:netrw_curdir,s:netrw_cd_escape)) endif call s:NetOptionRestore() " call Dret("DirBrowse : reusing buffer#".bufnum."<".a:dirname.">") @@ -2847,7 +2859,7 @@ fun! netrw#DirBrowse(dirname) " make netrw's idea of the current directory vim's if the user wishes if !g:netrw_keepdir -" call Decho("change directory: cd ".b:netrw_curdir) +" call Decho("netrw_keepdir=".g:netrw_keepdir.": cd ".escape(b:netrw_curdir,s:netrw_cd_escape)) try exe 'cd '.escape(b:netrw_curdir,s:netrw_cd_escape) catch /^Vim\%((\a\+)\)\=:E472/ @@ -2916,8 +2928,12 @@ fun! netrw#DirBrowse(dirname) nnoremap v :call NetSplit(3) nnoremap x :call netrw#NetBrowseX(LocalBrowseChgDir(b:netrw_curdir,NetGetWord(),0),0)" nnoremap <2-leftmouse> :call LocalBrowse(LocalBrowseChgDir(b:netrw_curdir,NetGetWord())) - nnoremap :Pexplore - nnoremap :Nexplore + if s:didstarstar || !mapcheck("","n") + nnoremap :Nexplore + endif + if s:didstarstar || !mapcheck("","n") + nnoremap :Pexplore + endif exe 'nnoremap :call LocalBrowseRm("'.b:netrw_curdir.'")' exe 'vnoremap :call LocalBrowseRm("'.b:netrw_curdir.'")' exe 'nnoremap D :call LocalBrowseRm("'.b:netrw_curdir.'")' @@ -3040,7 +3056,7 @@ endfun " --------------------------------------------------------------------- " LocalBrowseList: does the job of "ls" for local directories {{{2 fun! s:LocalBrowseList() -" call Dfunc("LocalBrowseList() b:netrw_curdir<".b:netrw_curdir.">") +" call Dfunc("LocalBrowseList() b:netrw_curdir<".b:netrw_curdir."> sortby<".g:netrw_sort_by.">") " get the list of files contained in the current directory let dirname = escape(b:netrw_curdir,s:netrw_glob_escape) @@ -3070,7 +3086,11 @@ fun! s:LocalBrowseList() " call Decho("filelist<".filelist.">") endif let filelist= substitute(filelist,'\n\{2,}','\n','ge') - let filelist= substitute(filelist,'\','/','ge') + if (has("win32") || has("win95") || has("win64") || has("win16")) + let filelist= substitute(filelist,'\','/','ge') + else + let filelist= substitute(filelist,'\','\\','ge') + endif " call Decho("dirname<".dirname.">") " call Decho("dirnamelen<".dirnamelen.">") @@ -3503,6 +3523,12 @@ fun! netrw#Explore(indx,dosplit,style,...) endif norm! 0 + if a:1 =~ '\*/' + " Explore */pattern + let pattern= substitute(a:1,'^\*/\(.*\)$','\1','') +" call Decho("Explore */".pattern) + endif + if a:1 == "" && a:indx >= 0 " Explore Hexplore Vexplore Sexplore " call Decho("Explore Hexplore Vexplore Sexplore") @@ -3516,26 +3542,61 @@ fun! netrw#Explore(indx,dosplit,style,...) call s:LocalBrowse(newdir) endif - elseif a:1 =~ '\*\*/' || a:indx < 0 - " Nexplore Pexplore -or- Explore **/... -" call Decho("Nexplore Pexplore -or- Explore **/...") + elseif a:1 =~ '^\*\*/' || a:indx < 0 || a:1 =~ '^\*/' + " Nexplore, Pexplore, Explore **/... , or Explore */pattern +" call Decho("Nexplore, Pexplore, , , Explore ".a:1) + let s:didstarstar= 1 + if exists("b:netrw_curdir") + nnoremap :Pexplore + nnoremap :Nexplore + endif if has("path_extra") if !exists("w:netrw_explore_indx") let w:netrw_explore_indx= 0 endif let indx = a:indx +" call Decho("input indx=".indx) +" if indx == -1 + if !exists("w:netrw_explore_list") " sanity check + echohl WarningMsg | echo "***netrw*** using Nexplore or improperly; see help for netrw-starstar" | echohl None + call inputsave()|call input("Press to continue")|call inputrestore() +" call Dret("Explore") + return + endif let indx= w:netrw_explore_indx + 1 +" call Decho("indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx) + elseif indx == -2 + if !exists("w:netrw_explore_list") " sanity check + echohl WarningMsg | echo "***netrw*** using Pexplore or improperly; see help for netrw-starstar" | echohl None + call inputsave()|call input("Press to continue")|call inputrestore() +" call Dret("Explore") + return + endif let indx= w:netrw_explore_indx - 1 +" call Decho("indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx) + else + " build list of files to Explore with Nexplore/Pexplore let w:netrw_explore_indx = 0 if !exists("b:netrw_curdir") let b:netrw_curdir= getcwd() endif - let w:netrw_explore_list = split(expand(b:netrw_curdir."/".a:1),'\n') +" call Decho("b:netrw_curdir<".b:netrw_curdir.">") + if exists("pattern") +" call Decho("building list based on pattern<".pattern."> cwd<".getcwd().">") + exe "vimgrep /".pattern."/gj ".b:netrw_curdir."/*" + let w:netrw_explore_list = map(getqflist(),'b:netrw_curdir.bufname(v:val.bufnr)') + else +" call Decho("building list based on ".b:netrw_curdir."/".a:1) + let w:netrw_explore_list= split(expand(b:netrw_curdir."/".a:1),'\n') + endif + let w:netrw_explore_listlen = len(w:netrw_explore_list) +" call Decho("w:netrw_explore_list<".string(w:netrw_explore_list)."> listlen=".w:netrw_explore_listlen) + if w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/' echohl WarningMsg | echo "***netrw*** no files matched" | echohl None call inputsave()|call input("Press to continue")|call inputrestore() @@ -3928,14 +3989,9 @@ fun! s:NetOptionSave() endif " Get Temporary Filename - let w:aikeep = &ai -" " netrw and the acd option do not work together properly -" if &acd && (has("netbeans_intg") || has("sun_workshop")) -" set noacd -" echohl Warning | echomsg "***warning*** directory browsing and the acd setting are incompatible" |echohl None -" endif - let w:fokeep = &fo + let w:acdkeep = &acd let w:aikeep = &ai + let w:fokeep = &fo let w:cikeep = &ci let w:cinkeep = &cin let w:cinokeep = &cino @@ -3943,9 +3999,6 @@ fun! s:NetOptionSave() let w:cpokeep = &cpo let w:hidkeep = &hidden let w:magickeep = &magic - if !g:netrw_keepdir - let w:dirkeep = getcwd() - endif let w:gdkeep = &gd let w:repkeep = &report let w:spellkeep = &spell @@ -3953,7 +4006,7 @@ fun! s:NetOptionSave() setlocal cino = setlocal com = setlocal cpo -=aA - setlocal nocin noai noci magic nospell fo=nroql2 nohid + setlocal noacd nocin noai noci magic nospell fo=nroql2 nohid setlocal tw =0 setlocal report=10000 if has("win32") && !has("win95") @@ -3975,14 +4028,13 @@ fun! s:NetOptionRestore() endif unlet w:netoptionsave - if exists("w:aikeep")| let &ai= w:aikeep|endif + if exists("w:acdkeep") |let &acd = w:acdkeep |unlet w:acdkeep |endif if exists("w:aikeep") |let &ai = w:aikeep |unlet w:aikeep |endif if exists("w:cikeep") |let &ci = w:cikeep |unlet w:cikeep |endif if exists("w:cinkeep") |let &cin = w:cinkeep |unlet w:cinkeep |endif if exists("w:cinokeep") |let &cino = w:cinokeep |unlet w:cinokeep |endif if exists("w:comkeep") |let &com = w:comkeep |unlet w:comkeep |endif if exists("w:cpokeep") |let &cpo = w:cpokeep |unlet w:cpokeep |endif - if exists("w:dirkeep") |exe "lcd ".w:dirkeep |unlet w:dirkeep |endif if exists("w:fokeep") |let &fo = w:fokeep |unlet w:fokeep |endif if exists("w:gdkeep") |let &gd = w:gdkeep |unlet w:gdkeep |endif if exists("w:hidkeep") |let &hidden = w:hidkeep |unlet w:hidkeep |endif diff --git a/runtime/autoload/paste.vim b/runtime/autoload/paste.vim index 435c5e6235..a61cec64f8 100644 --- a/runtime/autoload/paste.vim +++ b/runtime/autoload/paste.vim @@ -1,6 +1,6 @@ " Vim support file to help with paste mappings and menus " Maintainer: Bram Moolenaar -" Last Change: 2006 Mar 09 +" Last Change: 2006 Apr 21 " Define the string to use for items that are present both in Edit, Popup and " Toolbar menu. Also used in mswin.vim and macmap.vim. @@ -33,7 +33,3 @@ else let paste#paste_cmd['v'] = '"-cgix' . paste#paste_cmd['n'] . '"_x' let paste#paste_cmd['i'] = 'x' . paste#paste_cmd['n'] . '"_s' endif - -if has("virtualedit") -else -endif diff --git a/runtime/colors/darkblue.vim b/runtime/colors/darkblue.vim index 4bf05d0447..9812e98901 100644 --- a/runtime/colors/darkblue.vim +++ b/runtime/colors/darkblue.vim @@ -1,6 +1,6 @@ " Vim color file " Maintainer: Bohdan Vlasyuk -" Last Change: 2005 Mar 28 +" Last Change: 2006 Apr 21 " darkblue -- for those who prefer dark background " [note: looks bit uglier with come terminal palettes, @@ -58,5 +58,3 @@ hi PreProc ctermfg=magenta guifg=#ff80ff gui=none cterm=none hi type ctermfg=green guifg=#60ff60 gui=none cterm=none hi Underlined cterm=underline term=underline hi Ignore guifg=bg ctermfg=bg - - diff --git a/runtime/compiler/bdf.vim b/runtime/compiler/bdf.vim index a30a9b6907..ca33776988 100644 --- a/runtime/compiler/bdf.vim +++ b/runtime/compiler/bdf.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: BDF to PCF Conversion -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-06-29 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("current_compiler") finish @@ -11,9 +11,9 @@ let current_compiler = "bdf" let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=bdftopcf\ $* +setlocal makeprg=bdftopcf\ $* -CompilerSet errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m, +setlocal errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m, \%-Z%p^, \%Cbdftopcf:\ bdf\ input\\,\ %f\\,\ corrupt, \%-G%.%# diff --git a/runtime/compiler/gcc.vim b/runtime/compiler/gcc.vim index 11f7714da1..699d14f5f4 100644 --- a/runtime/compiler/gcc.vim +++ b/runtime/compiler/gcc.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: GNU C Compiler -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-06-29 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("current_compiler") finish diff --git a/runtime/compiler/rst.vim b/runtime/compiler/rst.vim index d0ff88b37b..07c7d4139c 100644 --- a/runtime/compiler/rst.vim +++ b/runtime/compiler/rst.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: reStructuredText Documentation Format -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-06-29 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("current_compiler") finish @@ -11,7 +11,7 @@ let current_compiler = "rst" let s:cpo_save = &cpo set cpo-=C -CompilerSet errorformat= +setlocal errorformat= \%f:%l:\ (%tEBUG/0)\ %m, \%f:%l:\ (%tNFO/1)\ %m, \%f:%l:\ (%tARNING/2)\ %m, diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 80a0c1d543..4fff9d0a91 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.0e. Last change: 2006 Apr 15 +*eval.txt* For Vim version 7.0e. Last change: 2006 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1369,9 +1369,9 @@ v:lc_time The current locale setting for time messages of the runtime *v:lnum* *lnum-variable* v:lnum Line number for the 'foldexpr' |fold-expr| and 'indentexpr' - expressions, tab page number for 'guitablabel'. Only valid - while one of these expressions is being evaluated. Read-only - when in the |sandbox|. + expressions, tab page number for 'guitablabel' and + 'guitabtooltip'. Only valid while one of these expressions is + being evaluated. Read-only when in the |sandbox|. *v:prevcount* *prevcount-variable* v:prevcount The count given for the last but one Normal mode command. diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 8fc3cef9c6..77ebed95f2 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -552,6 +552,9 @@ tag command action in Normal mode ~ |CTRL-W_g}| CTRL-W g } do a |:ptjump| to the tag under the cursor |CTRL-W_gf| CTRL-W g f edit file name under the cursor in a new tab page +|CTRL-W_gF| CTRL-W g F edit file name under the cursor in a new + tab page and jump to the line number + following the file name. |CTRL-W_h| CTRL-W h go to Nth left window (stop at first window) |CTRL-W_i| CTRL-W i split window and jump to declaration of identifier under the cursor diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index b660d2c779..44cbea9031 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -1,4 +1,4 @@ -*mbyte.txt* For Vim version 7.0e. Last change: 2006 Apr 02 +*mbyte.txt* For Vim version 7.0e. Last change: 2006 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar et al. @@ -1035,7 +1035,7 @@ use a brightly colored cursor: > :highlight Cursor guifg=NONE guibg=Green :highlight lCursor guifg=NONE guibg=Cyan < - *keymap-file-format* *:loadk* *:loadkeymap* *E105* + *keymap-file-format* *:loadk* *:loadkeymap* *E105* *E791* The keymap file looks something like this: > " Maintainer: name diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index beee11d9e5..7bbd96949e 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.0e. Last change: 2006 Apr 20 +*options.txt* For Vim version 7.0e. Last change: 2006 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2092,12 +2092,16 @@ A jump table for the options with a short description can be found at |Q_op|. 'debug' string (default "") global {not in Vi} - When set to "msg", error messages that would otherwise be omitted will - be given anyway. This is useful when debugging 'foldexpr', - 'formatexpr' or 'indentexpr'. - When set to "beep", a message will be given when otherwise only a beep - would be produced. + These values can be used: + msg Error messages that would otherwise be omitted will be given + anyway. + throw Error messages that would otherwise be omitted will be given + anyway and also throw an exception and set |v:errmsg|. + beep A message will be given when otherwise only a beep would be + produced. The values can be combined, separated by a comma. + "msg" and "throw" are useful for debugging 'foldexpr', 'formatexpr' or + 'indentexpr'. *'define'* *'def'* 'define' 'def' string (default "^\s*#\s*define") @@ -3407,11 +3411,25 @@ A jump table for the options with a short description can be found at |Q_op|. |setting-guitablabel| for more info. The format of this option is like that of 'statusline'. + 'guitabtooltip' is used for the tooltip, see below. Only used when the GUI tab pages line is displayed. 'e' must be present in 'guioptions'. For the non-GUI tab pages line 'tabline' is used. + *'guitabtooltip'* *'gtt'* +'guitabtooltip' 'gtt' string (default empty) + global + {not in Vi} + {only available when compiled with GUI enabled and + with the +windows feature} + When nonempty describes the text to use in a tooltip for the GUI tab + pages line. When empty Vim will use a default tooltip. + This option is otherwise just like 'guitablabel' above. + + The tooltip only works for some systems. + + *'helpfile'* *'hf'* 'helpfile' 'hf' string (default (MSDOS) "$VIMRUNTIME\doc\help.txt" (others) "$VIMRUNTIME/doc/help.txt") diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 8cb8010fd0..ee59953160 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 7.0e. Last change: Apr 12, 2006 +*pi_netrw.txt* For Vim version 7.0e. Last change: Apr 21, 2006 VIM REFERENCE MANUAL by Charles E. Campbell, Jr. @@ -782,7 +782,7 @@ NETRW BROWSER VARIABLES *netrw-browse-var* =0 keep the current directory the same as the browsing directory. The current browsing directory is contained in - b:netrw_curdir + b:netrw_curdir (also see |netrw-c|) *g:netrw_list_cmd* command for listing remote directories default: (if ssh is executable) @@ -919,15 +919,16 @@ DIRECTORY EXPLORING COMMANDS *netrw-nexplore* *netrw-vexplore* By default, these commands use the current file's directory. However, one may explicitly provide a directory (path) to use. -(Following needs v7.0 or later) *netrw-starstar* -When Explore, Sexplore, Hexplore, or Vexplore are used with a **, + *netrw-starstar* +When Explore, Sexplore, Hexplore, or Vexplore are used with a **/filepat, such as: > :Explore **/filename_pattern < -netrw will attempt to find a (sub)directory which matches the filename -pattern. Internally, it produces a list of files which match the pattern -and their paths; to that extent it resembles the Unix operation: +netrw will attempt to find a file in the current directory or any subdirectory +which matches the filename pattern. Internally, it produces a list of files +which match the pattern and their paths; to that extent it resembles the Unix +operation: > find $(pwd) -name "$1" -exec "echo" "{}" ";" 2> /dev/null < @@ -951,6 +952,18 @@ As an example, consider The status line will show, on the right hand side of the status line, a message like "Match 3 of 20". + *netrw-starpat* +When Explore, Sexplore, Hexplore, or Vexplore are used with a */pattern, +such as: +> + :Explore */pattern +< +netrw will use |:vimgrep| to find files which contain the given pattern. +Like what happens with |netrw-starstar|, a list of files which contain +matches to the given pattern is generated. The cursor will then jump +to the first file with the given pattern; |:Nexplore|, |:Pexplore|, and +the shifted-down and -up arrows work with the list to move to the next +or previous files in that list. REFRESHING THE LISTING *netrw-ctrl-l* @@ -1261,14 +1274,16 @@ to forward a copy to me for future inclusion in the distribution. MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir* -By default, g:netrw_keepdir is 1. This setting means that the current +By default, |g:netrw_keepdir| is 1. This setting means that the current directory will not track the browsing directory. However, setting -g:netrw_keepdir to 0 (say, in your <.vimrc>) will tell netrw to have the -currently browsed directory be the current directory. +g:netrw_keepdir to 0 (say, in your <.vimrc>) will tell netrw to make the +currently browsed directory also be the current directory. -With the default setting for g:netrw_keepdir, in order to make the two -directories the same, use the "c" map (just type c). That map will set the -current directory to the current browsing directory. +However, with the default setting for g:netrw_keepdir of 1 where netrw +maintains its own separate notion of the current directory, in order to make +the two directories the same, use the "c" map (just type c). That map will +set Vim's notion of the current directory to the netrw's current browsing +directory. BOOKMARKING A DIRECTORY *netrw-b* *netrw-bookmark* *netrw-bookmarks* @@ -1447,6 +1462,17 @@ which is loaded automatically at startup (assuming :set nocp). ============================================================================== 11. History *netrw-history* {{{1 + v91: * :Explore */pattern implemented + * |'acd'| option bypassed + v90: * mark ', as suggested by Yegappan Lakshmanan, used to help + guarantee entry into the jump list when appropriate. + * and are no longer defined until a + :Explore **/pattern is used (if the user already has a map + for them). They will be defined for new browser windows + from that point forward. + v89: * A , , :Nexplore, or a :Pexplore without having + first done an :Explore **/pattern (see |netrw-starstar|) caused + a lot of unhelpful error messages to appear v88: * moved DrChip.Netrw menu to Netrw. Now has priority 80 by default. g:NetrwTopLvlMenu == "Netrw" and can be changed by the user to suit. The priority is g:NetrwMenuPriority. diff --git a/runtime/doc/print.txt b/runtime/doc/print.txt index 54412daf1b..b10157d7e2 100644 --- a/runtime/doc/print.txt +++ b/runtime/doc/print.txt @@ -1,4 +1,4 @@ -*print.txt* For Vim version 7.0e. Last change: 2005 Apr 01 +*print.txt* For Vim version 7.0e. Last change: 2006 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -287,7 +287,7 @@ another font will be used as follows: if b: is missing, then use r: if i: is missing, then use r: - if o: is missing, then use i: + if o: is missing, then use b: Some CJK fonts do not contain characters for codes in the ASCII code range. Also, some characters in the CJK ASCII code ranges differ in a few code points diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index 8cefeafcbe..78721196cf 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 7.0e. Last change: 2006 Mar 23 +*quickref.txt* For Vim version 7.0e. Last change: 2006 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -707,6 +707,7 @@ Short explanation of each option: *option-list* 'guioptions' 'go' GUI: Which components and options are used 'guipty' GUI: try to use a pseudo-tty for ":!" commands 'guitablabel' 'gtl' GUI: custom label for a tab page +'guitabtooltip' 'gtt' GUI: custom tooltip for a tab page 'helpfile' 'hf' full path name of the main help file 'helpheight' 'hh' minimum height of a new help window 'helplang' 'hlg' preferred help languages diff --git a/runtime/doc/sponsor.txt b/runtime/doc/sponsor.txt index fe7ab27f4f..2f9090dcdb 100644 --- a/runtime/doc/sponsor.txt +++ b/runtime/doc/sponsor.txt @@ -1,4 +1,4 @@ -*sponsor.txt* For Vim version 7.0e. Last change: 2006 Mar 29 +*sponsor.txt* For Vim version 7.0e. Last change: 2006 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -202,8 +202,8 @@ Are the donations tax deductible? That depends on your country. The donations to help the children in |Uganda| are tax deductible in Holland, Germany, Canada and in the USA. See the ICCF -website http://www.iccf.nl/donate.html. You must send an e-mail to Bram to -let him know that the donation is done because of the use of Vim. +website http://iccf-holland.org/donate.html. You must send an e-mail to Bram +to let him know that the donation is done because of the use of Vim. Can you send me a bill? diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index 566c802ad2..f8d1223509 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -1,4 +1,4 @@ -*tabpage.txt* For Vim version 7.0e. Last change: 2006 Apr 13 +*tabpage.txt* For Vim version 7.0e. Last change: 2006 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -82,6 +82,9 @@ In the GUI tab pages line you can use the right mouse button to open menu. CTRL-W gf Open a new tab page and edit the file name under the cursor. See |CTRL-W_gf|. +CTRL-W gF Open a new tab page and edit the file name under the cursor + and jump to the line number following the file name. + See |CTRL-W_gF|. CLOSING A TAB PAGE: @@ -306,21 +309,25 @@ specify the label to display for each tab page. Unlike 'tabline', which specifies the whole tab pages line at once, 'guitablabel' is used for each label separately. +'guitabtooltip' is very similar and is used for the tooltip of the same label. +This only appears when the mouse pointer hovers over the label, thus it +usually is longer. Only supported on some systems though. + See the 'statusline' option for the format of the value. The "%N" item can be used for the current tab page number. The |v:lnum| -variable is also set to this number when 'guitablabel' is evaluated. +variable is also set to this number when the option is evaluated. The items that use a file name refer to the current window of the tab page. -Note that syntax highlighting is not used for 'guitablabel'. The %T and %X +Note that syntax highlighting is not used for the option. The %T and %X items are also ignored. A simple example that puts the tab page number and the buffer name in the label: > :set guitablabel=%N\ %f -An example that resembles the default: Show the number of windows in the tab -page and a '+' if there is a modifed buffer: > +An example that resembles the default 'guitablabel': Show the number of +windows in the tab page and a '+' if there is a modifed buffer: > function GuiTabLabel() let label = '' diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 82fc5dd2db..08e85d8bd6 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.0e. Last change: 2006 Apr 20 +*todo.txt* For Vim version 7.0e. Last change: 2006 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -30,7 +30,7 @@ be worked on, but only if you sponsor Vim development. See |sponsor|. *known-bugs* -------------------- Known bugs and current work ----------------------- -For a tooltip of at GUI tab label we need a new field. Also 'guitabtip'? +Win32: Crash when adding many menu entries. (Karl Waedt) Crash in "z=" when the change triggers checking out the file, FileChangedRO event. Problem in move_lines()? FileChangedShell also involved? (Neil Bird) @@ -39,6 +39,7 @@ Added a few checks for valid buffer, did that help? Fix coverity false positives? Add more tests for all new functionality in Vim 7. Especially new functions. + :undojoin Win32: Describe how to do debugging. (George Reilly) diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt index 432c855870..5e7b4ed8e9 100644 --- a/runtime/doc/undo.txt +++ b/runtime/doc/undo.txt @@ -1,4 +1,4 @@ -*undo.txt* For Vim version 7.0e. Last change: 2006 Apr 12 +*undo.txt* For Vim version 7.0e. Last change: 2006 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -87,10 +87,11 @@ undone together. If you want to write a function or script that doesn't create a new undoable change but joins in with the previous change use this command: - *:undoj* *:undojoin* + *:undoj* *:undojoin* *E790* :undoj[oin] Join further changes with the previous undo block. Warning: Use with care, it may prevent the user from - properly undoing changes. + properly undoing changes. Don't use this after undo + or redo. {not in Vi} This is most useful when you need to prompt the user halfway a change. For diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index 6c701e1809..1aa93b6b7f 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -1,4 +1,4 @@ -*version7.txt* For Vim version 7.0e. Last change: 2006 Apr 20 +*version7.txt* For Vim version 7.0e. Last change: 2006 Apr 21 VIM REFERENCE MANUAL by Bram Moolenaar @@ -280,9 +280,9 @@ argument. The maximum number of pages can be set with 'tabpagemax'. The line with tab labels is either made with plain text an highlighting or with a GUI mechanism. The GUI labels look better but are only available on a -few systems. The line can be customized with 'tabline' and 'guitablabel'. -Whether it is displayed is set with 'showtabline'. Whether to use the GUI -labels is set with the "e" flag in 'guioptions'. +few systems. The line can be customized with 'tabline', 'guitablabel' and +'guitabtooltip'. Whether it is displayed is set with 'showtabline'. Whether +to use the GUI labels is set with the "e" flag in 'guioptions'. The |:tab| command modifier can be used to have most commands that open a new window open a new tab instead. @@ -895,6 +895,7 @@ BibTeX indent file. (Dorai Sitaram) BTM ftplugin file. (Bram Moolenaar) calendar ftplugin file. (Nikolai Weibull) Changelog indent file. (Nikolai Weibull) +ChordPro syntax file. (Niels Bo Andersen) Cmake indent and syntax file. (Andy Cedilnik) conf ftplugin file. (Nikolai Weibull) context syntax and ftplugin file. (Nikolai Weibull) @@ -2569,5 +2570,17 @@ It was possible to switch to another tab page when the cmdline window is open. Completion could hang when 'lines' is 6 and a preview window was opened. +Added CTRL-W gF: open file under cursor in new tab page and jump to the line +number following the file name. +Added 'guitabtooltip', but it's not implemented anywhere yet. + +Added "throw" to 'debug' option: thow an exception for error messages even +whey they would otherwise be ignored. + +When 'keymap' is set and a line contains an invalid entry could get a "No +mapping found" warning instead of a proper error message. + +Motif: default to using XpmAttributes instead of XpmAttributes_21. + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index f3e1c4545d..2e5db8b511 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -729,6 +729,8 @@ CTRL-W F *CTRL-W_F* Split current window in two. Edit file name under cursor and jump to the line number following the file name. See |gF| for details on how the line number is obtained. + {not available when the |+file_in_path| feature was disabled + at compile time} CTRL-W gf *CTRL-W_gf* Open a new tab page and edit the file name under the cursor. @@ -737,6 +739,14 @@ CTRL-W gf *CTRL-W_gf* {not available when the |+file_in_path| feature was disabled at compile time} +CTRL-W gF *CTRL-W_gF* + Open a new tab page and edit the file name under the cursor + and jump to the line number following the file name. Like + "tab split" and "gF", but the new tab page isn't created if + the file does not exist. + {not available when the |+file_in_path| feature was disabled + at compile time} + Also see |CTRL-W_CTRL-I|: open window for an included file that includes the keyword under the cursor. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index ef59e53644..617cbe6dd9 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2006 Apr 19 +" Last Change: 2006 Apr 21 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -390,6 +390,9 @@ fun! s:FTchange() setf chill endfun +" ChordPro +au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro + " Clean au BufNewFile,BufRead *.dcl,*.icl setf clean diff --git a/runtime/ftplugin/a2ps.vim b/runtime/ftplugin/a2ps.vim index e590c98067..a596fc8396 100644 --- a/runtime/ftplugin/a2ps.vim +++ b/runtime/ftplugin/a2ps.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: a2ps(1) configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-07-04 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:did_ftplugin") finish diff --git a/runtime/ftplugin/ada.vim b/runtime/ftplugin/ada.vim index 06c057fc83..13fa8f93f4 100644 --- a/runtime/ftplugin/ada.vim +++ b/runtime/ftplugin/ada.vim @@ -1,7 +1,7 @@ " Vim Ada plugin file " Language: Ada " Maintainer: Neil Bird -" Last Change: 2003 May 11 +" Last Change: 2006 Apr 21 " Version: $Id$ " Look for the latest version at http://vim.sourceforge.net/ " @@ -14,7 +14,6 @@ " Exports 'AdaWord()' function to return full name of Ada entity under the " cursor( or at given line/column), stripping whitespace/newlines as necessary. - " Only do this when not done yet for this buffer if exists("b:did_ftplugin") finish @@ -27,11 +26,9 @@ let b:did_ftplugin = 1 let s:cpoptions = &cpoptions set cpo-=C - " Ada comments setlocal comments+=O:-- - " Make local tag mappings for this buffer (if not already set) if mapcheck('','n') == '' nnoremap :call JumpToTag_ada('') diff --git a/runtime/ftplugin/alsaconf.vim b/runtime/ftplugin/alsaconf.vim index c0e13a7e9a..0ef6991d38 100644 --- a/runtime/ftplugin/alsaconf.vim +++ b/runtime/ftplugin/alsaconf.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: alsaconf(8) configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-07-04 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:did_ftplugin") finish diff --git a/runtime/ftplugin/arch.vim b/runtime/ftplugin/arch.vim index 9433f10093..2da9e40ac1 100644 --- a/runtime/ftplugin/arch.vim +++ b/runtime/ftplugin/arch.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: GNU Arch inventory file -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-07-04 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:did_ftplugin") finish diff --git a/runtime/ftplugin/automake.vim b/runtime/ftplugin/automake.vim index 1ef28d1ec3..c48ea13e15 100644 --- a/runtime/ftplugin/automake.vim +++ b/runtime/ftplugin/automake.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Automake -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-06-22 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:did_ftplugin") finish diff --git a/runtime/ftplugin/bdf.vim b/runtime/ftplugin/bdf.vim index 92ee66bfc4..a010c2c5ae 100644 --- a/runtime/ftplugin/bdf.vim +++ b/runtime/ftplugin/bdf.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: BDF font definition -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-07-04 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:did_ftplugin") finish diff --git a/runtime/ftplugin/calendar.vim b/runtime/ftplugin/calendar.vim index c786203dbe..ca5651118c 100644 --- a/runtime/ftplugin/calendar.vim +++ b/runtime/ftplugin/calendar.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: calendar(1) input file -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-07-04 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:did_ftplugin") finish diff --git a/runtime/ftplugin/changelog.vim b/runtime/ftplugin/changelog.vim index b229dbe84c..b4206a2009 100644 --- a/runtime/ftplugin/changelog.vim +++ b/runtime/ftplugin/changelog.vim @@ -1,11 +1,14 @@ " Vim filetype plugin file " Language: generic Changelog file -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-06-29 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 " Variables: -" g:changelog_timeformat - +" g:changelog_timeformat (deprecated: use g:changelog_dateformat instead) - " description: the timeformat used in ChangeLog entries. " default: "%Y-%m-%d". +" g:changelog_dateformat - +" description: the format sent to strftime() to generate a date string. +" default: "%Y-%m-%d". " g:changelog_username - " description: the username to use in ChangeLog entries " default: try to deduce it from environment variables and system files. @@ -25,8 +28,8 @@ " Problem is that you might end up with ChangeLog files all over the place. " If 'filetype' isn't "changelog", we must have been to add ChangeLog opener -if &filetype == "changelog" - if exists("b:did_ftplugin") +if &filetype == 'changelog' + if exists('b:did_ftplugin') finish endif let b:did_ftplugin = 1 @@ -34,20 +37,25 @@ if &filetype == "changelog" let s:cpo_save = &cpo set cpo&vim - " The format of the date-time field (should have been called dateformat) - if !exists("g:changelog_timeformat") - let g:changelog_timeformat = "%Y-%m-%d" + " Set up the format used for dates. + if !exists('g:changelog_dateformat') + if exists('g:changelog_timeformat') + let g:changelog_dateformat = g:changelog_timeformat + else + let g:changelog_dateformat = "%Y-%m-%d" + endif endif " Try to figure out a reasonable username of the form: - " Full Name - if !exists("g:changelog_username") - if exists("$EMAIL_ADDRESS") - let g:changelog_username = $EMAIL_ADDRESS - elseif exists("$EMAIL") + " Full Name . + 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 + " Get the users login name. let login = system('whoami') if v:shell_error let login = 'unknown' @@ -58,43 +66,42 @@ if &filetype == "changelog" endif endif - " Try to full name from gecos field in /etc/passwd + " Try to get the full name from gecos field in /etc/passwd. if filereadable('/etc/passwd') - let name = substitute( - \system('cat /etc/passwd | grep ^`whoami`'), - \'^\%([^:]*:\)\{4}\([^:]*\):.*$', '\1', '') + 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 there is no such file, or there was some other problem try - " others - if !filereadable('/etc/passwd') || v:shell_error - " Maybe the environment has something of interest + " 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 + " character. let name = toupper(login[0]) . strpart(login, 1) endif endif - " 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 - - " Get our hostname - let hostname = system("hostname") + " Get our hostname. + let hostname = system('hostname') if v:shell_error - let hostname = 'unknownhost' + let hostname = 'localhost' else let newline = stridx(hostname, "\n") if newline != -1 @@ -102,102 +109,99 @@ if &filetype == "changelog" endif endif - " And finally set the username - let g:changelog_username = name.' <'.login.'@'.hostname.'>' + " And finally set the username. + let g:changelog_username = name . ' <' . login . '@' . hostname . '>' endif endif - " Format used for new date-entries - if !exists("g:changelog_new_date_format") + " Format used for new date entries. + if !exists('g:changelog_new_date_format') let g:changelog_new_date_format = "%d %u\n\n\t* %c\n\n" endif - " Format used for new entries to current date-entry - if !exists("g:changelog_new_entry_format") + " Format used for new entries to current date entry. + if !exists('g:changelog_new_entry_format') let g:changelog_new_entry_format = "\t* %c" endif - if !exists("g:changelog_date_entry_search") + " Regular expression used to find a given date entry. + if !exists('g:changelog_date_entry_search') let g:changelog_date_entry_search = '^\s*%d\_s*%u' endif - " Substitutes specific items in new date-entry formats and search strings - " Can be done with substitute of course, but unclean, and need \@! then + " Substitutes specific items in new date-entry formats and search strings. + " Can be done with substitute of course, but unclean, and need \@! then. function! s:substitute_items(str, date, user) let str = a:str + let middles = {'%': '%', 'd': a:date, 'u': a:user, 'c': '{cursor}'} let i = stridx(str, '%') while i != -1 - let char = str[i + 1] - if char == '%' - let middle = '%' - elseif char == 'd' - let middle = a:date - elseif char == 'u' - let middle = a:user - elseif char == 'c' - let middle = '{cursor}' - else - let middle = char + let inc = 0 + if has_key(middles, str[i + 1]) + let mid = middles[str[i + 1]] + let str = strpart(str, 0, i) . mid . strpart(str, i + 2) + let inc = strlen(mid) endif - let str = strpart(str, 0, i) . middle . strpart(str, i + 2) - let i = stridx(str, '%') + let i = stridx(str, '%', i + 1 + inc) endwhile return str endfunction + " Position the cursor once we've done all the funky substitution. function! s:position_cursor() if search('{cursor}') > 0 - let pos = line('.') - let line = getline(pos) + let lnum = line('.') + let line = getline(lnum) let cursor = stridx(line, '{cursor}') - call setline(pos, substitute(line, '{cursor}', '', '')) + call setline(lnum, substitute(line, '{cursor}', '', '')) endif startinsert! endfunction - " Internal function to create a new entry in the ChangeLog + " Internal function to create a new entry in the ChangeLog. function! s:new_changelog_entry() - " Deal with 'paste' option + " Deal with 'paste' option. let save_paste = &paste let &paste = 1 - 1 - " Look for an entry for today by our user - let date = strftime(g:changelog_timeformat) + call cursor(1, 1) + " Look for an entry for today by our user. + let date = strftime(g:changelog_dateformat) let search = s:substitute_items(g:changelog_date_entry_search, date, - \g:changelog_username) + \ g:changelog_username) if search(search) > 0 - " Ok, now we look for the end of the date-entry, and add an entry - let pos = nextnonblank(line('.') + 1) - let line = getline(pos) - while line =~ '^\s\+\S\+' - let pos = pos + 1 - let line = getline(pos) - endwhile - let insert = s:substitute_items(g:changelog_new_entry_format, - \'', '') - execute "normal! ".(pos - 1)."Go".insert - execute pos + " Ok, now we look for the end of the date entry, and add an entry. + call cursor(nextnonblank(line('.') + 1), 1) + if search('^\s*$', 'W') > 0 + let p = line('.') - 1 + else + let p = line('.') + endif + let ls = split(s:substitute_items(g:changelog_new_entry_format, '', ''), + \ '\n') + call append(p, ls) + call cursor(p + 1, 1) else - " Flag for removing empty lines at end of new ChangeLogs + " Flag for removing empty lines at end of new ChangeLogs. let remove_empty = line('$') == 1 - " No entry today, so create a date-user header and insert an entry + " No entry today, so create a date-user header and insert an entry. let todays_entry = s:substitute_items(g:changelog_new_date_format, - \date, g:changelog_username) - " Make sure we have a cursor positioning + \ date, g:changelog_username) + " Make sure we have a cursor positioning. if stridx(todays_entry, '{cursor}') == -1 - let todays_entry = todays_entry.'{cursor}' + let todays_entry = todays_entry . '{cursor}' endif - " Now do the work - execute "normal! i".todays_entry + " Now do the work. + call append(0, split(todays_entry, '\n')) + + " Remove empty lines at end of file. if remove_empty - while getline('$') == '' - $delete - endwhile + $-/^\s*$/-1,$delete endif - 1 + " Reposition cursor once we're done. + call cursor(1, 1) endif call s:position_cursor() @@ -211,16 +215,18 @@ if &filetype == "changelog" command! -nargs=0 NewChangelogEntry call s:new_changelog_entry() endif - let b:undo_ftplugin = "setl com< tw< fo< et< ai<" + let b:undo_ftplugin = "setl com< fo< et< ai<" - if &textwidth == 0 - setlocal textwidth=78 - endif setlocal comments= setlocal formatoptions+=t setlocal noexpandtab setlocal autoindent + if &textwidth == 0 + setlocal textwidth=78 + let b:undo_ftplugin .= " tw<" + endif + let &cpo = s:cpo_save unlet s:cpo_save else @@ -228,23 +234,20 @@ else nmap o :call open_changelog() function! s:open_changelog() - if filereadable('ChangeLog') - if bufloaded('ChangeLog') - let buf = bufnr('ChangeLog') - execute "normal! \t" - while winbufnr(winnr()) != buf - execute "normal! \w" - endwhile - else - split ChangeLog - endif - - if exists("g:mapleader") - execute "normal " . g:mapleader . "o" + if !filereadable('ChangeLog') + return + endif + let buf = bufnr('ChangeLog') + if buf != -1 + if bufwinnr(buf) != -1 + execute buf . 'wincmd w' else - execute "normal \\o" + execute 'bsplit' buf endif - startinsert! + else + split ChangeLog endif + + call s:new_changelog_entry() endfunction endif diff --git a/runtime/ftplugin/conf.vim b/runtime/ftplugin/conf.vim index 6087c21928..8e0b7f8d21 100644 --- a/runtime/ftplugin/conf.vim +++ b/runtime/ftplugin/conf.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: generic configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-07-04 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:did_ftplugin") finish diff --git a/runtime/ftplugin/context.vim b/runtime/ftplugin/context.vim index 10be14cb0e..c74be07141 100644 --- a/runtime/ftplugin/context.vim +++ b/runtime/ftplugin/context.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: ConTeXt typesetting engine -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-07-04 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:did_ftplugin") finish @@ -13,7 +13,7 @@ set cpo&vim let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo<" -setlocal comments=:%,b:%D,b:%C,b:%M commentstring=%\ %s formatoptions+=tcroql +setlocal comments=b:%D,b:%C,b:%M,:% commentstring=%\ %s formatoptions+=tcroql let &l:define='\\\%([egx]\|char\|mathchar\|count\|dimen\|muskip\|skip\|toks\)\=' \ . 'def\|\\font\|\\\%(future\)\=let' diff --git a/runtime/ftplugin/crm.vim b/runtime/ftplugin/crm.vim index 71ae83f186..8ec42a90c2 100644 --- a/runtime/ftplugin/crm.vim +++ b/runtime/ftplugin/crm.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: CRM114 -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-07-04 +" Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:did_ftplugin") finish diff --git a/runtime/ftplugin/css.vim b/runtime/ftplugin/css.vim index d9d9005536..13a0f9ff46 100644 --- a/runtime/ftplugin/css.vim +++ b/runtime/ftplugin/css.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: CSS -" Maintainer: Nikolai Weibull -" Latest Revision: 2005-07-04 +" Maintainer: Ni