summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorvimboss <devnull@localhost>2008-06-24 21:56:24 +0000
committervimboss <devnull@localhost>2008-06-24 21:56:24 +0000
commit0fef5afcecafb08f0827115b5a0a1e1c41ca0321 (patch)
tree6c1fe56f2db8d4adbeee792b181b0659c4d1f216 /runtime
parente29aa5eaeb2537a6ea2e43a45fd4e7737935b354 (diff)
downloadvim-0fef5afcecafb08f0827115b5a0a1e1c41ca0321.tar.gz
updated for version 7.2a
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/netrw.vim7458
-rw-r--r--runtime/autoload/netrwSettings.vim38
-rw-r--r--runtime/autoload/xml/html40s.vim1
-rw-r--r--runtime/autoload/xml/html40t.vim1
-rw-r--r--runtime/autoload/xml/xhtml11.vim1
-rw-r--r--runtime/autoload/zip.vim31
-rw-r--r--runtime/compiler/eruby.vim2
-rw-r--r--runtime/compiler/gcc.vim4
-rw-r--r--runtime/doc/autocmd.txt28
-rw-r--r--runtime/doc/change.txt132
-rw-r--r--runtime/doc/debug.txt2
-rw-r--r--runtime/doc/diff.txt2
-rw-r--r--runtime/doc/eval.txt821
-rw-r--r--runtime/doc/fold.txt2
-rw-r--r--runtime/doc/gui_x11.txt4
-rw-r--r--runtime/doc/help.txt4
-rw-r--r--runtime/doc/if_cscop.txt2
-rw-r--r--runtime/doc/if_ruby.txt2
-rw-r--r--runtime/doc/if_sniff.txt2
-rw-r--r--runtime/doc/if_tcl.txt2
-rw-r--r--runtime/doc/mbyte.txt12
-rw-r--r--runtime/doc/motion.txt27
-rw-r--r--runtime/doc/options.txt116
-rw-r--r--runtime/doc/os_390.txt2
-rw-r--r--runtime/doc/os_mac.txt2
-rw-r--r--runtime/doc/os_msdos.txt2
-rw-r--r--runtime/doc/pi_netrw.txt2824
-rw-r--r--runtime/doc/pi_paren.txt9
-rw-r--r--runtime/doc/quotes.txt2
-rw-r--r--runtime/doc/recover.txt2
-rw-r--r--runtime/doc/rileft.txt2
-rw-r--r--runtime/doc/russian.txt2
-rw-r--r--runtime/doc/sign.txt2
-rw-r--r--runtime/doc/tags390
-rw-r--r--runtime/doc/term.txt13
-rw-r--r--runtime/doc/tips.txt2
-rw-r--r--runtime/doc/undo.txt2
-rw-r--r--runtime/doc/usr_10.txt2
-rw-r--r--runtime/doc/usr_21.txt2
-rw-r--r--runtime/doc/usr_24.txt2
-rw-r--r--runtime/doc/usr_25.txt2
-rw-r--r--runtime/doc/usr_26.txt2
-rw-r--r--runtime/doc/usr_29.txt6
-rw-r--r--runtime/doc/usr_31.txt2
-rw-r--r--runtime/doc/usr_32.txt2
-rw-r--r--runtime/doc/usr_toc.txt2
-rw-r--r--runtime/doc/version6.txt2
-rw-r--r--runtime/doc/vimtutor.man6
-rw-r--r--runtime/ftplugin/c.vim7
-rw-r--r--runtime/ftplugin/changelog.vim4
-rw-r--r--runtime/ftplugin/hostconf.vim18
-rw-r--r--runtime/ftplugin/lua.vim4
-rw-r--r--runtime/ftplugin/pdf.vim89
-rw-r--r--runtime/ftplugin/perl.vim6
-rw-r--r--runtime/ftplugin/reva.vim25
-rw-r--r--runtime/ftplugin/ruby.vim2
-rw-r--r--runtime/indent/cmake.vim8
-rw-r--r--runtime/indent/dtrace.vim17
-rw-r--r--runtime/indent/ruby.vim2
-rw-r--r--runtime/keymap/croatian_utf-8.vim68
-rw-r--r--runtime/lang/menu_eo.utf-8.vim457
-rw-r--r--runtime/lang/menu_eo_xx.utf-8.vim3
-rw-r--r--runtime/lang/menu_fi.utf-8.vim3
-rw-r--r--runtime/lang/menu_finnish_finland.1252.vim3
-rw-r--r--runtime/macros/matchit.txt32
-rw-r--r--runtime/syntax/2html.vim6
-rw-r--r--runtime/syntax/colortest.vim13
-rw-r--r--runtime/syntax/def.vim6
-rw-r--r--runtime/syntax/dtrace.vim150
-rw-r--r--runtime/syntax/erlang.vim355
-rw-r--r--runtime/syntax/eruby.vim2
-rw-r--r--runtime/syntax/esterel.vim38
-rw-r--r--runtime/syntax/fvwm.vim66
-rw-r--r--runtime/syntax/indent.vim4
-rw-r--r--runtime/syntax/java.vim7
-rw-r--r--runtime/syntax/man.vim4
-rw-r--r--runtime/syntax/mplayerconf.vim4
-rw-r--r--runtime/syntax/muttrc.vim201
-rw-r--r--runtime/syntax/po.vim30
-rw-r--r--runtime/syntax/readline.vim4
-rw-r--r--runtime/syntax/rhelp.vim5
-rw-r--r--runtime/syntax/sqlanywhere.vim1199
-rw-r--r--runtime/syntax/sudoers.vim4
-rw-r--r--runtime/syntax/tpp.vim6
-rw-r--r--runtime/syntax/verilogams.vim31
-rw-r--r--runtime/syntax/xbl.vim29
-rw-r--r--runtime/syntax/xpm.vim14
-rw-r--r--runtime/tutor/README.el.cp737.txt24
-rw-r--r--runtime/tutor/README.el.txt24
-rwxr-xr-xruntime/tutor/README.txt.infobin738 -> 582 bytes
-rw-r--r--runtime/tutor/README_amibin.txt12
-rw-r--r--runtime/tutor/README_extra.txt61
-rw-r--r--runtime/tutor/README_ole.txt20
-rwxr-xr-xruntime/tutor/runtime/doc.infobin0 -> 624 bytes
-rw-r--r--runtime/tutor/runtime/ftplugin.vim35
-rw-r--r--runtime/tutor/runtime/ftplugof.vim11
-rw-r--r--runtime/tutor/runtime/hi16-action-make.pngbin0 -> 454 bytes
-rw-r--r--runtime/tutor/runtime/menu.vim1105
-rw-r--r--runtime/tutor/runtime/rgb.txt753
-rwxr-xr-xruntime/tutor/runtime/tutor.infobin0 -> 624 bytes
-rw-r--r--runtime/tutor/runtime/vim16x16.gifbin0 -> 166 bytes
-rw-r--r--runtime/tutor/runtime/vim32x32.gifbin0 -> 298 bytes
-rw-r--r--runtime/tutor/tutor.no.utf-8973
-rw-r--r--runtime/tutor/tutor.vim75
104 files changed, 12992 insertions, 5007 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index b4753c27..6064a657 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1,22 +1,19 @@
" netrw.vim: Handles file transfer and remote directory listing across
" AUTOLOAD SECTION
-" Date: May 05, 2007
-" Version: 109
+" Date: Jun 12, 2008
+" Version: 125
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
-" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
+" Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided
-" *as is* and comes with no warranty of any kind, either
+" *as is* and come with no warranty of any kind, either
" expressed or implied. By using this plugin, you agree that
" in no event will the copyright holder be liable for any damages
" resulting from the use of this software.
-" of this software.
-" COMBAK: worked with tmpfile s:GetTempname() in NetRead() NetWrite()
-" !!NEEDS DEBUGGING && TESTING!!!
-"redraw!|call inputsave()|call input("Press <cr> to continue")|call inputrestore()
+"redraw!|call DechoSep()|call inputsave()|call input("Press <cr> to continue")|call inputrestore()
"
" But be doers of the Word, and not only hearers, deluding your own selves {{{1
" (James 1:22 RSV)
@@ -30,11 +27,20 @@ if !exists("s:NOTE")
let s:WARNING = 1
let s:ERROR = 2
endif
-let g:loaded_netrw = "v109"
+let g:loaded_netrw = "v125"
+
+" sanity checks
if v:version < 700
call netrw#ErrorMsg(s:WARNING,"you need vim version 7.0 or later for version ".g:loaded_netrw." of netrw",1)
finish
endif
+if !exists("*shellescape")
+ call netrw#ErrorMsg(s:ERROR,"you need to upgade your vim so that it has shellescape()",64)
+endif
+if !exists("*fnameescape")
+ call netrw#ErrorMsg(s:ERROR,"you need to upgade your vim so that it has fnameescape()",65)
+endif
+
let s:keepcpo= &cpo
setlocal cpo&vim
"DechoTabOn
@@ -115,6 +121,18 @@ endif
" ---------------------------------------------------------------------
" Default values for netrw's global variables {{{2
+" Cygwin Detection ------- {{{3
+if !exists("g:netrw_cygwin")
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$'
+ let g:netrw_cygwin= 1
+ else
+ let g:netrw_cygwin= 0
+ endif
+ else
+ let g:netrw_cygwin= 0
+ endif
+endif
" Default values - a-c ---------- {{{3
if !exists("g:netrw_alto")
let g:netrw_alto= &sb
@@ -128,26 +146,25 @@ endif
if !exists("g:netrw_chgwin")
let g:netrw_chgwin = -1
endif
-if !exists("g:netrw_cygwin")
- if has("win32") || has("win95") || has("win64") || has("win16")
- if &shell =~ '\%(\<bash\>\|\<zsh\>\)\%(\.exe\)\=$'
- let g:netrw_cygwin= 1
- else
- let g:netrw_cygwin= 0
- endif
- else
- let g:netrw_cygwin= 0
- endif
-else
- let g:netrw_cygwin= 0
+if !exists("g:netrw_compress")
+ let g:netrw_compress= "gzip"
+endif
+if !exists("g:netrw_ctags")
+ let g:netrw_ctags= "ctags"
endif
-" Default values - d-f ---------- {{{3
+" Default values - d-g ---------- {{{3
if !exists("g:NETRW_DIRHIST_CNT")
let g:NETRW_DIRHIST_CNT= 0
endif
+if !exists("g:netrw_decompress")
+ let g:netrw_decompress= { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , ".tar" : "tar -xf"}
+endif
if !exists("g:netrw_dirhistmax")
let g:netrw_dirhistmax= 10
endif
+if !exists("g:netrw_fastbrowse")
+ let g:netrw_fastbrowse= 1
+endif
if !exists("g:netrw_ftp_browse_reject")
let g:netrw_ftp_browse_reject='^total\s\+\d\+$\|^Trying\s\+\d\+.*$\|^KERBEROS_V\d rejected\|^Security extensions not\|No such file\|: connect to address [0-9a-fA-F:]*: No route to host$'
endif
@@ -198,9 +215,35 @@ if !exists("g:netrw_list_hide")
let g:netrw_list_hide= ""
endif
" Default values - lh-lz ---------- {{{3
+if !exists("g:netrw_localcopycmd")
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ if g:netrw_cygwin
+ let g:netrw_localcopycmd= "cp"
+ else
+ let g:netrw_localcopycmd= "copy"
+ endif
+ elseif has("unix") || has("macunix")
+ let g:netrw_localcopycmd= "cp"
+ else
+ let g:netrw_localcopycmd= ""
+ endif
+endif
if !exists("g:netrw_local_mkdir")
let g:netrw_local_mkdir= "mkdir"
endif
+if !exists("g:netrw_localmovecmd")
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ if g:netrw_cygwin
+ let g:netrw_localmovecmd= "mv"
+ else
+ let g:netrw_localmovecmd= "move"
+ endif
+ elseif has("unix") || has("macunix")
+ let g:netrw_localmovecmd= "mv"
+ else
+ let g:netrw_localmovecmd= ""
+ endif
+endif
if !exists("g:netrw_local_rmdir")
let g:netrw_local_rmdir= "rmdir"
endif
@@ -215,6 +258,9 @@ if g:netrw_liststyle == s:LONGLIST && g:netrw_scp_cmd !~ '^pscp'
let g:netrw_list_cmd= g:netrw_list_cmd." -l"
endif
" Default values - m-r ---------- {{{3
+if !exists("g:netrw_markfileesc")
+ let g:netrw_markfileesc= '*./[\~'
+endif
if !exists("g:netrw_maxfilenamelen")
let g:netrw_maxfilenamelen= 32
endif
@@ -224,6 +270,19 @@ endif
if !exists("g:netrw_mkdir_cmd")
let g:netrw_mkdir_cmd= g:netrw_ssh_cmd." USEPORT HOSTNAME mkdir"
endif
+if !exists("g:netrw_mousemaps")
+ if exists("&mouse") && &mouse =~ '[anh]'
+ let g:netrw_mousemaps= 1
+ else
+ let g:netrw_mousemaps= 0
+ endif
+endif
+if !exists("g:netrw_retmap")
+ let g:netrw_retmap= 0
+endif
+if !exists("g:netrw_preview")
+ let g:netrw_preview= 0
+endif
if !exists("g:netrw_scpport")
let g:netrw_scpport= "-P"
endif
@@ -243,27 +302,11 @@ if !exists("g:netrw_rmf_cmd")
let g:netrw_rmf_cmd = g:netrw_ssh_cmd." USEPORT HOSTNAME rm -f"
endif
" Default values - s ---------- {{{3
+ " set up shell quoting character
if exists("g:netrw_silent") && g:netrw_silent != 0
- let g:netrw_silentxfer= "silent "
+ let s:netrw_silentxfer= "silent "
else
- let g:netrw_silentxfer= ""
-endif
-if !exists("g:netrw_fastbrowse")
- let g:netrw_fastbrowse= 1
-endif
-if !exists("g:netrw_shq")
- if exists("&shq") && &shq != ""
- let g:netrw_shq= &shq
- elseif has("win32") || has("win95") || has("win64") || has("win16")
- if g:netrw_cygwin
- let g:netrw_shq= "'"
- else
- let g:netrw_shq= '"'
- endif
- else
- let g:netrw_shq= "'"
- endif
-" call Decho("g:netrw_shq<".g:netrw_shq.">")
+ let s:netrw_silentxfer= ""
endif
if !exists("g:netrw_sort_by")
" alternatives: date size
@@ -274,7 +317,10 @@ if !exists("g:netrw_sort_direction")
let g:netrw_sort_direction= "normal"
endif
if !exists("g:netrw_sort_sequence")
- let g:netrw_sort_sequence= '[\/]$,\.h$,\.c$,\.cpp$,\.[a-np-z]$,*,\.info$,\.swp$,\.o$\.obj$,\.bak$'
+ let g:netrw_sort_sequence= '[\/]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,\.swp$,\.bak$,\~$'
+endif
+if !exists("g:netrw_special_syntax")
+ let g:netrw_special_syntax= 0
endif
if !exists("g:netrw_ssh_browse_reject")
let g:netrw_ssh_browse_reject='^total\s\+\d\+$'
@@ -290,6 +336,9 @@ endif
if !exists("g:netrw_timefmt")
let g:netrw_timefmt= "%c"
endif
+if !exists("g:netrw_xstrlen")
+ let g:netrw_xstrlen= 1
+endif
if !exists("g:NetrwTopLvlMenu")
let g:NetrwTopLvlMenu= "Netrw."
endif
@@ -304,17 +353,14 @@ if !exists("g:netrw_winsize")
endif
" ---------------------------------------------------------------------
" Default values for netrw's script variables: {{{2
-if !exists("s:netrw_cd_escape")
- let s:netrw_cd_escape="[]#*$%'\" ?`!&();<>\\"
-endif
if !exists("g:netrw_fname_escape")
- let g:netrw_fname_escape= ' ?&;'
+ let g:netrw_fname_escape= ' ?&;%'
endif
-if !exists("g:netrw_tmpfile_escape")
- let g:netrw_tmpfile_escape= ' ?&;'
+if !exists("g:netrw_glob_escape")
+ let g:netrw_glob_escape= '[]*?`{~$'
endif
-if !exists("s:netrw_glob_escape")
- let s:netrw_glob_escape= '[]*?`{~$'
+if !exists("g:netrw_tmpfile_escape")
+ let g:netrw_tmpfile_escape= ' &;'
endif
" BufEnter event ignored by decho when following variable is true
@@ -327,184 +373,201 @@ endif
" ==============================
" ------------------------------------------------------------------------
-" NetSavePosn: saves position of cursor on screen {{{2
-fun! netrw#NetSavePosn()
-" call Dfunc("netrw#NetSavePosn()")
- " Save current line and column
- let w:netrw_winnr= winnr()
- let w:netrw_line = line(".")
- let w:netrw_col = virtcol(".")
-
- " Save top-of-screen line
- norm! H0
- let w:netrw_hline= line(".")
-
- call netrw#NetRestorePosn()
-" call Dret("netrw#NetSavePosn : winnr=".w:netrw_winnr." line=".w:netrw_line." col=".w:netrw_col." hline=".w:netrw_hline)
-endfun
-
-" ------------------------------------------------------------------------
-" NetRestorePosn: restores the cursor and file position as saved by NetSavePosn() {{{2
-fun! netrw#NetRestorePosn()
-" call Dfunc("netrw#NetRestorePosn() winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : -1)." line=".(exists("w:netrw_line")? w:netrw_line : -1)." col=".(exists("w:netrw_col")? w:netrw_col : -1)." hline=".(exists("w:netrw_hline")? w:netrw_hline : -1))
- let eikeep= &ei
- set ei=all
- if expand("%") == "NetrwMessage"
- exe s:winBeforeErr."wincmd w"
- endif
-
- " restore window
- if exists("w:netrw_winnr")
-" call Decho("restore window: exe silent! ".w:netrw_winnr."wincmd w")
- exe "silent! ".w:netrw_winnr."wincmd w"
- endif
- if v:shell_error == 0
- " as suggested by Bram M: redraw on no error
- " allows protocol error messages to remain visible
- redraw!
- endif
-
- " restore top-of-screen line
- if exists("w:netrw_hline")
-" call Decho("restore topofscreen: exe norm! ".w:netrw_hline."G0z")
- exe "norm! ".w:netrw_hline."G0z\<CR>"
- endif
-
- " restore position
- if exists("w:netrw_line") && exists("w:netrw_col")
-" call Decho("restore posn: exe norm! ".w:netrw_line."G0".w:netrw_col."|")
- exe "norm! ".w:netrw_line."G0".w:netrw_col."\<bar>"
- endif
-
- let &ei= eikeep
-" call Dret("netrw#NetRestorePosn")
-endfun
-
-" ===============================
-" NetOptionSave: save options and set to "standard" form {{{2
-"DechoTabOn
-fun! s:NetOptionSave()
-" call Dfunc("s:NetOptionSave() win#".winnr()." buf#".bufnr("."))
- if !exists("w:netrw_optionsave")
- let w:netrw_optionsave= 1
+" s:NetrwOptionSave: save options and set to "standard" form {{{2
+" 06/08/07 : removed call to NetrwSafeOptions(), either placed
+" immediately after NetrwOptionSave() calls in NetRead
+" and NetWrite, or after the s:NetrwEnew() call in
+" NetrwBrowse.
+" vt: normally its "w:" or "s:" (a variable type)
+fun! s:NetrwOptionSave(vt)
+" call Dfunc("s:NetrwOptionSave(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">")
+
+" call Decho(a:vt."netrw_optionsave".(exists("{a:vt}netrw_optionsave")? ("=".{a:vt}netrw_optionsave) : " doesn't exist"))
+ if !exists("{a:vt}netrw_optionsave")
+ let {a:vt}netrw_optionsave= 1
else
-" call Dret("s:NetOptionSave : netoptionsave=".w:netrw_optionsave)
+" call Dret("s:NetrwOptionSave : options already saved")
return
endif
+" call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist"))
" Save current settings and current directory
let s:yykeep = @@
if exists("&l:acd")
- let w:netrw_acdkeep = &l:acd
- endif
- let w:netrw_aikeep = &l:ai
- let w:netrw_awkeep = &l:aw
- let w:netrw_cikeep = &l:ci
- let w:netrw_cinkeep = &l:cin
- let w:netrw_cinokeep = &l:cino
- let w:netrw_comkeep = &l:com
- let w:netrw_cpokeep = &l:cpo
+ let {a:vt}netrw_acdkeep = &l:acd
+ endif
+ let {a:vt}netrw_aikeep = &l:ai
+ let {a:vt}netrw_awkeep = &l:aw
+ let {a:vt}netrw_cikeep = &l:ci
+ let {a:vt}netrw_cinkeep = &l:cin
+ let {a:vt}netrw_cinokeep = &l:cino
+ let {a:vt}netrw_comkeep = &l:com
+ let {a:vt}netrw_cpokeep = &l:cpo
if g:netrw_keepdir
- let w:netrw_dirkeep = getcwd()
- endif
- let w:netrw_fokeep = &l:fo " formatoptions
- let w:netrw_gdkeep = &l:gd " gdefault
- let w:netrw_hidkeep = &l:hidden
- let w:netrw_magickeep = &l:magic
- let w:netrw_repkeep = &l:report
- let w:netrw_spellkeep = &l:spell
- let w:netrw_twkeep = &l:tw " textwidth
- let w:netrw_wigkeep = &l:wig " wildignore
+ let {a:vt}netrw_dirkeep = getcwd()
+ endif
+ let {a:vt}netrw_fokeep = &l:fo " formatoptions
+ let {a:vt}netrw_gdkeep = &l:gd " gdefault
+ let {a:vt}netrw_hidkeep = &l:hidden
+ let {a:vt}netrw_magickeep = &l:magic
+ let {a:vt}netrw_repkeep = &l:report
+ let {a:vt}netrw_spellkeep = &l:spell
+ let {a:vt}netrw_twkeep = &l:tw " textwidth
+ let {a:vt}netrw_wigkeep = &l:wig " wildignore
if has("win32") && !has("win95")
- let w:netrw_swfkeep= &l:swf " swapfile
+ let {a:vt}netrw_swfkeep= &l:swf " swapfile
endif
- call s:NetrwSafeOptions()
- if &go =~ 'a' | silent! let w:netrw_regstar = @* | endif
- silent! let w:netrw_regslash= @/
+ if &go =~ 'a' | silent! let {a:vt}netrw_regstar = @* | endif
+ silent! let {a:vt}netrw_regslash= @/
-" call Dret("s:NetOptionSave")
-" call Dret("s:NetOptionSave : win#".winnr()." buf#".bufnr("."))
+" call Dret("s:NetrwOptionSave : win#".winnr()." buf#".bufnr("%"))
endfun
" ------------------------------------------------------------------------
-" NetOptionRestore: restore options {{{2
-fun! s:NetOptionRestore()
-" call Dfunc("s:NetOptionRestore() win#".winnr()." buf#".bufnr("."))
- if !exists("w:netrw_optionsave")
-" call Dret("s:NetOptionRestore : w:netrw_optionsave doesn't exist")
+" s:NetrwOptionRestore: restore options {{{2
+fun! s:NetrwOptionRestore(vt)
+" call Dfunc("s:NetrwOptionRestore(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%"))
+ if !exists("{a:vt}netrw_optionsave")
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
+" call Dret("s:NetrwOptionRestore : ".a:vt."netrw_optionsave doesn't exist")
return
endif
- unlet w:netrw_optionsave
+ unlet {a:vt}netrw_optionsave
if exists("&acd")
- if exists("w:netrw_acdkeep") |let &l:acd = w:netrw_acdkeep |unlet w:netrw_acdkeep |endif
- endif
- if exists("w:netrw_aikeep") |let &l:ai = w:netrw_aikeep |unlet w:netrw_aikeep |endif
- if exists("w:netrw_awkeep") |let &l:aw = w:netrw_awkeep |unlet w:netrw_awkeep |endif
- if exists("w:netrw_cikeep") |let &l:ci = w:netrw_cikeep |unlet w:netrw_cikeep |endif
- if exists("w:netrw_cinkeep") |let &l:cin = w:netrw_cinkeep |unlet w:netrw_cinkeep |endif
- if exists("w:netrw_cinokeep") |let &l:cino = w:netrw_cinokeep |unlet w:netrw_cinokeep |endif
- if exists("w:netrw_comkeep") |let &l:com = w:netrw_comkeep |unlet w:netrw_comkeep |endif
- if exists("w:netrw_cpokeep") |let &l:cpo = w:netrw_cpokeep |unlet w:netrw_cpokeep |endif
- if exists("w:netrw_dirkeep") |exe "lcd ".w:netrw_dirkeep |unlet w:netrw_dirkeep |endif
- if exists("w:netrw_fokeep") |let &l:fo = w:netrw_fokeep |unlet w:netrw_fokeep |endif
- if exists("w:netrw_gdkeep") |let &l:gd = w:netrw_gdkeep |unlet w:netrw_gdkeep |endif
- if exists("w:netrw_hidkeep") |let &l:hidden = w:netrw_hidkeep |unlet w:netrw_hidkeep |endif
- if exists("w:netrw_magic") |let &l:magic = w:netrw_magic |unlet w:netrw_magic |endif
- if exists("w:netrw_repkeep") |let &l:report = w:netrw_repkeep |unlet w:netrw_repkeep |endif
- if exists("w:netrw_spellkeep")|let &l:spell = w:netrw_spellkeep |unlet w:netrw_spellkeep|endif
- if exists("w:netrw_twkeep") |let &l:tw = w:netrw_twkeep |unlet w:netrw_twkeep |endif
- if exists("w:netrw_wigkeep") |let &l:wig = w:netrw_wigkeep |unlet w:netrw_wigkeep |endif
- if exists("s:yykeep") |let @@ = s:yykeep |unlet s:yykeep |endif
- if exists("w:netrw_swfkeep")
+ if exists("{a:vt}netrw_acdkeep")
+" call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd)
+ let curdir = getcwd()
+ let &l:acd = {a:vt}netrw_acdkeep
+ unlet {a:vt}netrw_acdkeep
+ if &l:acd
+" call Decho("exe keepjumps lcd ".fnameescape(curdir)) " NOTE: was g:netrw_fname_escape for some reason
+ try
+ if !exists("&l:acd") && !&l:acd
+ exe 'keepjumps lcd '.fnameescape(curdir)
+ endif
+ catch /^Vim\%((\a\+)\)\=:E472/
+ call netrw#ErrorMsg(s:ERROR,"unable to change directory to <".curdir."> (permissions?)",61)
+ endtry
+ endif
+ endif
+ endif
+ if exists("{a:vt}netrw_aikeep") |let &l:ai = {a:vt}netrw_aikeep |unlet {a:vt}netrw_aikeep |endif
+ if exists("{a:vt}netrw_awkeep") |let &l:aw = {a:vt}netrw_awkeep |unlet {a:vt}netrw_awkeep |endif
+ if exists("{a:vt}netrw_cikeep") |let &l:ci = {a:vt}netrw_cikeep |unlet {a:vt}netrw_cikeep |endif
+ if exists("{a:vt}netrw_cinkeep") |let &l:cin = {a:vt}netrw_cinkeep |unlet {a:vt}netrw_cinkeep |endif
+ if exists("{a:vt}netrw_cinokeep") |let &l:cino = {a:vt}netrw_cinokeep |unlet {a:vt}netrw_cinokeep |endif
+ if exists("{a:vt}netrw_comkeep") |let &l:com = {a:vt}netrw_comkeep |unlet {a:vt}netrw_comkeep |endif
+ if exists("{a:vt}netrw_cpokeep") |let &l:cpo = {a:vt}netrw_cpokeep |unlet {a:vt}netrw_cpokeep |endif
+ if exists("{a:vt}netrw_dirkeep") && isdirectory({a:vt}netrw_dirkeep) && g:netrw_keepdir
+ let dirkeep = substitute({a:vt}netrw_dirkeep,'\\','/','g')
+ if exists("{a:vt}netrw_dirkeep") |exe "keepjumps lcd ".fnameescape(dirkeep)|unlet {a:vt}netrw_dirkeep |endif
+ endif
+ if exists("{a:vt}netrw_fokeep") |let &l:fo = {a:vt}netrw_fokeep |unlet {a:vt}netrw_fokeep |endif
+ if exists("{a:vt}netrw_gdkeep") |let &l:gd = {a:vt}netrw_gdkeep |unlet {a:vt}netrw_gdkeep |endif
+ if exists("{a:vt}netrw_hidkeep") |let &l:hidden = {a:vt}netrw_hidkeep |unlet {a:vt}netrw_hidkeep |endif
+ if exists("{a:vt}netrw_magic") |let &l:magic = {a:vt}netrw_magic |unlet {a:vt}netrw_magic |endif
+ if exists("{a:vt}netrw_repkeep") |let &l:report = {a:vt}netrw_repkeep |unlet {a:vt}netrw_repkeep |endif
+ if exists("{a:vt}netrw_spellkeep")|let &l:spell = {a:vt}netrw_spellkeep |unlet {a:vt}netrw_spellkeep|endif
+ if exists("{a:vt}netrw_twkeep") |let &l:tw = {a:vt}netrw_twkeep |unlet {a:vt}netrw_twkeep |endif
+ if exists("{a:vt}netrw_wigkeep") |let &l:wig = {a:vt}netrw_wigkeep |unlet {a:vt}netrw_wigkeep |endif
+ if exists("s:yykeep") |let @@ = s:yykeep |unlet s:yykeep |endif
+ if exists("{a:vt}netrw_swfkeep")
if &directory == ""
" user hasn't specified a swapfile directory;
" netrw will temporarily set the swapfile directory
" to the current directory as returned by getcwd().
let &l:directory = getcwd()
- silent! let &l:swf = w:netrw_swfkeep
+ silent! let &l:swf = {a:vt}netrw_swfkeep
setlocal directory=
- unlet w:netrw_swfkeep
- elseif &l:swf != w:netrw_swfkeep
- " following line causes a Press ENTER in windows -- can't seem to work around it!!! (COMBAK)
- silent! let &l:swf= w:netrw_swfkeep
- unlet w:netrw_swfkeep
+ unlet {a:vt}netrw_swfkeep
+ elseif &l:swf != {a:vt}netrw_swfkeep
+ " following line causes a Press ENTER in windows -- can't seem to work around it!!!
+ silent! let &l:swf= {a:vt}netrw_swfkeep
+ unlet {a:vt}netrw_swfkeep
endif
endif
- if exists("w:netrw_regstar") |silent! let @*= w:netrw_regstar |unlet w:netrw_regstar |endif
- if exists("w:netrw_regslash")|silent! let @/= w:netrw_regslash|unlet w:netrw_regslash|endif
+ if exists("{a:vt}netrw_regstar") |silent! let @*= {a:vt}netrw_regstar |unlet {a:vt}netrw_regstar |endif
+ if exists("{a:vt}netrw_regslash")|silent! let @/= {a:vt}netrw_regslash|unlet {a:vt}netrw_regslash|endif
-" call Dret("s:NetOptionRestore : win#".winnr()." buf#".bufnr("."))
+" call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd)
+" call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist"))
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
+" call Dret("s:NetrwOptionRestore : win#".winnr()." buf#".bufnr("%"))
endfun
" ---------------------------------------------------------------------
-" NetrwSafeOptions: sets options to help netrw do its job {{{2
+" s:NetrwSafeOptions: sets options to help netrw do its job {{{2
fun! s:NetrwSafeOptions()
-" call Dfunc("s:NetrwSafeOptions()")
+" call Dfunc("s:NetrwSafeOptions() win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">")
+" call Decho("window's ft=".&ft)
setlocal cino=
setlocal com=
setlocal cpo-=aA
- if exists("&acd")
- setlocal noacd nocin noai noci magic nospell nohid wig= noaw
- setlocal fo=nroql2
- else
- setlocal nocin noai noci magic nospell nohid wig= noaw
- setlocal fo=nroql2
- endif
+ if exists("&acd") | setlocal noacd | endif
+ setlocal nocin noai noci magic nospell nohid wig= noaw
+ setlocal fo=nroql2
setlocal tw=0
setlocal report=10000
if g:netrw_use_noswf && has("win32") && !has("win95")
setlocal noswf
endif
+" call Decho("fo=".&fo.(exists("&acd")? " acd=".&acd : " acd doesn't exist"))
" call Dret("s:NetrwSafeOptions")
endfun
+" ---------------------------------------------------------------------
+" netrw#NetrwClean: remove netrw {{{2
+" supports :NetrwClean -- remove netrw from first directory on runtimepath
+" :NetrwClean! -- remove netrw from all directories on runtimepath
+fun! netrw#NetrwClean(sys)
+" call Dfunc("netrw#NetrwClean(sys=".a:sys.")")
+
+ if a:sys
+ let choice= confirm("Remove personal and system copies of netrw?","&Yes\n&No")
+ else
+ let choice= confirm("Remove personal copy of netrw?","&Yes\n&No")
+ endif
+" call Decho("choice=".choice)
+ let diddel= 0
+ let diddir= ""
+
+ if choice == 1
+ for dir in split(&rtp,',')
+ if filereadable(dir."/plugin/netrwPlugin.vim")
+" call Decho("removing netrw-related files from ".dir)
+ if s:System("delete",dir."/plugin/netrwPlugin.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/plugin/netrwPlugin.vim",55) |endif
+ if s:System("delete",dir."/autoload/netrwFileHandlers.vim")|call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwFileHandlers.vim",55)|endif
+ if s:System("delete",dir."/autoload/netrwSettings.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrwSettings.vim",55) |endif
+ if s:System("delete",dir."/autoload/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/autoload/netrw.vim",55) |endif
+ if s:System("delete",dir."/syntax/netrw.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrw.vim",55) |endif
+ if s:System("delete",dir."/syntax/netrwlist.vim") |call netrw#ErrorMsg(1,"unable to remove ".dir."/syntax/netrwlist.vim",55) |endif
+ let diddir= dir
+ let diddel= diddel + 1
+ if !a:sys|break|endif
+ endif
+ endfor
+ endif
+
+ echohl WarningMsg
+ if diddel == 0
+ echomsg "netrw is either not installed or not removable"
+ elseif diddel == 1
+ echomsg "removed one copy of netrw from <".diddir.">"
+ else
+ echomsg "removed ".diddel." copies of netrw"
+ endif
+ echohl None
+
+" call Dret("netrw#NetrwClean")
+endfun
+
" ------------------------------------------------------------------------
" Netrw Transfer Functions: {{{1
" ===============================
" ------------------------------------------------------------------------
-" NetRead: responsible for reading a file over the net {{{2
+" netrw#NetRead: responsible for reading a file over the net {{{2
" mode: =0 read remote file and insert before current line
" =1 read remote file and insert after current line
" =2 replace with remote file
@@ -513,7 +576,8 @@ fun! netrw#NetRead(mode,...)
" call Dfunc("netrw#NetRead(mode=".a:mode.",...) a:0=".a:0." ".g:loaded_netrw)
" save options {{{3
- call s:NetOptionSave()
+ call s:NetrwOptionSave("w:")
+ call s:NetrwSafeOptions()
" interpret mode into a readcmd {{{3
if a:mode == 0 " read remote file before current line
@@ -599,14 +663,14 @@ fun! netrw#NetRead(mode,...)
let ichoice= ichoice + 1
" Determine method of read (ftp, rcp, etc) {{{3
- call s:NetMethod(choice)
+ call s:NetrwMethod(choice)
let tmpfile= s:GetTempfile(b:netrw_fname) " apply correct suffix
- " Check if NetBrowse() should be handling this request
-" call Decho("checking if NetBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">")
+ " Check if NetrwBrowse() should be handling this request
+" call Decho("checking if NetrwBrowse() should handle choice<".choice."> with netrw_list_cmd<".g:netrw_list_cmd.">")
if choice =~ "^.*[\/]$" && b:netrw_method != 5 && choice !~ '^http://'
" call Decho("yes, choice matches '^.*[\/]$'")
- keepjumps call s:NetBrowse(0,choice)
+ keepjumps call s:NetrwBrowse(0,choice)
" call Dret("netrw#NetRead :3 getcwd<".getcwd().">")
return
endif
@@ -640,9 +704,9 @@ fun! netrw#NetRead(mode,...)
let uid_machine = g:netrw_machine
endif
endif
-" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile)
- exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile
- let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile)
+ exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(uid_machine.":".escape(b:netrw_fname,' ?&;')." ".tmpfile)
+ let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
@@ -650,22 +714,22 @@ fun! netrw#NetRead(mode,...)
elseif b:netrw_method == 2 " read with ftp + <.netrc>
" call Decho("read via ftp+.netrc (method #2)")
let netrw_fname= b:netrw_fname
- new
+ call s:SaveBufVars()|new|call s:RestoreBufVars()
setlocal ff=unix
exe "put ='".g:netrw_ftpmode."'"
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
if exists("g:netrw_ftpextracmd")
exe "put ='".g:netrw_ftpextracmd."'"
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
endif
exe "put ='".'get \"'.netrw_fname.'\" '.tmpfile."'"
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
if exists("g:netrw_port") && g:netrw_port != ""
" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
- exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
else
" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
- exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
endif
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
@@ -674,8 +738,8 @@ fun! netrw#NetRead(mode,...)
call netrw#ErrorMsg(s:ERROR,getline(1),4)
let &debug= debugkeep
endif
- bd!
- let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+ call s:SaveBufVars()|bd!|call s:RestoreBufVars()
+ let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
@@ -684,36 +748,36 @@ fun! netrw#NetRead(mode,...)
" Construct execution string (four lines) which will be passed through filter
" call Decho("read via ftp+mipf (method #3)")
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
- new
+ call s:SaveBufVars()|new|call s:RestoreBufVars()
setlocal ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
put ='open '.g:netrw_machine.' '.g:netrw_port
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
else
put ='open '.g:netrw_machine
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
endif
if exists("g:netrw_ftp") && g:netrw_ftp == 1
put =g:netrw_uid
-" call Decho("filter input: ".getline("."))
- put ='\"'.g:netrw_passwd.'\"'
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
+ put ='\"'.s:netrw_passwd.'\"'
+" call Decho("filter input: ".getline('.'))
else
- put ='user \"'.g:netrw_uid.'\" \"'.g:netrw_passwd.'\"'
-" call Decho("filter input: ".getline("."))
+ put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+" call Decho("filter input: ".getline('.'))
endif
if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
put =g:netrw_ftpmode
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
endif
if exists("g:netrw_ftpextracmd")
exe "put ='".g:netrw_ftpextracmd."'"
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
endif
put ='get \"'.netrw_fname.'\" '.tmpfile
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
" perform ftp:
" -i : turns off interactive prompting from ftp
@@ -721,7 +785,7 @@ fun! netrw#NetRead(mode,...)
" -n win32: quit being obnoxious about password
norm! 1Gdd
" call Decho("executing: %!".g:netrw_ftp_cmd." -i -n")
- exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$"
" call Decho("error<".getline(1).">")
@@ -729,8 +793,8 @@ fun! netrw#NetRead(mode,...)
call netrw#ErrorMsg(s:ERROR,getline(1),5)
endif
endif
- bd!
- let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+ call s:SaveBufVars()|bd!|call s:RestoreBufVars()
+ let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
@@ -742,9 +806,9 @@ fun! netrw#NetRead(mode,...)
else
let useport= ""
endif
-" call Decho("executing: !".g:netrw_scp_cmd.useport." '".g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape)."' ".tmpfile)
- exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_shq.g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape).g:netrw_shq." ".tmpfile
- let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+" call Decho("exe s:netrw_silentxfer.!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape))." ".tmpfile)
+ exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(g:netrw_machine.":".escape(b:netrw_fname,g:netrw_fname_escape))." ".tmpfile
+ let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
@@ -759,22 +823,24 @@ fun! netrw#NetRead(mode,...)
return
endif
+ let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
if match(b:netrw_fname,"#") == -1
" simple wget
- let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
-" call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_fname)
- exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_fname
- let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+" call Decho('using simple wget (# not in b:netrw_fname<'.b:netrw_fname.">)")
+" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_fname))
+ exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_fname)
+ let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
else
" wget plus a jump to an in-page marker (ie. http://abc/def.html#aMarker)
+" call Decho(("wget/curl plus jump (# in b:netrw_fname<".b:netrw_fname.">)")
let netrw_html= substitute(netrw_fname,"#.*$","","")
let netrw_tag = substitute(netrw_fname,"^.*#","","")
" call Decho("netrw_html<".netrw_html.">")
" call Decho("netrw_tag <".netrw_tag.">")
-" call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html)
- exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html
- let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_html))
+ exe s:netrw_silentxfer."!".g:netrw_http_cmd." ".shellescape(tmpfile)." ".shellescape("http://".g:netrw_machine.netrw_html)
+ let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
" call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/')
exe 'norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>"
endif
@@ -795,16 +861,16 @@ fun! netrw#NetRead(mode,...)
else
put ='open '.g:netrw_machine
endif
- put ='user '.g:netrw_uid.' '.g:netrw_passwd
+ put ='user '.g:netrw_uid.' '.s:netrw_passwd
put ='get '.netrw_fname.' '.tmpfile
put ='quit'
" perform cadaver operation:
norm! 1Gdd
" call Decho("executing: %!".g:netrw_dav_cmd)
- exe g:netrw_silentxfer."%!".g:netrw_dav_cmd
+ exe s:netrw_silentxfer."%!".g:netrw_dav_cmd
bd!
- let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+ let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
@@ -812,9 +878,9 @@ fun! netrw#NetRead(mode,...)
elseif b:netrw_method == 7
" call Decho("read via rsync (method #7)")
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
-" call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile)
- exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile
- let result = s:NetGetFile(readcmd,tmpfile, b:netrw_method)
+" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile)
+ exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile
+ let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
@@ -836,15 +902,15 @@ fun! netrw#NetRead(mode,...)
endif
" call Decho("read via fetch for ".netrw_option)
- if exists("g:netrw_uid") && g:netrw_uid != "" && exists("g:netrw_passwd") && g:netrw_passwd != ""
-" call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname)
- exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname
+ if exists("g:netrw_uid") && g:netrw_uid != "" && exists("s:netrw_passwd") && s:netrw_passwd != ""
+" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname))
+ exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_uid.':'.s:netrw_passwd.'@'.g:netrw_machine."/".netrw_fname)
else
-" call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".netrw_fname)
- exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".netrw_fname
+" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_machine."/".netrw_fname))
+ exe s:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".shellescape(netrw_option."://".g:netrw_machine."/".netrw_fname)
endif
- let result = s:NetGetFile(readcmd,tmpfile, b:netrw_method)
+ let result = s:NetrwGetFile(readcmd,tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
setlocal ro
@@ -853,9 +919,9 @@ fun! netrw#NetRead(mode,...)
elseif b:netrw_method == 9
" call Decho("read via sftp (method #9)")
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
-" call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile)
- exe g:netrw_silentxfer."!".g:netrw_sftp_cmd." ".g:netrw_machine.":".netrw_fname." ".tmpfile
- let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile)
+ exe s:netrw_silentxfer."!".g:netrw_sftp_cmd." ".shellescape(g:netrw_machine.":".netrw_fname)." ".tmpfile
+ let result = s:NetrwGetFile(readcmd, tmpfile, b:netrw_method)
let b:netrw_lastfile = choice
".........................................
@@ -873,21 +939,22 @@ fun! netrw#NetRead(mode,...)
endif
if s:FileReadable(tmpfile) && tmpfile !~ '.tar.bz2$' && tmpfile !~ '.tar.gz$' && tmpfile !~ '.zip' && tmpfile !~ '.tar' && readcmd != 't'
" call Decho("cleanup by deleting tmpfile<".tmpfile.">")
- call s:System("delete",tmpfile)
+ call s:System("delete",fnameescape(tmpfile))
endif
- call s:NetOptionRestore()
+ call s:NetrwOptionRestore("w:")
" call Dret("netrw#NetRead :5 getcwd<".getcwd().">")
endfun
" ------------------------------------------------------------------------
-" NetWrite: responsible for writing a file over the net {{{2
+" netrw#NetWrite: responsible for writing a file over the net {{{2
fun! netrw#NetWrite(...) range
" call Dfunc("netrw#NetWrite(a:0=".a:0.") ".g:loaded_netrw)
" option handling
let mod= 0
- call s:NetOptionSave()
+ call s:NetrwOptionSave("w:")
+ call s:NetrwSafeOptions()
" Get Temporary Filename {{{3
let tmpfile= s:GetTempfile("")
@@ -985,13 +1052,14 @@ fun! netrw#NetWrite(...) range
" call Decho("choice<" . choice . "> ichoice=".ichoice)
" Determine method of write (ftp, rcp, etc) {{{4
- call s:NetMethod(choice)
+ call s:NetrwMethod(choice)
" =============
" Perform Protocol-Based Write {{{4
" ============================
if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1
echo "(netrw) Processing your write request..."
+" call Decho("(netrw) Processing your write request...")
endif
".........................................
@@ -1012,8 +1080,8 @@ fun! netrw#NetWrite(...) range
endif
endif
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
-" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".g:netrw_shq.tmpfile.g:netrw_shq." ".uid_machine.":".netrw_fname)
- exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".g:netrw_shq.tmpfile.g:netrw_shq." ".uid_machine.":".netrw_fname
+" call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile)." ".shellescape(uid_machine.":".netrw_fname))
+ exe s:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".shellescape(tmpfile)." ".shellescape(uid_machine.":".netrw_fname)
let b:netrw_lastfile = choice
".........................................
@@ -1022,21 +1090,23 @@ fun! netrw#NetWrite(...) range
" call Decho("write via ftp+.netrc (method #2)")
let netrw_fname= b:netrw_fname
new
+" call Decho("filter input window#".winnr())
setlocal ff=unix
exe "put ='".g:netrw_ftpmode."'"
-" call Decho(" filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
if exists("g:netrw_ftpextracmd")
exe "put ='".g:netrw_ftpextracmd."'"
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
endif
exe "put ='".'put \"'.tmpfile.'\" \"'.netrw_fname.'\"'."'"
-" call Decho(" filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
if exists("g:netrw_port") && g:netrw_port != ""
" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
- exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
else
+" call Decho("filter input window#".winnr())
" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
- exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
endif
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$"
@@ -1058,22 +1128,22 @@ fun! netrw#NetWrite(...) range
setlocal ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
put ='open '.g:netrw_machine.' '.g:netrw_port
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
else
put ='open '.g:netrw_machine
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
endif
if exists("g:netrw_ftp") && g:netrw_ftp == 1
put =g:netrw_uid
-" call Decho("filter input: ".getline("."))
- put ='\"'.g:netrw_passwd.'\"'
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
+ put ='\"'.s:netrw_passwd.'\"'
+" call Decho("filter input: ".getline('.'))
else
- put ='user \"'.g:netrw_uid.'\" \"'.g:netrw_passwd.'\"'
-" call Decho("filter input: ".getline("."))
+ put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+" call Decho("filter input: ".getline('.'))
endif
put ='put \"'.tmpfile.'\" \"'.netrw_fname.'\"'
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
" save choice/id/password for future use
let b:netrw_lastfile = choice
@@ -1083,7 +1153,7 @@ fun! netrw#NetWrite(...) range
" -n win32: quit being obnoxious about password
norm! 1Gdd
" call Decho("executing: %!".g:netrw_ftp_cmd." -i -n")
- exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
" If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
if getline(1) !~ "^$"
if !exists("g:netrw_quiet")
@@ -1103,8 +1173,8 @@ fun! netrw#NetWrite(...) range
else
let useport= ""
endif
-" call Decho("exe ".g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_shq.tmpfile.g:netrw_shq." ".g:netrw_shq.g:netrw_machine.":".netrw_fname.g:netrw_shq)
- exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_shq.tmpfile.g:netrw_shq." ".g:netrw_shq.g:netrw_machine.":".netrw_fname.g:netrw_shq
+" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile)." ".shellescape(g:netrw_machine.":".netrw_fname))
+ exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".shellescape(tmpfile)." ".shellescape(g:netrw_machine.":".netrw_fname)
let b:netrw_lastfile = choice
".........................................
@@ -1129,13 +1199,15 @@ fun! netrw#NetWrite(...) range
else
put ='open '.g:netrw_machine
endif
- put ='user '.g:netrw_uid.' '.g:netrw_passwd
+ if exists("g:netrw_uid") && exists("s:netrw_passwd")
+ put ='user '.g:netrw_uid.' '.s:netrw_passwd
+ endif
put ='put '.tmpfile.' '.netrw_fname
" perform cadaver operation:
norm! 1Gdd
" call Decho("executing: %!".g:netrw_dav_cmd)
- exe g:netrw_silentxfer."%!".g:netrw_dav_cmd
+ exe s:netrw_silentxfer."%!".g:netrw_dav_cmd
bd!
let b:netrw_lastfile = choice
@@ -1145,7 +1217,7 @@ fun! netrw#NetWrite(...) range
" call Decho("write via rsync (method #7)")
let netrw_fname= escape(b:netrw_fname,g:netrw_fname_escape)
" call Decho("executing: !".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".netrw_fname)
- exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".netrw_fname
+ exe s:netrw_silentxfer."!".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".netrw_fname
let b:netrw_lastfile = choice
".........................................
@@ -1161,10 +1233,10 @@ fun! netrw#NetWrite(...) range
new
setlocal ff=unix
put ='put \"'.escape(tmpfile,'\').'\" '.netrw_fname
-" call Decho("filter input: ".getline("."))
+" call Decho("filter input: ".getline('.'))
norm! 1Gdd
" call Decho("executing: %!".g:netrw_sftp_cmd.' '.uid_machine)
- exe g:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.uid_machine
+ exe s:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.uid_machine
bd!
let b:netrw_lastfile= choice
@@ -1181,7 +1253,7 @@ fun! netrw#NetWrite(...) range
" call Decho("tmpfile<".tmpfile."> readable, will now delete it")
call s:System("delete",tmpfile)
endif
- call s:NetOptionRestore()
+ call s:NetrwOptionRestore("w:")
if a:firstline == 1 && a:lastline == line("$")
" restore modifiability; usually equivalent to set nomod
@@ -1192,7 +1264,7 @@ fun! netrw#NetWrite(...) range
endfun
" ---------------------------------------------------------------------
-" NetSource: source a remotely hosted vim script {{{2
+" netrw#NetSource: source a remotely hosted vim script {{{2
" uses NetRead to get a copy of the file into a temporarily file,
" then sources that file,
" then removes that file.
@@ -1230,17 +1302,18 @@ fun! netrw#NetSource(...)
endfun
" ===========================================
-" NetGetFile: Function to read temporary file "tfile" with command "readcmd". {{{2
+" s:NetrwGetFile: Function to read temporary file "tfile" with command "readcmd". {{{2
" readcmd == %r : replace buffer with newly read file
" == 0r : read file at top of buffer
" == r : read file after current line
" == t : leave file in temporary form (ie. don't read into buffer)
-fun! s:NetGetFile(readcmd, tfile, method)
-" call Dfunc("NetGetFile(readcmd<".a:readcmd.">,tfile<".a:tfile."> method<".a:method.">)")
+fun! s:NetrwGetFile(readcmd, tfile, method)
+" call Dfunc("NetrwGetFile(readcmd<".a:readcmd.">,tfile<".a:tfile."> method<".a:method.">)")
" readcmd=='t': simply do nothing
if a:readcmd == 't'
-" call Dret("NetGetFile : skip read of <".a:tfile.">")
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
+" call Dret("NetrwGetFile : skip read of <".a:tfile.">")
return
endif
@@ -1263,8 +1336,8 @@ fun! s:NetGetFile(readcmd, tfile, method)
else
let tfile= a:tfile
endif
-" call Decho("keepalt exe file ".tfile)
- keepalt exe "silent! keepalt file ".tfile
+" " call Decho("exe silent! keepalt file ".tfile)
+ exe "silent! keepalt file ".tfile
" edit temporary file (ie. read the temporary file in)
if rfile =~ '\.zip$'
@@ -1285,8 +1358,13 @@ fun! s:NetGetFile(readcmd, tfile, method)
endif
" rename buffer back to remote filename
+" call Decho("exe silent! keepalt file ".escape(rfile,' '))
exe "silent! keepalt file ".escape(rfile,' ')
- filetype detect
+ if a:method == 5
+ set ft=html
+ else
+ filetype detect
+ endif
" call Dredir("renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">","ls!")
let line1 = 1
let line2 = line("$")
@@ -1303,9 +1381,10 @@ fun! s:NetGetFile(readcmd, tfile, method)
else
" not readable
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
" call Decho("tfile<".a:tfile."> not readable")
call netrw#ErrorMsg(s:WARNING,"file <".a:tfile."> not readable",9)
-" call Dret("NetGetFile : tfile<".a:tfile."> not readable")
+" call Dret("NetrwGetFile : tfile<".a:tfile."> not readable")
return
endif
@@ -1317,20 +1396,22 @@ fun! s:NetGetFile(readcmd, tfile, method)
" call Decho("NetReadFixup() not called, doesn't exist (line1=".line1." line2=".line2.")")
endif
- " update the Buffers menu
- if has("gui") && has("gui_running")
- silent! emenu Buffers.Refresh\ menu
+ if has("gui") && has("menu") && has("gui_running") && &go =~ 'm'
+ " update the Buffers menu
+ call s:UpdateBuffersMenu()
endif
" call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> tfile<".a:tfile."> readable=".s:FileReadable(a:tfile))
" make sure file is being displayed
- redraw!
-" call Dret("NetGetFile")
+" redraw!
+
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
+" call Dret("NetrwGetFile")
endfun
" ------------------------------------------------------------------------
-" NetMethod: determine method of transfer {{{2
+" s:NetrwMethod: determine method of transfer {{{2
" method == 1: rcp
" 2: ftp + <.netrc>
" 3: ftp + machine, id, password, and [path]filename
@@ -1340,8 +1421,8 @@ endfun
" 7: rsync
" 8: fetch
" 9: sftp
-fun! s:NetMethod(choice) " globals: method machine id passwd fname
-" call Dfunc("NetMethod(a:choice<".a:choice.">)")
+fun! s:NetrwMethod(choice) " globals: method machine id passwd fname
+" call Dfunc("NetrwMethod(a:choice<".a:choice.">)")
" initialization
let b:netrw_method = 0
@@ -1352,13 +1433,13 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
" Patterns:
" mipf : a:machine a:id password filename Use ftp
- " mf : a:machine filename Use ftp + <.netrc> or g:netrw_uid g:netrw_passwd
- " ftpurm : ftp://[user@]host[[#:]port]/filename Use ftp + <.netrc> or g:netrw_uid g:netrw_passwd
+ " mf : a:machine filename Use ftp + <.netrc> or g:netrw_uid s:netrw_passwd
+ " ftpurm : ftp://[user@]host[[#:]port]/filename Use ftp + <.netrc> or g:netrw_uid s:netrw_passwd
" rcpurm : rcp://[user@]host/filename Use rcp
" rcphf : [user@]host:filename Use rcp
" scpurm : scp://[user@]host[[#:]port]/filename Use scp
" httpurm : http://[user@]host/filename Use wget
- " davurm : [s]dav://host[:port]/path Use cadaver
+ " davurm : dav[s]://host[:port]/path Use cadaver
" rsyncurm : rsync://host[:port]/path Use rsync
" fetchurm : fetch://[user@]host[:http]/filename Use fetch (defaults to ftp, override for http)
" sftpurm : sftp://[user@]host/filename Use scp
@@ -1369,7 +1450,7 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
let rcphf = '^\(\(\h\w*\)@\)\=\(\h\w*\):\([^@]\+\)$'
let scpurm = '^scp://\([^/#:]\+\)\%([#:]\(\d\+\)\)\=/\(.*\)$'
let httpurm = '^http://\([^/]\{-}\)\(/.*\)\=$'
- let davurm = '^s\=dav://\([^/]\+\)/\(.*/\)\([-_.~[:alnum:]]\+\)$'
+ let davurm = '^davs\=://\([^/]\+\)/\(.*/\)\([-_.~[:alnum:]]\+\)$'
let rsyncurm = '^rsync://\([^/]\{-}\)/\(.*\)\=$'
let fetchurm = '^fetch://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\(:http\)\=/\(.*\)$'
let sftpurm = '^sftp://\([^/]\{-}\)/\(.*\)\=$'
@@ -1430,7 +1511,7 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
if userid != ""
let g:netrw_uid= userid
endif
- if exists("g:netrw_uid") && exists("g:netrw_passwd")
+ if exists("g:netrw_uid") && exists("s:netrw_passwd")
let b:netrw_method = 3
else
if s:FileReadable(expand("$HOME/.netrc")) && !g:netrw_ignorenetrc
@@ -1438,9 +1519,9 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
else
if !exists("g:netrw_uid") || g:netrw_uid == ""
call NetUserPass()
- elseif !exists("g:netrw_passwd") || g:netrw_passwd == ""
+ elseif !exists("s:netrw_passwd") || s:netrw_passwd == ""
call NetUserPass(g:netrw_uid)
- " else just use current g:netrw_uid and g:netrw_passwd
+ " else just use current g:netrw_uid and s:netrw_passwd
endif
let b:netrw_method= 3
endif
@@ -1460,13 +1541,13 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
let b:netrw_method = 3
let g:netrw_machine = substitute(a:choice,mipf,'\1',"")
let g:netrw_uid = substitute(a:choice,mipf,'\2',"")
- let g:netrw_passwd = substitute(a:choice,mipf,'\3',"")
+ let s:netrw_passwd = substitute(a:choice,mipf,'\3',"")
let b:netrw_fname = substitute(a:choice,mipf,'\4',"")
" Issue an ftp: "hostname [path/]filename"
elseif match(a:choice,mf) == 0
" call Decho("(ftp) host file")
- if exists("g:netrw_uid") && exists("g:netrw_passwd")
+ if exists("g:netrw_uid") && exists("s:netrw_passwd")
let b:netrw_method = 3
let g:netrw_machine = substitute(a:choice,mf,'\1',"")
let b:netrw_fname = substitute(a:choice,mf,'\2',"")
@@ -1487,10 +1568,10 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
" Issue an rcp: hostname:filename" (this one should be last)
elseif match(a:choice,rcphf) == 0
" call Decho("(rcp) [user@]host:file) rcphf<".rcphf.">")
- let b:netrw_method = 1
- let userid = substitute(a:choice,rcphf,'\2',"")
- let g:netrw_machine= substitute(a:choice,rcphf,'\3',"")
- let b:netrw_fname = substitute(a:choice,rcphf,'\4',"")
+ let b:netrw_method = 1
+ let userid = substitute(a:choice,rcphf,'\2',"")
+ let g:netrw_machine = substitute(a:choice,rcphf,'\3',"")
+ let b:netrw_fname = substitute(a:choice,rcphf,'\4',"")
" call Decho('\1<'.substitute(a:choice,rcphf,'\1',"").">")
" call Decho('\2<'.substitute(a:choice,rcphf,'\2',"").">")
" call Decho('\3<'.substitute(a:choice,rcphf,'\3',"").">")
@@ -1518,11 +1599,11 @@ fun! s:NetMethod(choice) " globals: method machine id passwd fname
" if exists("g:netrw_uid") "Decho
" call Decho("g:netrw_uid <".g:netrw_uid.">")
" endif "Decho
-" if exists("g:netrw_passwd") "Decho
-" call Decho("g:netrw_passwd <".g:netrw_passwd.">")
+" if exists("s:netrw_passwd") "Decho
+" call Decho("s:netrw_passwd <".s:netrw_passwd.">")
" endif "Decho
" call Decho("b:netrw_fname <".b:netrw_fname.">")
-" call Dret("NetMethod : b:netrw_method=".b:netrw_method)
+" call Dret("NetrwMethod : b:netrw_method=".b:netrw_method)
endfun
" ------------------------------------------------------------------------
@@ -1565,10 +1646,10 @@ fun! NetUserPass(...)
" get password
if a:0 <= 1 " via prompt
" call Decho("a:0=".a:0." case <=1:")
- let g:netrw_passwd= inputsecret("Enter Password: ")
+ let s:netrw_passwd= inputsecret("Enter Password: ")
else " from command line
" call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
- let g:netrw_passwd=a:2
+ let s:netrw_passwd=a:2
endif
" call Dret("NetUserPass")
@@ -1583,110 +1664,378 @@ endfun
fun! s:BrowserMaps(islocal)
" call Dfunc("s:BrowserMaps(islocal=".a:islocal.") b:netrw_curdir<".b:netrw_curdir.">")
if a:islocal
- nnoremap <buffer> <silent> <cr> :call netrw#LocalBrowseCheck(<SID>NetBrowseChgDir(1,<SID>NetGetWord()))<cr>
- nnoremap <buffer> <silent> <leftmouse> <leftmouse>:call netrw#LocalBrowseCheck(<SID>NetBrowseChgDir(1,<SID>NetGetWord()))<cr>
- nnoremap <buffer> <silent> <c-l> :call <SID>NetRefresh(1,<SID>NetBrowseChgDir(1,'./'))<cr>
- nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call netrw#LocalBrowseCheck(<SID>NetBrowseChgDir(1,'../'))<cr>
- nnoremap <buffer> <silent> a :call <SID>NetHide(1)<cr>
- nnoremap <buffer> <silent> mb :<c-u>call <SID>NetBookmarkDir(0,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> gb :<c-u>call <SID>NetBookmarkDir(1,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> c :exe "cd ".b:netrw_curdir<cr>
+ nnoremap <buffer> <silent> <cr> :call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord()))<cr>
+ nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call netrw#LocalBrowseCheck(<SID>NetrwBrowseChgDir(1,'../'))<cr>
+ nnoremap <buffer> <silent> a :call <SID>NetrwHide(1)<cr>
+ nnoremap <buffer> <silent> mb :<c-u>call <SID>NetrwBookmarkDir(0,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> mc :<c-u>call <SID>NetrwMarkFileCopy(1)<cr>
+ nnoremap <buffer> <silent> md :<c-u>call <SID>NetrwMarkFileDiff(1)<cr>
+ nnoremap <buffer> <silent> me :<c-u>call <SID>NetrwMarkFileEdit(1)<cr>
+ nnoremap <buffer> <silent> mf :<c-u>call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> mg :<c-u>call <SID>NetrwMarkFileGrep(1)<cr>
+ nnoremap <buffer> <silent> mh :<c-u>call <SID>NetrwMarkHideSfx(1)<cr>
+ nnoremap <buffer> <silent> mm :<c-u>call <SID>NetrwMarkFileMove(1)<cr>
+ nnoremap <buffer> <silent> mp :<c-u>call <SID>NetrwMarkFilePrint(1)<cr>
+ nnoremap <buffer> <silent> mr :<c-u>call <SID>NetrwMarkFileRegexp(1)<cr>
+ nnoremap <buffer> <silent> ms :<c-u>call <SID>NetrwMarkFileSource(1)<cr>
+ nnoremap <buffer> <silent> mT :<c-u>call <SID>NetrwMarkFileTag(1)<cr>
+ nnoremap <buffer> <silent> mt :<c-u>call <SID>NetrwMarkFileTgt(1)<cr>
+ nnoremap <buffer> <silent> mu :<c-u>call <SID>NetrwUnMarkFile(1)<cr>
+ nnoremap <buffer> <silent> mx :<c-u>call <SID>NetrwMarkFileExe(1)<cr>
+ nnoremap <buffer> <silent> mz :<c-u>call <SID>NetrwMarkFileCompress(1)<cr>
+ nnoremap <buffer> <silent> gb :<c-u>call <SID>NetrwBookmarkDir(1,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> gh :<c-u>call <SID>NetrwHidden(1)<cr>
+ nnoremap <buffer> <silent> c :exe "keepjumps lcd ".fnameescape(b:netrw_curdir)<cr>
nnoremap <buffer> <silent> C :let g:netrw_chgwin= winnr()<cr>
- nnoremap <buffer> <silent> d :call <SID>NetMakeDir("")<cr>
- nnoremap <buffer> <silent> <c-h> :call <SID>NetHideEdit(1)<cr>
- nnoremap <buffer> <silent> i :call <SID>NetListStyle(1)<cr>
- nnoremap <buffer> <silent> o :call <SID>NetSplit(3)<cr>
- nnoremap <buffer> <silent> O :call <SID>LocalObtain()<cr>
- nnoremap <buffer> <silent> p :call <SID>NetPreview(<SID>NetBrowseChgDir(1,<SID>NetGetWord(),1))<cr>
- nnoremap <buffer> <silent> P :call <SID>NetPrevWinOpen(1)<cr>
- nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetRefresh(1,<SID>NetBrowseChgDir(1,'./'))<cr>
- nnoremap <buffer> <silent> s :call <SID>NetSortStyle(1)<cr>
+ nnoremap <buffer> <silent> d :call <SID>NetrwMakeDir("")<cr>
+ nnoremap <buffer> <silent> i :call <SID>NetrwListStyle(1)<cr>
+ nnoremap <buffer> <silent> o :call <SID>NetrwSplit(3)<cr>
+ nnoremap <buffer> <silent> O :call <SID>NetrwObtain(1)<cr>
+ nnoremap <buffer> <silent> p :call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
+ nnoremap <buffer> <silent> P :call <SID>NetrwPrevWinOpen(1)<cr>
+ nnoremap <buffer> <silent> qb :<c-u>call <SID>NetrwBookmarkDir(2,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> mB :<c-u>call <SID>NetrwBookmarkDir(6,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> qf :<c-u>call <SID>NetrwFileInfo(1,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
+ nnoremap <buffer> <silent> s :call <SID>NetrwSortStyle(1)<cr>
nnoremap <buffer> <silent> S :call <SID>NetSortSequence(1)<cr>
- nnoremap <buffer> <silent> t :call <SID>NetSplit(4)<cr>
- nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,expand("%"))<cr>
- nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,expand("%"))<cr>
- nnoremap <buffer> <silent> v :call <SID>NetSplit(5)<cr>
- nnoremap <buffer> <silent> x :call netrw#NetBrowseX(<SID>NetBrowseChgDir(1,<SID>NetGetWord(),0),0)"<cr>
+ nnoremap <buffer> <silent> t :call <SID>NetrwSplit(4)<cr>
+ nnoremap <buffer> <silent> u :<c-u>call <SID>NetrwBookmarkDir(4,expand("%"))<cr>
+ nnoremap <buffer> <silent> U :<c-u>call <SID>NetrwBookmarkDir(5,expand("%"))<cr>
+ nnoremap <buffer> <silent> v :call <SID>NetrwSplit(5)<cr>
+ nnoremap <buffer> <silent> x :call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),0),0)"<cr>
+ if !hasmapto('<Plug>NetrwHideEdit')
+ nmap <buffer> <unique> <c-h> <Plug>NetrwHideEdit
+ endif
+ nnoremap <buffer> <silent> <Plug>NetrwHideEdit :call <SID>NetrwHideEdit(1)<cr>
+ if !hasmapto('<Plug>NetrwRefresh')
+ nmap <buffer> <unique> <c-l> <Plug>NetrwRefresh
+ endif
+ nnoremap <buffer> <silent> <Plug>NetrwRefresh :call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,'./'))<cr>
if s:didstarstar || !mapcheck("<s-down>","n")
nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
endif
if s:didstarstar || !mapcheck("<s-up>","n")
nnoremap <buffer> <silent> <s-up> :Pexplore<cr>
endif
- exe 'nnoremap <buffer> <silent> <del> :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
- exe 'vnoremap <buffer> <silent> <del> :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
- exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
- exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
- exe 'nnoremap <buffer> <silent> D :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
- exe 'vnoremap <buffer> <silent> D :call <SID>LocalBrowseRm("'.b:netrw_curdir.'")<cr>'
- exe 'nnoremap <buffer> <silent> R :call <SID>LocalBrowseRename("'.b:netrw_curdir.'")<cr>'
- exe 'vnoremap <buffer> <silent> R :call <SID>LocalBrowseRename("'.b:netrw_curdir.'")<cr>'
- exe 'nnoremap <buffer> <silent> <Leader>m :call <SID>NetMakeDir("")<cr>'
- nnoremap <buffer> <F1> :he netrw-dir<cr>
+ if g:netrw_mousemaps == 1
+ nnoremap <buffer> <silent> <leftmouse> <leftmouse>:call <SID>NetrwLeftmouse(1)<cr>
+ nnoremap <buffer> <silent> <middlemouse> <leftmouse>:call <SID>NetrwPrevWinOpen(1)<cr>
+ nnoremap <buffer> <silent> <s-leftmouse> <leftmouse>:call <SID>NetrwMarkFile(1,<SID>NetrwGetWord())<cr>
+ exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
+ exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
+ endif
+ exe 'nnoremap <buffer> <silent> <del> :call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
+ exe 'vnoremap <buffer> <silent> <del> :call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
+ exe 'nnoremap <buffer> <silent> D :call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
+ exe 'vnoremap <buffer> <silent> D :call <SID>NetrwLocalRm("'.b:netrw_curdir.'")<cr>'
+ exe 'nnoremap <buffer> <silent> R :call <SID>NetrwLocalRename("'.b:netrw_curdir.'")<cr>'
+ exe 'vnoremap <buffer> <silent> R :call <SID>NetrwLocalRename("'.b:netrw_curdir.'")<cr>'
+ exe 'nnoremap <buffer> <silent> <Leader>m :call <SID>NetrwMakeDir("")<cr>'
+ nnoremap <buffer> <F1> :he netrw-quickhelp<cr>
else " remote
call s:RemotePathAnalysis(b:netrw_curdir)
- nnoremap <buffer> <silent> <cr> :call <SID>NetBrowse(0,<SID>NetBrowseChgDir(0,<SID>NetGetWord()))<cr>
- nnoremap <buffer> <silent> <leftmouse> <leftmouse>:call <SID>NetBrowse(0,<SID>NetBrowseChgDir(0,<SID>NetGetWord()))<cr>
- nnoremap <buffer> <silent> <c-l> :call <SID>NetRefresh(0,<SID>NetBrowseChgDir(0,'./'))<cr>
- nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call <SID>NetBrowse(0,<SID>NetBrowseChgDir(0,'../'))<cr>
- nnoremap <buffer> <silent> a :call <SID>NetHide(0)<cr>
- nnoremap <buffer> <silent> mb :<c-u>call <SID>NetBookmarkDir(0,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> gb :<c-u>call <SID>NetBookmarkDir(1,b:netrw_cur)<cr>
+ nnoremap <buffer> <silent> <cr> :call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()))<cr>
+ nnoremap <buffer> <silent> <c-l> :call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+ nnoremap <buffer> <silent> - :exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'../'))<cr>
+ nnoremap <buffer> <silent> a :call <SID>NetrwHide(0)<cr>
+ nnoremap <buffer> <silent> mb :<c-u>call <SID>NetrwBookmarkDir(0,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> mc :<c-u>call <SID>NetrwMarkFileCopy(0)<cr>
+ nnoremap <buffer> <silent> md :<c-u>call <SID>NetrwMarkFileDiff(0)<cr>
+ nnoremap <buffer> <silent> me :<c-u>call <SID>NetrwMarkFileEdit(0)<cr>
+ nnoremap <buffer> <silent> mf :<c-u>call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> mg :<c-u>call <SID>NetrwMarkFileGrep(0)<cr>
+ nnoremap <buffer> <silent> mh :<c-u>call <SID>NetrwMarkHideSfx(0)<cr>
+ nnoremap <buffer> <silent> mm :<c-u>call <SID>NetrwMarkFileMove(0)<cr>
+ nnoremap <buffer> <silent> mp :<c-u>call <SID>NetrwMarkFilePrint(0)<cr>
+ nnoremap <buffer> <silent> mr :<c-u>call <SID>NetrwMarkFileRegexp(0)<cr>
+ nnoremap <buffer> <silent> ms :<c-u>call <SID>NetrwMarkFileSource(0)<cr>
+ nnoremap <buffer> <silent> mT :<c-u>call <SID>NetrwMarkFileTag(0)<cr>
+ nnoremap <buffer> <silent> mt :<c-u>call <SID>NetrwMarkFileTgt(0)<cr>
+ nnoremap <buffer> <silent> mu :<c-u>call <SID>NetrwUnMarkFile(0)<cr>
+ nnoremap <buffer> <silent> mx :<c-u>call <SID>NetrwMarkFileExe(0)<cr>
+ nnoremap <buffer> <silent> mz :<c-u>call <SID>NetrwMarkFileCompress(0)<cr>
+ nnoremap <buffer> <silent> gb :<c-u>call <SID>NetrwBookmarkDir(1,b:netrw_cur)<cr>
+ nnoremap <buffer> <silent> gh :<c-u>call <SID>NetrwHidden(0)<cr>
nnoremap <buffer> <silent> C :let g:netrw_chgwin= winnr()<cr>
- nnoremap <buffer> <silent> <c-h> :call <SID>NetHideEdit(0)<cr>
- nnoremap <buffer> <silent> i :call <SID>NetListStyle(0)<cr>
- nnoremap <buffer> <silent> o :call <SID>NetSplit(0)<cr>
- nnoremap <buffer> <silent> O :call netrw#NetObtain(0)<cr>
- vnoremap <buffer> <silent> O :call netrw#NetObtain(1)<cr>
- nnoremap <buffer> <silent> p :call <SID>NetPreview(<SID>NetBrowseChgDir(1,<SID>NetGetWord(),1))<cr>
- nnoremap <buffer> <silent> P :call <SID>NetPrevWinOpen(0)<cr>
- nnoremap <buffer> <silent> q :<c-u>call <SID>NetBookmarkDir(2,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetBrowse(0,<SID>NetBrowseChgDir(0,'./'))<cr>
- nnoremap <buffer> <silent> s :call <SID>NetSortStyle(0)<cr>
+ nnoremap <buffer> <silent> i :call <SID>NetrwListStyle(0)<cr>
+ nnoremap <buffer> <silent> o :call <SID>NetrwSplit(0)<cr>
+ nnoremap <buffer> <silent> O :call <SID>NetrwObtain(0)<cr>
+ nnoremap <buffer> <silent> p :call <SID>NetrwPreview(<SID>NetrwBrowseChgDir(1,<SID>NetrwGetWord(),1))<cr>
+ nnoremap <buffer> <silent> P :call <SID>NetrwPrevWinOpen(0)<cr>
+ nnoremap <buffer> <silent> qb :<c-u>call <SID>NetrwBookmarkDir(2,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> mB :<c-u>call <SID>NetrwBookmarkDir(6,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> qf :<c-u>call <SID>NetrwFileInfo(0,<SID>NetrwGetWord())<cr>
+ nnoremap <buffer> <silent> r :let g:netrw_sort_direction= (g:netrw_sort_direction =~ 'n')? 'r' : 'n'<bar>exe "norm! 0"<bar>call <SID>NetrwBrowse(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+ nnoremap <buffer> <silent> s :call <SID>NetrwSortStyle(0)<cr>
nnoremap <buffer> <silent> S :call <SID>NetSortSequence(0)<cr>
- nnoremap <buffer> <silent> t :call <SID>NetSplit(1)<cr>
- nnoremap <buffer> <silent> u :<c-u>call <SID>NetBookmarkDir(4,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> U :<c-u>call <SID>NetBookmarkDir(5,b:netrw_curdir)<cr>
- nnoremap <buffer> <silent> v :call <SID>NetSplit(2)<cr>
- nnoremap <buffer> <silent> x :call netrw#NetBrowseX(<SID>NetBrowseChgDir(0,<SID>NetGetWord()),1)<cr>
- exe 'nnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
- exe 'vnoremap <buffer> <silent> <del> :call <SID>NetBrowseRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
- exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetBrowseRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
- exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetBrowseRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
- exe 'nnoremap <buffer> <silent> d :call <SID>NetMakeDir("'.s:user.s:machine.'")<cr>'
- exe 'nnoremap <buffer> <silent> D :call <SID>NetBrowseRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
- exe 'vnoremap <buffer> <silent> D :call <SID>NetBrowseRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
- exe 'nnoremap <buffer> <silent> R :call <SID>NetBrowseRename("'.s:user.s:machine.'","'.s:path.'")<cr>'
- exe 'vnoremap <buffer> <silent> R :call <SID>NetBrowseRename("'.s:user.s:machine.'","'.s:path.'")<cr>'
+ nnoremap <buffer> <silent> t :call <SID>NetrwSplit(1)<cr>
+ nnoremap <buffer> <silent> u :<c-u>call <SID>NetrwBookmarkDir(4,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> U :<c-u>call <SID>NetrwBookmarkDir(5,b:netrw_curdir)<cr>
+ nnoremap <buffer> <silent> v :call <SID>NetrwSplit(2)<cr>
+ nnoremap <buffer> <silent> x :call netrw#NetrwBrowseX(<SID>NetrwBrowseChgDir(0,<SID>NetrwGetWord()),1)<cr>
+ if !hasmapto('<Plug>NetrwHideEdit')
+ nmap <buffer> <c-h> <Plug>NetrwHideEdit
+ endif
+ nnoremap <buffer> <silent> <Plug>NetrwHideEdit :call <SID>NetrwHideEdit(0)<cr>
+ if !hasmapto('<Plug>NetrwRefresh')
+ nmap <buffer> <c-l> <Plug>NetrwRefresh
+ endif
+ nnoremap <buffer> <silent> <Plug>NetrwRefresh :call <SID>NetrwRefresh(0,<SID>NetrwBrowseChgDir(0,'./'))<cr>
+ if g:netrw_mousemaps == 1
+ nnoremap <buffer> <silent> <leftmouse> <leftmouse>:call <SID>NetrwLeftmouse(0)<cr>
+ nnoremap <buffer> <silent> <middlemouse> <leftmouse>:call <SID>NetrwPrevWinOpen(0)<cr>
+ nnoremap <buffer> <silent> <s-leftmouse> <leftmouse>:call <SID>NetrwMarkFile(0,<SID>NetrwGetWord())<cr>
+ exe 'nnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwRemoteRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
+ exe 'vnoremap <buffer> <silent> <rightmouse> <leftmouse>:call <SID>NetrwRemoteRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
+ endif
+ exe 'nnoremap <buffer> <silent> <del> :call <SID>NetrwRemoteRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
+ exe 'vnoremap <buffer> <silent> <del> :call <SID>NetrwRemoteRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
+ exe 'nnoremap <buffer> <silent> d :call <SID>NetrwMakeDir("'.s:user.s:machine.'")<cr>'
+ exe 'nnoremap <buffer> <silent> D :call <SID>NetrwRemoteRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
+ exe 'vnoremap <buffer> <silent> D :call <SID>NetrwRemoteRm("'.s:user.s:machine.'","'.s:path.'")<cr>'
+ exe 'nnoremap <buffer> <silent> R :call <SID>NetrwRemoteRename("'.s:user.s:machine.'","'.s:path.'")<cr>'
+ exe 'vnoremap <buffer> <silent> R :call <SID>NetrwRemoteRename("'.s:user.s:machine.'","'.s:path.'")<cr>'
nnoremap <buffer> <F1> :he netrw-browse-cmds<cr>
endif
+ call s:SetRexDir(a:islocal,b:netrw_curdir)
" call Dret("s:BrowserMaps")
endfun
" ---------------------------------------------------------------------
-" s:NetBrowse: This function uses the command in g:netrw_list_cmd to get a list {{{2
-" of the contents of a remote directory. It is assumed that the
+" s:ExplorePatHls: converts an Explore pattern into a regular expression search pattern {{{2
+fun! s:ExplorePatHls(pattern)
+" call Dfunc("s:ExplorePatHls(pattern<".a:pattern.">)")
+ let repat= substitute(a:pattern,'^**/\{1,2}','','')
+" call Decho("repat<".repat.">")
+ let repat= escape(repat,'][.\')
+" call Decho("repat<".repat.">")
+ let repat= '\<'.substitute(repat,'\*','\\(\\S\\+ \\)*\\S\\+','g').'\>'
+" call Dret("s:ExplorePatHls repat<".repat.">")
+ return repat
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwBookmarkDir: {{{2
+" 0: (user: <mb>) bookmark current directory
+" 1: (user: <gb>) change to the bookmarked directory
+" 2: (user: <qb>) list bookmarks
+" 3: (browsing) record current directory history
+" 4: (user: <u>) go up (previous) bookmark
+" 5: (user: <U>) go down (next) bookmark
+" 6: (user: <mB>) delete bookmark
+fun! s:NetrwBookmarkDir(chg,curdir)
+" call Dfunc("NetrwBookmarkDir(chg=".a:chg." curdir<".a:curdir.">) cnt=".v:count." bookmarkcnt=".g:NETRW_BOOKMARKMAX." histcnt=".g:NETRW_DIRHIST_CNT." bookmax=".g:NETRW_BOOKMARKMAX." histmax=".g:netrw_dirhistmax)
+
+ if a:chg == 0
+ " bookmark the current directory
+" call Decho("(user: <b>) bookmark the current directory")
+ if v:count > 0
+ " handle bookmark# specified via the count
+ let g:NETRW_BOOKMARKDIR_{v:count}= a:curdir
+ if !exists("g:NETRW_BOOKMARKMAX")
+ let g:NETRW_BOOKMARKMAX= v:count
+ elseif v:count > g:NETRW_BOOKMARKMAX
+ let g:NETRW_BOOKMARKMAX= v:count
+ endif
+ else
+ " handle no count specified
+ let g:NETRW_BOOKMARKMAX = g:NETRW_BOOKMARKMAX + 1
+ let g:NETRW_BOOKMARKDIR_{g:NETRW_BOOKMARKMAX} = a:curdir
+ endif
+ echo "bookmarked the current directory"
+
+ elseif a:chg == 1
+ " change to the bookmarked directory
+" call Decho("(user: <B>) change to the bookmarked directory")
+ if exists("g:NETRW_BOOKMARKDIR_{v:count}")
+ exe "e ".g:NETRW_BOOKMARKDIR_{v:count}
+ else
+ echomsg "Sorry, bookmark#".v:count." doesn't exist!"
+ endif
+
+ elseif a:chg == 2
+" redraw!
+ let didwork= 0
+ " list user's bookmarks
+" call Decho("(user: <q>) list user's bookmarks")
+ if exists("g:NETRW_BOOKMARKMAX")
+" call Decho("list bookmarks [0,".g:NETRW_BOOKMARKMAX."]")
+ let cnt= 0
+ while cnt <= g:NETRW_BOOKMARKMAX
+ if exists("g:NETRW_BOOKMARKDIR_{cnt}")
+" call Decho("Netrw Bookmark#".cnt.": ".g:NETRW_BOOKMARKDIR_{cnt})
+ echo "Netrw Bookmark#".cnt.": ".g:NETRW_BOOKMARKDIR_{cnt}
+ let didwork= 1
+ endif
+ let cnt= cnt + 1
+ endwhile
+ endif
+
+ " list directory history
+ let cnt = g:NETRW_DIRHIST_CNT
+ let first = 1
+ let histcnt = 0
+ while ( first || cnt != g:NETRW_DIRHIST_CNT )
+" call Decho("first=".first." cnt=".cnt." dirhist_cnt=".g:NETRW_DIRHIST_CNT)
+ let histcnt= histcnt + 1
+ if exists("g:NETRW_DIRHIST_{cnt}")
+" call Decho("Netrw History#".histcnt.": ".g:NETRW_DIRHIST_{cnt})
+ echo "Netrw History#".histcnt.": ".g:NETRW_DIRHIST_{cnt}
+ let didwork= 1
+ endif
+ let first = 0
+ let cnt = ( cnt - 1 ) % g:netrw_dirhistmax
+ if cnt < 0
+ let cnt= cnt + g:netrw_dirhistmax
+ endif
+ endwhile
+ if didwork
+ call inputsave()|call input("Press <cr> to continue")|call inputrestore()
+ endif
+
+ elseif a:chg == 3
+ " saves most recently visited directories (when they differ)
+" call Decho("(browsing) record curdir history")
+ if !exists("g:NETRW_DIRHIST_0") || g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT} != a:curdir
+ let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
+" let g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}= substitute(a:curdir,'[/\\]$','','e')
+ let g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}= a:curdir
+" call Decho("save dirhist#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
+ endif
+
+ elseif a:chg == 4
+ " u: change to the previous directory stored on the history list
+" call Decho("(user: <u>) chg to prev dir from history")
+ let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT - 1 ) % g:netrw_dirhistmax
+ if g:NETRW_DIRHIST_CNT < 0
+ let g:NETRW_DIRHIST_CNT= g:NETRW_DIRHIST_CNT + g:netrw_dirhistmax
+ endif
+ if exists("g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}")
+" call Decho("changedir u#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
+ if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
+ setlocal ma noro
+" call Decho("setlocal ma noro")
+ %d
+ setlocal nomod
+" call Decho("setlocal nomod")
+ endif
+" call Decho("exe e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT})
+ exe "e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}
+ else
+ let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
+ echo "Sorry, no predecessor directory exists yet"
+ endif
+
+ elseif a:chg == 5
+ " U: change to the subsequent directory stored on the history list
+" call Decho("(user: <U>) chg to next dir from history")
+ let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
+ if exists("g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}")
+" call Decho("changedir U#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
+ if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
+ setlocal ma noro
+" call Decho("setlocal ma noro")
+ %d
+" call Decho("removed all lines from buffer (%d)")
+ setlocal nomod
+" call Decho("setlocal nomod")
+ endif
+" call Decho("exe e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT})
+ exe "e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}
+ else
+ let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT - 1 ) % g:netrw_dirhistmax
+ if g:NETRW_DIRHIST_CNT < 0
+ let g:NETRW_DIRHIST_CNT= g:NETRW_DIRHIST_CNT + g:netrw_dirhistmax
+ endif
+ echo "Sorry, no successor directory exists yet"
+ endif
+
+ elseif a:chg == 6
+ if v:count > 0 && v:count == g:NETRW_BOOKMARKMAX
+ " delete the v:count'th bookmark
+" call Decho("delete bookmark#".v:count."<".g:NETRW_BOOKMARKDIR_{g:NETRW_BOOKMARKMAX}.">")
+ unlet g:NETRW_BOOKMARKDIR_{g:NETRW_BOOKMARKMAX}
+ let g:NETRW_BOOKMARKMAX= g:NETRW_BOOKMARKMAX - 1
+
+ elseif v:count > 0
+" call Decho("delete by shifting bookmark#".v:count."<".g:NETRW_BOOKMARKDIR_{v:count}.">")
+ let cnt= v:count
+ while cnt < g:NETRW_BOOKMARKMAX
+ let g:NETRW_BOOKMARKDIR_{cnt} = g:NETRW_BOOKMARKDIR_{(cnt+1)}
+ let cnt = cnt + 1
+ endwhile
+ unlet g:NETRW_BOOKMARKDIR_{g:NETRW_BOOKMARKMAX}
+ let g:NETRW_BOOKMARKMAX= g:NETRW_BOOKMARKMAX - 1
+
+ elseif exists("b:netrw_curdir")
+ " look for current directory amongst the bookmarks and remove that bookmark
+" call Decho("search for bookmark<".b:netrw_curdir.">")
+ let cnt= 1
+ while cnt <= g:NETRW_BOOKMARKMAX
+" call Decho("checking: g:NETRW_BOOKMARKDIR_".cnt."<".g:NETRW_BOOKMARKDIR_{cnt}.">")
+ if g:NETRW_BOOKMARKDIR_{cnt} == b:netrw_curdir
+ if cnt < g:NETRW_BOOKMARKMAX
+" call Decho("delete bookmark#".cnt."<".b:netrw_curdir.">")
+ while cnt < g:NETRW_BOOKMARMAX
+ let g:NETRW_BOOKMARKDIR_{cnt} = g:NETRW_BOOKMARKDIR_{(cnt+1)}
+ let cnt = cnt + 1
+ endwhile
+ endif
+ unlet g:NETRW_BOOKMARKDIR_{g:NETRW_BOOKMARKMAX}
+ let g:NETRW_BOOKMARKMAX= g:NETRW_BOOKMARKMAX - 1
+ endif
+ let cnt= cnt + 1
+ endwhile
+ endif
+
+ endif
+ call s:NetrwBookmarkMenu()
+" call Dret("NetrwBookmarkDir")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwBrowse: This function uses the command in g:netrw_list_cmd to provide a {{{2
+" list of the contents of a local or remote directory. It is assumed that the
" g:netrw_list_cmd has a string, USEPORT HOSTNAME, that needs to be substituted
" with the requested remote hostname first.
-fun! s:NetBrowse(islocal,dirname)
+fun! s:NetrwBrowse(islocal,dirname)
if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif
-" call Dfunc("NetBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%").">")
+" call Dfunc("s:NetrwBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%").">")
+" call Decho("tab#".tabpagenr()." win#".winnr())
" call Dredir("ls!")
if exists("s:netrw_skipbrowse")
unlet s:netrw_skipbrowse
-" call Dret("NetBrowse : s:netrw_skipbrowse=".s:netrw_skipbrowse)
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
+" call Dret("s:NetrwBrowse : s:netrw_skipbrowse=".s:netrw_skipbrowse)
+ return
+ endif
+ if !exists("*shellescape")
+ call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing shellescape()",69)
+" call Dret("s:NetrwBrowse : missing shellescape()")
+ return
+ endif
+ if !exists("*fnameescape")
+ call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing fnameescape()",70)
+" call Dret("s:NetrwBrowse : missing fnameescape()")
return
endif
- call s:NetOptionSave()
+ call s:NetrwOptionSave("w:")
+ call s:NetrwSafeOptions()
+
+ " re-instate any marked files
+ if exists("s:netrwmarkfilelist_{bufnr('%')}")
+" call Decho("clearing marked files")
+ exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/"
+ endif
if a:islocal && exists("w:netrw_acdkeep") && w:netrw_acdkeep
" call Decho("handle w:netrw_acdkeep:")
-" call Decho("cd ".escape(a:dirname,s:netrw_cd_escape)." (due to 'acd')")
- exe 'cd '.escape(a:dirname,s:netrw_cd_escape)
+" call Decho("keepjumps lcd ".fnameescape(a:dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")")
+ exe 'keepjumps lcd '.fnameescape(a:dirname)
" call Decho("getcwd<".getcwd().">")
elseif !a:islocal && a:dirname !~ '[\/]$' && a:dirname !~ '^"'
@@ -1703,21 +2052,25 @@ fun! s:NetBrowse(islocal,dirname)
" remote-read the requested file into current buffer {{{3
mark '
call s:NetrwEnew(a:dirname)
- let b:netrw_curdir= a:dirname
- call s:NetrwSafeOptions()
setlocal ma noro
-" call Decho("exe silent! keepalt file ".s:method."://".s:user.s:machine."/".escape(s:path,s:netrw_cd_escape)." (bt=".&bt.")")
- exe "silent! keepalt file ".s:method."://".s:user.s:machine."/".escape(s:path,s:netrw_cd_escape)
+" call Decho("setlocal ma noro")
+ let b:netrw_curdir= a:dirname
+" call Decho("exe silent! keepalt file ".s:method."://".s:user.s:machine."/".fnameescape(s:path)." (bt=".&bt.")")
+ exe "silent! keepalt file ".s:method."://".s:user.s:machine."/".fnameescape(s:path)
exe "silent keepalt doau BufReadPre ".s:fname
silent call netrw#NetRead(2,s:method."://".s:user.s:machine."/".s:path)
- exe "silent keepalt doau BufReadPost ".s:fname
+ if s:path !~ '.tar.bz2$' && s:path !~ '.tar.gz'
+ " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error
+ exe "silent keepalt doau BufReadPost ".s:fname
+ endif
" save certain window-oriented variables into buffer-oriented variables {{{3
call s:SetBufWinVars()
- call s:NetOptionRestore()
- setlocal nomod nowrap
+ call s:NetrwOptionRestore("w:")
+ setlocal ma nomod
-" call Dret("NetBrowse : file<".s:fname.">")
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
+" call Dret("s:NetrwBrowse : file<".s:fname.">")
return
endif
@@ -1729,9 +2082,25 @@ fun! s:NetBrowse(islocal,dirname)
let dirname = a:dirname
let s:last_sort_by = g:netrw_sort_by
- call s:NetMenu(1) " set up menu {{{3
- if s:NetGetBuffer(a:islocal,dirname) " set up buffer {{{3
-" call Dret("NetBrowse : re-using buffer")
+ " set up menu {{{3
+ call s:NetrwMenu(1)
+
+ " set up buffer {{{3
+ let reusing= s:NetrwGetBuffer(a:islocal,dirname)
+ " maintain markfile highlighting
+ if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != ""
+" call Decho("bufnr(%)=".bufnr('%'))
+" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/")
+ exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/"
+ else
+" call Decho("2match none")
+ 2match none
+ endif
+ if reusing
+ call s:NetrwOptionRestore("w:")
+ setlocal noma nomod nowrap
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
+" call Dret("s:NetrwBrowse : re-using buffer")
return
endif
@@ -1767,21 +2136,26 @@ fun! s:NetBrowse(islocal,dirname)
" handle g:netrw_keepdir: set vim's current directory to netrw's notion of the current directory {{{3
if !g:netrw_keepdir
-" call Decho("handle keepdir: (g:netrw_keepdir=".g:netrw_keepdir.")")
-" call Decho('exe cd '.escape(b:netrw_curdir,s:netrw_cd_escape))
- try
- exe 'cd '.escape(b:netrw_curdir,s:netrw_cd_escape)
- catch /^Vim\%((\a\+)\)\=:E472/
- call netrw#ErrorMsg(s:ERROR,"unable to change directory to <".b:netrw_curdir."> (permissions?)",33)
- if exists("w:netrw_prvdir")
- let b:netrw_curdir= w:netrw_prvdir
- else
- call s:NetOptionRestore()
- let b:netrw_curdir= dirname
-" call Dret("NetBrowse : reusing buffer#".(exists("bufnum")? bufnum : 'N/A')."<".dirname."> getcwd<".getcwd().">")
- return
- endif
- endtry
+" call Decho("handle g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd)
+" call Decho("l:acd".(exists("&l:acd")? "=".&l:acd : " doesn't exist"))
+ if !exists("&l:acd") || !&l:acd
+" call Decho('exe keepjumps lcd '.fnameescape(b:netrw_curdir))
+ try
+ exe 'keepjumps lcd '.fnameescape(b:netrw_curdir)
+ catch /^Vim\%((\a\+)\)\=:E472/
+ call netrw#ErrorMsg(s:ERROR,"unable to change directory to <".b:netrw_curdir."> (permissions?)",61)
+ if exists("w:netrw_prvdir")
+ let b:netrw_curdir= w:netrw_prvdir
+ else
+ call s:NetrwOptionRestore("w:")
+ setlocal noma nomod nowrap
+ let b:netrw_curdir= dirname
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
+" call Dret("s:NetrwBrowse : reusing buffer#".(exists("bufnum")? bufnum : 'N/A')."<".dirname."> getcwd<".getcwd().">")
+ return
+ endif
+ endtry
+ endif
endif
" --------------------------------
@@ -1792,9 +2166,9 @@ fun! s:NetBrowse(islocal,dirname)
" analyze a:dirname and g:netrw_list_cmd {{{4
" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist")."> a:dirname<".a:dirname.">")
- if a:dirname == "NetrwTreeListing"
+ if a:dirname =~ "^NetrwTreeListing\>"
let dirname= b:netrw_curdir
-" call Decho("(dirname was NetrwTreeListing) dirname<".dirname.">")
+" call Decho("(dirname was ".a:dirname.") dirname<".dirname.">")
elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
let dirname= substitute(b:netrw_curdir,'\\','/','g')
if dirname !~ '/$'
@@ -1812,8 +2186,10 @@ fun! s:NetBrowse(islocal,dirname)
if !exists("g:netrw_quiet")
call netrw#ErrorMsg(s:ERROR,"netrw doesn't understand your dirname<".dirname.">",20)
endif
- call s:NetOptionRestore()
-" call Dret("NetBrowse : badly formatted dirname<".dirname.">")
+ call s:NetrwOptionRestore("w:")
+ setlocal noma nomod nowrap
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
+" call Dret("s:NetrwBrowse : badly formatted dirname<".dirname.">")
return
endif
let b:netrw_curdir= dirname
@@ -1823,47 +2199,116 @@ fun! s:NetBrowse(islocal,dirname)
" -----------------------
" Directory Listing: {{{3
" -----------------------
- setlocal noro ma
call s:BrowserMaps(a:islocal)
call s:PerformListing(a:islocal)
-" call Dret("NetBrowse")
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
+" call Dret("s:NetrwBrowse : did PerformListing")
return
endfun
" ---------------------------------------------------------------------
-" s:NetGetBuffer: {{{2
+" s:NetrwFileInfo: supports qf (query for file information) {{{2
+fun! s:NetrwFileInfo(islocal,fname)
+" call Dfunc("s:NetrwFileInfo(islocal=".a:islocal." fname<".a:fname.">)")
+ if a:islocal
+ if (has("unix") || has("macunix")) && executable("/bin/ls")
+ if exists("b:netrw_curdir")
+" call Decho('using ls with b:netrw_curdir<'.b:netrw_curdir.'>')
+ if b:netrw_curdir =~ '/$'
+ echo system("/bin/ls -lsad ".shellescape(b:netrw_curdir.a:fname))
+ else
+ echo system("/bin/ls -lsad ".shellescape(b:netrw_curdir."/".a:fname))
+ endif
+ else
+" call Decho('using ls '.a:fname." using cwd<".getcwd().">")
+ echo system("/bin/ls -lsad ".shellescape(a:fname))
+ endif
+ else
+ " use vim functions to return information about file below cursor
+" call Decho("using vim functions to query for file info")
+ if !isdirectory(a:fname) && !filereadable(a:fname) && a:fname =~ '[*@/]'
+ let fname= substitute(a:fname,".$","","")
+ else
+ let fname= a:fname
+ endif
+ let t = getftime(fname)
+ let sz = getfsize(fname)
+ echo a:fname.": ".sz." ".strftime(g:netrw_timefmt,getftime(fname))
+" call Decho(fname.": ".sz." ".strftime(g:netrw_timefmt,getftime(fname)))
+ endif
+ else
+ echo "sorry, \"qf\" not supported yet for remote files"
+ endif
+" call Dret("s:NetrwFileInfo")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwGetBuffer: {{{2
" returns 0=cleared buffer
" 1=re-used buffer
-fun! s:NetGetBuffer(islocal,dirname)
-" call Dfunc("s:NetGetBuffer(islocal=".a:islocal." dirname<".a:dirname.">)")
+fun! s:NetrwGetBuffer(islocal,dirname)
+" call Dfunc("s:NetrwGetBuffer(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".g:netrw_liststyle)
+ let dirname= a:dirname
" re-use buffer if possible {{{3
+" call Decho("--re-use a buffer if possible--")
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
" find NetrwTreeList buffer if there is one
- let dirname= "NetrwTreeListing"
- let bufnum = bufnr('\<NetrwTreeListing\>')
- if bufnum != -1
-" call Dret("s:NetGetBuffer : bufnum#".bufnum."<NetrwTreeListing>")
+ if exists("w:netrw_treebufnr") && w:netrw_treebufnr > 0
+" call Decho(" re-use w:netrw_treebufnr=".w:netrw_treebufnr)
+ let eikeep= &ei
+ set ei=all
+ exe "b ".w:netrw_treebufnr
+ let &ei= eikeep
+" call Dret("s:NetrwGetBuffer : bufnum#".bufnum."<NetrwTreeListing>")
return
endif
+ let bufnum= -1
+" call Decho(" liststyle=TREE but w:netrw_treebufnr doesn't exist")
else
" find buffer number of buffer named precisely the same as dirname {{{3
+" call Decho("--find buffer numnber of buffer named precisely the same as dirname--")
" call Dredir("ls!")
- let dirname= a:dirname
-" call Decho("find buffer<".dirname.">'s number ")
- let bufnum= bufnr(escape(dirname,'\'))
-" call Decho("findbuf1: bufnum=bufnr('".escape(dirname,'\')."')=".bufnum." (initial)")
- let ibuf= 1
- if bufnum > 0 && bufname(bufnum) != dirname
+
+ " get dirname and associated buffer number
+ let bufnum = bufnr(escape(dirname,'\'))
+" call Decho(" find buffer<".dirname.">'s number ")
+" call Decho(" bufnr(dirname<".escape(dirname,'\').">)=".bufnum)
+
+ if bufnum < 0 && dirname !~ '/$'
+ " trying appending a trailing /
+" call Decho(" try appending a trailing / to dirname<".dirname.">")
+ let bufnum= bufnr(escape(dirname.'/','\'))
+ if bufnum > 0
+ let dirname= dirname.'/'
+ endif
+ endif
+
+ if bufnum < 0 && dirname =~ '/$'
+ " trying removing a trailing /
+" call Decho(" try removing a trailing / from dirname<".dirname.">")
+ let bufnum= bufnr(escape(substitute(dirname,'/$','',''),'\'))
+ if bufnum > 0
+ let dirname= substitute(dirname,'/$','','')
+ endif
+ endif
+
+" call Decho(" findbuf1: bufnum=bufnr('".dirname."')=".bufnum." bufname(".bufnum.")<".bufname(bufnum)."> (initial)")
+ " note: !~ was used just below, but that means using ../ to go back would match (ie. abc/def/ and abc/ matches)
+ if bufnum > 0 && bufname(bufnum) != dirname && bufname(bufnum) != '.'
+ " handle approximate matches
+" call Decho(" handling approx match: bufnum#%d<".bufname(bufnum)."> approx= dirname<".dirname.">")
+ let ibuf = 1
let buflast = bufnr("$")
-" call Decho("findbuf2: buflast=".buflast)
+" call Decho(" findbuf2: buflast=".buflast)
while ibuf <= buflast
- let bname= bufname(ibuf)
-" call Decho("findbuf3: dirname<".dirname."> bufname(".ibuf.")<".bname.">")
- if bname != '' && bname !~ '/' && dirname =~ '/'.bname.'$' | break | endif
- if bname =~ '^'.dirname.'\=$' | break | endif
+ let bname= substitute(bufname(ibuf),'\\','/','g')
+" call Decho(" findbuf3: dirname<".dirname."> bufname(".ibuf.")<".bname.">")
+ if bname != '' && bname !~ '/' && dirname =~ '/'.bname.'/\=$' | break | endif
+ if bname =~ '^'.dirname.'/\=$' | break | endif
+ if dirname =~ '^'.bname.'/$' | break | endif
let ibuf= ibuf + 1
endwhile
if ibuf > buflast
@@ -1871,54 +2316,71 @@ fun! s:NetGetBuffer(islocal,dirname)
else
let bufnum= ibuf
endif
-" call Decho("findbuf4: bufnum=".bufnum)
+" call Decho(" findbuf4: bufnum=".bufnum." (ibuf=".ibuf." buflast=".buflast.")")
endif
endif
" get enew buffer and name it -or- re-use buffer {{{3
+" call Decho("--get enew buffer and name it OR re-use buffer-- (bufnum=".bufnum.")")
mark '
if bufnum < 0 || !bufexists(bufnum)
-" call Decho("get enew buffer")
call s:NetrwEnew(dirname)
- call s:NetrwSafeOptions()
+" call Decho(" got enew buffer#".bufnr("%")." (altbuf<".expand("#").">)")
" name the buffer
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
-" call Decho('silent! keepalt file NetrwTreeListing')
- silent! keepalt file NetrwTreeListing
+ " Got enew buffer; transform into a NetrwTreeListing
+" call Decho("--transform enew buffer#".bufnr("%")." into a NetrwTreeListing --")
+ if !exists("s:netrw_treelistnum")
+ let s:netrw_treelistnum= 1
+ else
+ let s:netrw_treelistnum= s:netrw_treelistnum + 1
+ endif
+ let w:netrw_treebufnr= bufnr("%")
+" call Decho(" exe silent! keepalt file NetrwTreeListing ".s:netrw_treelistnum)
+ exe 'silent! keepalt file NetrwTreeListing\ '.s:netrw_treelistnum
+ nnoremap <silent> <buffer> [ :silent call <SID>TreeListMove('[')<cr>
+ nnoremap <silent> <buffer> ] :silent call <SID>TreeListMove(']')<cr>
+ nnoremap <silent> <buffer> [[ :silent call <SID>TreeListMove('[')<cr>
+ nnoremap <silent> <buffer> ]] :silent call <SID>TreeListMove(']')<cr>
+" call Decho(" tree listing#".s:netrw_treelistnum." bufnr=".w:netrw_treebufnr)
else
-" call Decho('exe silent! keepalt file '.escape(dirname,s:netrw_cd_escape))
" let v:errmsg= "" " Decho
- let escdirname= escape(dirname,s:netrw_cd_escape)
+ let escdirname= fnameescape(dirname)
+" call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">")
+" call Decho(' exe silent! keepalt file '.escdirname)
exe 'silent! keepalt file '.escdirname
-" call Decho("errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">")
+" call Decho(" errmsg<".v:errmsg."> bufnr(".escdirname.")=".bufnr(escdirname)."<".bufname(bufnr(escdirname)).">")
endif
-" call Decho("named enew buffer#".bufnr("%")."<".bufname("%").">")
+" call Decho(" named enew buffer#".bufnr("%")."<".bufname("%").">")
else " Re-use the buffer
-
-" call Decho("re-use buffer:")
+" call Decho("--re-use buffer#".bufnum.": --")
let eikeep= &ei
set ei=all
if getline(2) =~ '^" Netrw Directory Listing'
-" call Decho("re-use buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: keepalt b ".bufnum)
+" call Decho(" re-use buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: keepalt b ".bufnum)
exe "keepalt b ".bufnum
else
-" call Decho("reusing buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: b ".bufnum)
+" call Decho(" reusing buffer#".bufnum."<".((bufnum > 0)? bufname(bufnum) : "")."> using: b ".bufnum)
exe "b ".bufnum
endif
+ if bufname("%") == '.'
+ exe "silent! keepalt file ".escape(getcwd(),' ')
+ endif
let &ei= eikeep
if line("$") <= 1
call s:NetrwListSettings(a:islocal)
-" call Dret("s:NetGetBuffer 0 : re-using buffer#".bufnr("%").", but its empty, so refresh it")
+" call Dret("s:NetrwGetBuffer 0 : re-using buffer#".bufnr("%").", but its empty, so refresh it")
return 0
elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
-" call Decho("clear buffer<".expand("%")."> with :%d")
+" call Decho("--re-use tree listing--")
+" call Decho(" clear buffer<".expand("%")."> with :%d")
silent %d
call s:NetrwListSettings(a:islocal)
-" call Dret("s:NetGetBuffer 0 : re-using buffer#".bufnr("%").", but treelist mode always needs a refresh")
+" call Dret("s:NetrwGetBuffer 0 : re-using buffer#".bufnr("%").", but treelist mode always needs a refresh")
return 0
else
-" call Dret("s:NetGetBuffer 1 : buf#".bufnr("%"))
+" call Dret("s:NetrwGetBuffer 1 : buf#".bufnr("%"))
return 1
endif
endif
@@ -1928,31 +2390,152 @@ fun! s:NetGetBuffer(islocal,dirname)
" slow 0 D D Deleting a buffer implies it will not be re-used (slow)
" med 1 D H
" fast 2 H H
+" call Decho("--do netrw settings: make this buffer not-a-file, modifiable, not line-numbered, etc--")
let fname= expand("%")
call s:NetrwListSettings(a:islocal)
- exe "file ".escape(fname,' ')
+ exe "keepalt file ".escape(fname,' ')
" delete all lines from buffer {{{3
-" call Decho("clear buffer<".expand("%")."> with :%d")
+" call Decho("--delete all lines from buffer--")
+" call Decho(" clear buffer<".expand("%")."> with :%d")
keepalt silent! %d
-" call Dret("s:NetGetBuffer 0 : buf#".bufnr("%"))
+" call Dret("s:NetrwGetBuffer 0 : buf#".bufnr("%"))
return 0
endfun
" ---------------------------------------------------------------------
+" s:NetrwGetcwd: get the current directory. {{{2
+" Change backslashes to forward slashes, if any.
+" If doesc is true, escape certain troublesome characters
+fun! s:NetrwGetcwd(doesc)
+" call Dfunc("NetrwGetcwd(doesc=".a:doesc.")")
+ let curdir= substitute(getcwd(),'\\','/','ge')
+ if curdir !~ '[\/]$'
+ let curdir= curdir.'/'
+ endif
+ if a:doesc
+ let curdir= fnameescape(curdir)
+ endif
+" call Dret("NetrwGetcwd <".curdir.">")
+ return curdir
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwGetWord: it gets the directory/file named under the cursor {{{2
+fun! s:NetrwGetWord()
+" call Dfunc("s:NetrwGetWord() line#".line(".")." liststyle=".g:netrw_liststyle." virtcol=".virtcol("."))
+ call s:UseBufWinVars()
+
+ " insure that w:netrw_liststyle is set up
+ if !exists("w:netrw_liststyle")
+ if exists("g:netrw_liststyle")
+ let w:netrw_liststyle= g:netrw_liststyle
+ else
+ let w:netrw_liststyle= s:THINLIST
+ endif
+" call Decho("w:netrw_liststyle=".w:netrw_liststyle)
+ endif
+
+ if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt
+ " Active Banner support
+" call Decho("active banner handling")
+ norm! 0
+ let dirname= "./"
+ let curline= getline('.')
+
+ if curline =~ '"\s*Sorted by\s'
+ norm s
+ let s:netrw_skipbrowse= 1
+ echo 'Pressing "s" also works'
+
+ elseif curline =~ '"\s*Sort sequence:'
+ let s:netrw_skipbrowse= 1
+ echo 'Press "S" to edit sorting sequence'
+
+ elseif curline =~ '"\s*Quick Help:'
+ norm ?
+ let s:netrw_skipbrowse= 1
+ echo 'Pressing "?" also works'
+
+ elseif curline =~ '"\s*\%(Hiding\|Showing\):'
+ norm a
+ let s:netrw_skipbrowse= 1
+ echo 'Pressing "a" also works'
+
+ elseif line("$") > w:netrw_bannercnt
+ exe 'silent keepjumps '.w:netrw_bannercnt
+ endif
+
+ elseif w:netrw_liststyle == s:THINLIST
+" call Decho("thin column handling")
+ norm! 0
+ let dirname= getline('.')
+
+ elseif w:netrw_liststyle == s:LONGLIST
+" call Decho("long column handling")
+ norm! 0
+ let dirname= substitute(getline('.'),'^\(\%(\S\+ \)*\S\+\).\{-}$','\1','e')
+
+ elseif w:netrw_liststyle == s:TREELIST
+" call Decho("treelist handling")
+ let dirname= substitute(getline('.'),'^\(| \)*','','e')
+
+ else
+" call Decho("obtain word from wide listing")
+ let dirname= getline('.')
+
+ if !exists("b:netrw_cpf")
+ let b:netrw_cpf= 0
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
+" call Decho("computed cpf=".b:netrw_cpf)
+ endif
+
+" call Decho("buf#".bufnr("%")."<".bufname("%").">")
+ let filestart = (virtcol(".")/b:netrw_cpf)*b:netrw_cpf
+" call Decho("filestart= ([virtcol=".virtcol(".")."]/[b:netrw_cpf=".b:netrw_cpf."])*b:netrw_cpf=".filestart." bannercnt=".w:netrw_bannercnt)
+" call Decho("1: dirname<".dirname.">")
+ if filestart == 0
+ norm! 0ma
+ else
+ call cursor(line("."),filestart+1)
+ norm! ma
+ endif
+ let rega= @a
+ call cursor(line("."),filestart+b:netrw_cpf+1)
+ norm! "ay`a
+ let dirname = @a
+ let @a = rega
+" call Decho("2: dirname<".dirname.">")
+ let dirname= substitute(dirname,'\s\+$','','e')
+" call Decho("3: dirname<".dirname.">")
+ endif
+
+ " symlinks are indicated by a trailing "@". Remove it before further processing.
+ let dirname= substitute(dirname,"@$","","")
+
+ " executables are indicated by a trailing "*". Remove it before further processing.
+ let dirname= substitute(dirname,"\*$","","")
+
+" call Dret("s:NetrwGetWord <".dirname.">")
+ return dirname
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwListSettings: {{{2
fun! s:NetrwListSettings(islocal)
" call Dfunc("s:NetrwListSettings(islocal=".a:islocal.")")
let fname= bufname("%")
setlocal bt=nofile nobl ma nonu nowrap noro
- exe "file ".escape(fname,' ')
+" call Decho("setlocal bt=nofile nobl ma nonu nowrap noro")
+ exe "keepalt file ".escape(fname,' ')
if g:netrw_use_noswf
setlocal noswf
endif
" call Dredir("ls!")
" call Decho("exe setlocal ts=".g:netrw_maxfilenamelen)
exe "setlocal ts=".g:netrw_maxfilenamelen
+ setlocal isk+=.,~,-
if g:netrw_fastbrowse > a:islocal
setlocal bh=hide
else
@@ -1962,188 +2545,142 @@ fun! s:NetrwListSettings(islocal)
endfun
" ---------------------------------------------------------------------
-" s:PerformListing: {{{2
-fun! s:PerformListing(islocal)
-" call Dfunc("s:PerformListing(islocal=".a:islocal.") buf(%)=".bufnr("%")."<".bufname("%").">")
-
-" if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 " Decho
-" call Decho("(netrw) Processing your browsing request...")
-" endif " Decho
+" s:NetrwListStyle: {{{2
+" islocal=0: remote browsing
+" =1: local browsing
+fun! s:NetrwListStyle(islocal)
+" call Dfunc("NetrwListStyle(islocal=".a:islocal.") w:netrw_liststyle=".w:netrw_liststyle)
+ let fname = s:NetrwGetWord()
+ if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif
+ let w:netrw_liststyle = (w:netrw_liststyle + 1) % s:MAXLIST
+" call Decho("fname<".fname.">")
+" call Decho("chgd w:netrw_liststyle to ".w:netrw_liststyle)
+" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">")
-" call Decho('w:netrw_liststyle='.(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
- if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
- " force a refresh for tree listings
-" call Decho("force refresh for treelisting: clear buffer<".expand("%")."> with :%d")
- setlocal ma noro
- keepjumps %d
- endif
+ if w:netrw_liststyle == s:THINLIST
+ " use one column listing
+" call Decho("use one column list")
+ let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
- " save current directory on directory history list
- call s:NetBookmarkDir(3,b:netrw_curdir)
+ elseif w:netrw_liststyle == s:LONGLIST
+ " use long list
+" call Decho("use long list")
+ let g:netrw_list_cmd = g:netrw_list_cmd." -l"
- " Set up the banner {{{3
-" call Decho("set up banner")
- keepjumps put ='\" ============================================================================'
- keepjumps put ='\" Netrw Directory Listing (netrw '.g:loaded_netrw.')'
- keepjumps put ='\" '.b:netrw_curdir
- keepjumps 1d
- let w:netrw_bannercnt= 3
- exe w:netrw_bannercnt
+ elseif w:netrw_liststyle == s:WIDELIST
+ " give wide list
+" call Decho("use wide list")
+ let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
- let sortby= g:netrw_sort_by
- if g:netrw_sort_direction =~ "^r"
- let sortby= sortby." reversed"
- endif
+ elseif w:netrw_liststyle == s:TREELIST
+" call Decho("use tree list")
+ let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
- " Sorted by... {{{3
-" call Decho("handle specified sorting: g:netrw_sort_by<".g:netrw_sort_by.">")
- if g:netrw_sort_by =~ "^n"
-" call Decho("directories will be sorted by name")
- " sorted by name
- keepjumps put ='\" Sorted by '.sortby
- keepjumps put ='\" Sort sequence: '.g:netrw_sort_sequence
- let w:netrw_bannercnt= w:netrw_bannercnt + 2
else
-" call Decho("directories will be sorted by size or time")
- " sorted by size or date
- keepjumps put ='\" Sorted by '.sortby
- let w:netrw_bannercnt= w:netrw_bannercnt + 1
+ call netrw#ErrorMsg(s:WARNING,"bad value for g:netrw_liststyle (=".w:netrw_liststyle.")",46)
+ let g:netrw_liststyle = s:THINLIST
+ let w:netrw_liststyle = g:netrw_liststyle
+ let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
endif
- exe w:netrw_bannercnt
+ setlocal ma noro
+" call Decho("setlocal ma noro")
- " Hiding... -or- Showing... {{{3
-" call Decho("handle hiding/showing (g:netrw_hide=".g:netrw_list_hide." g:netrw_list_hide<".g:netrw_list_hide.">)")
- if g:netrw_list_hide != "" && g:netrw_hide
- if g:netrw_hide == 1
- keepjumps put ='\" Hiding: '.g:netrw_list_hide
- else
- keepjumps put ='\" Showing: '.g:netrw_list_hide
- endif
- let w:netrw_bannercnt= w:netrw_bannercnt + 1
- endif
- exe w:netrw_bannercnt
- keepjumps put ='\" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec'
- keepjumps put ='\" ============================================================================'
- let w:netrw_bannercnt= w:netrw_bannercnt + 2
+ " clear buffer - this will cause NetrwBrowse/LocalBrowseCheck to do a refresh
+" call Decho("clear buffer<".expand("%")."> with :%d")
+ %d
- " bannercnt should index the line just after the banner
- let w:netrw_bannercnt= w:netrw_bannercnt + 1
- exe w:netrw_bannercnt
-" call Decho("bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$"))
+ " refresh the listing
+ let svpos= netrw#NetrwSavePosn()
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
- " set up syntax highlighting {{{3
-" call Decho("set up syntax highlighting")
- if has("syntax")
- setlocal ft=netrw
- if !exists("g:syntax_on") || !g:syntax_on
- setlocal ft=
- endif
+ " keep cursor on the filename
+ silent keepjumps $
+ let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc')
+" call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A'))
+ if result <= 0 && exists("w:netrw_bannercnt")
+ exe "keepjumps ".w:netrw_bannercnt
endif
- " get list of files
- if a:islocal
- call s:LocalListing()
- else " remote
- call s:RemoteListing()
+" call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : ""))
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwBookmarkMenu: Uses menu priorities {{{2
+" .2.[cnt] for bookmarks, and
+" .3.[cnt] for history
+" (see s:NetrwMenu())
+fun! s:NetrwBookmarkMenu()
+ if !exists("s:netrw_menucnt")
+ return
endif
-" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)")
+" call Dfunc("NetrwBookmarkMenu() bookmarkcnt=".g:NETRW_BOOKMARKMAX." histcnt=".g:NETRW_DIRHIST_CNT." menucnt=".s:netrw_menucnt)
- " manipulate the directory listing (hide, sort) {{{3
- if line("$") >= w:netrw_bannercnt
-" call Decho("manipulate directory listing (hide)")
-" call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">")
- if g:netrw_hide && g:netrw_list_hide != ""
- call s:NetListHide()
+ " the following test assures that gvim is running, has menus available, and has menus enabled.
+ if has("gui") && has("menu") && has("gui_running") && &go =~ 'm' && g:netrw_menu
+ if exists("g:NetrwTopLvlMenu")
+" call Decho("removing ".g:NetrwTopLvlMenu."Bookmarks menu item(s)")
+ exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Bookmarks'
endif
- if line("$") >= w:netrw_bannercnt
-" call Decho("manipulate directory listing (sort) : g:netrw_sort_by<".g:netrw_sort_by.">")
-
- if g:netrw_sort_by =~ "^n"
- " sort by name
- call s:SetSort()
-
- if w:netrw_bannercnt < line("$")
-" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")")
- if g:netrw_sort_direction =~ 'n'
- " normal direction sorting
- exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'
- else
- " reverse direction sorting
- exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'
- endif
- endif
- " remove priority pattern prefix
-" call Decho("remove priority pattern prefix")
- exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{3}\///e'
- elseif a:islocal
- if w:netrw_bannercnt < line("$")
-" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction)
- if g:netrw_sort_direction =~ 'n'
-" call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort')
- exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'
- else
-" call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort!')
- exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'
- endif
- endif
- exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{-}\///e'
+ " show bookmarked places
+ let cnt = 1
+ while cnt <= g:NETRW_BOOKMARKMAX
+ if exists("g:NETRW_BOOKMARKDIR_{cnt}")
+ let bmdir= escape(g:NETRW_BOOKMARKDIR_{cnt},'. ')
+" call Decho('silent! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmark.'.bmdir.' :e '.bmdir)
+ exe 'silent! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks.'.bmdir.' :e '.bmdir."\<cr>"
endif
+ let cnt= cnt + 1
+ endwhile
- elseif g:netrw_sort_direction =~ 'r'
-" call Decho('reverse the sorted listing')
- exe 'silent keepjumps '.w:netrw_bannercnt.'g/^/m '.w:netrw_bannercnt
- endif
- endif
-
- " convert to wide/tree listing {{{3
-" call Decho("modify display if wide/tree listing style")
- call s:NetWideListing()
- call s:NetTreeListing(b:netrw_curdir)
-
- if exists("w:netrw_bannercnt") && line("$") > w:netrw_bannercnt
- " place cursor on the top-left corner of the file listing
-" call Decho("place cursor on top-left corner of file listing")
- exe 'silent '.w:netrw_bannercnt
- norm! 0
- endif
-
- " record previous current directory
- let w:netrw_prvdir= b:netrw_curdir
-" call Decho("record netrw_prvdir<".w:netrw_prvdir.">")
-
- " save certain window-oriented variables into buffer-oriented variables {{{3
- call s:SetBufWinVars()
- call s:NetOptionRestore()
-
- " set display to netrw display settings
-" call Decho("set display to netrw display settings (noma nomod etc)")
- setlocal noma nomod nonu nobl nowrap ro
- if exists("s:treecurpos")
- call setpos('.',s:treecurpos)
- unlet s:treecurpos
+ " show directory browsing history
+ let cnt = g:NETRW_DIRHIST_CNT
+ let first = 1
+ let histcnt = 0
+ while ( first || cnt != g:NETRW_DIRHIST_CNT )
+ let histcnt = histcnt + 1
+ let priority = g:NETRW_DIRHIST_CNT + histcnt
+ if exists("g:NETRW_DIRHIST_{cnt}")
+ let bmdir= escape(g:NETRW_DIRHIST_{cnt},'. ')
+" call Decho('silent! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.bmdir.' :e '.bmdir)
+ exe 'silent! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.bmdir.' :e '.bmdir."\<cr>"
+ endif
+ let first = 0
+ let cnt = ( cnt - 1 ) % g:netrw_dirhistmax
+ if cnt < 0
+ let cnt= cnt + g:netrw_dirhistmax
+ endif
+ endwhile
endif
-
-" call Dret("s:PerformListing : curpos<".string(getpos(".")).">")
+" call Dret("NetrwBookmarkMenu")
endfun
" ---------------------------------------------------------------------
-" s:NetBrowseChgDir: constructs a new directory based on the current {{{2
-" directory and a new directory name
-fun! s:NetBrowseChgDir(islocal,newdir,...)
-" call Dfunc("s:NetBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">")
+" s:NetrwBrowseChgDir: constructs a new directory based on the current {{{2
+" directory and a new directory name. Also, if the
+" "new directory name" is actually a file,
+" NetrwBrowseChgDir() edits the file.
+fun! s:NetrwBrowseChgDir(islocal,newdir,...)
+" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">")
if !exists("b:netrw_curdir")
-" call Decho("(NetBrowseChgDir) b:netrw_curdir doesn't exist!")
- echoerr "(NetBrowseChgDir) b:netrw_curdir doesn't exist!"
-" call Dret("s:NetBrowseChgDir")
+ " Don't try to change-directory: this can happen, for example, when netrw#ErrorMsg has been called
+ " and the current window is the NetrwMessage window.
+" call Decho("(NetrwBrowseChgDir) b:netrw_curdir doesn't exist!")
+" call Decho("getcwd<".getcwd().">")
+" call Dredir("ls!")
+" call Dret("s:NetrwBrowseChgDir")
return
endif
- call netrw#NetSavePosn()
- let nbcd_curpos = getpos('.')
- let dirname = substitute(b:netrw_curdir,'\\','/','ge')
- let newdir = a:newdir
+ call s:NetrwOptionSave("s:")
+ call s:NetrwSafeOptions()
+ let nbcd_curpos = netrw#NetrwSavePosn()
+ let s:nbcd_curpos_{bufnr('%')} = nbcd_curpos
+ let dirname = substitute(b:netrw_curdir,'\\','/','ge')
+ let newdir = a:newdir
+ let dolockout = 0
" set up o/s-dependent directory recognition pattern
if has("amiga")
@@ -2155,16 +2692,23 @@ fun! s:NetBrowseChgDir(islocal,newdir,...)
if dirname !~ dirpat
" apparently vim is "recognizing" that it is in a directory and
- " is removing the trailing "/". Bad idea, so I have to put it back.
+ " is removing the trailing "/". Bad idea, so I put it back.
let dirname= dirname.'/'
" call Decho("adjusting dirname<".dirname.">")
endif
if newdir !~ dirpat
- " handling a file
+ " ------------
+ " edit a file:
+ " ------------
" call Decho('case "handling a file": newdir<'.newdir.'> !~ dirpat<'.dirpat.">")
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") && newdir !~ '^\(/\|\a:\)'
- let dirname= s:NetTreeDir().newdir
+ let dirname= s:NetrwTreeDir()
+ if dirname =~ '/$'
+ let dirname= dirname.newdir
+ else
+ let dirname= s:NetrwTreeDir()."/".newdir
+ endif
" call Decho("tree listing")
elseif newdir =~ '^\(/\|\a:\)'
let dirname= newdir
@@ -2172,10 +2716,11 @@ fun! s:NetBrowseChgDir(islocal,newdir,...)
let dirname= s:ComposePath(dirname,newdir)
endif
" call Decho("handling a file: dirname<".dirname."> (a:0=".a:0.")")
- " this lets NetBrowseX avoid the edit
+ " this lets NetrwBrowseX avoid the edit
if a:0 < 1
-" call Decho("dirname<".dirname."> netrw_cd_escape<".s:netrw_cd_escape."> browse_split=".g:netrw_browse_split)
-" call Decho("about to edit<".escape(dirname,s:netrw_cd_escape)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist"))
+" call Decho("dirname<".dirname."> netrw_cd_escape<".g:netrw_cd_escape."> browse_split=".g:netrw_browse_split)
+" call Decho("set up windows for editing<".fnameescape(dirname)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist"))
+ call s:NetrwOptionRestore("s:")
if !exists("s:didsplit")
if g:netrw_browse_split == 1
new
@@ -2185,42 +2730,59 @@ fun! s:NetBrowseChgDir(islocal,newdir,...)
wincmd |
elseif g:netrw_browse_split == 3
tabnew
+ elseif g:netrw_browse_split == 4
+ if s:NetrwPrevWinOpen(2) == 3
+" call Dret("s:NetrwBrowseChgDir")
+ return
+ endif
else
" handling a file, didn't split, so remove menu
" call Decho("handling a file+didn't split, so remove menu")
- call s:NetMenu(0)
+ call s:NetrwMenu(0)
" optional change to window
- if g:netrw_chgwin >= 1
- exe g:netrw_chgwin."wincmd w"
+ if g:netrw_chgwin >= 1
+ exe "keepjumps ".g:netrw_chgwin."wincmd w"
endif
endif
endif
- " edit the file
- " its local only: LocalBrowseCheck() doesn't edit a file, but NetBrowse() will
+ " the point where netrw actually edits the (local) file
+ " if its local only: LocalBrowseCheck() doesn't edit a file, but NetrwBrowse() will
if a:islocal
-" call Decho("edit file: exe e! ".escape(dirname,s:netrw_cd_escape))
- exe "e! ".escape(dirname,s:netrw_cd_escape)
+" call Decho("edit local file: exe e! ".fnameescape(dirname))
+ exe "e! ".fnameescape(dirname)
+ else
+" call Decho("remote file: NetrwBrowse will edit it")
endif
- setlocal ma nomod noro
+ let dolockout= 1
endif
elseif newdir =~ '^/'
+ " ---------------------------------
" just go to the new directory spec
+ " ---------------------------------
" call Decho('case "just go to new directory spec": newdir<'.newdir.'>')
let dirname= newdir
+ call s:SetRexDir(a:islocal,dirname)
+ call s:NetrwOptionRestore("s:")
elseif newdir == './'
+ " --------------------------
" refresh the directory list
+ " --------------------------
" call Decho('case "refresh directory listing": newdir == "./"')
+ call s:SetRexDir(a:islocal,dirname)
elseif newdir == '../'
+ " -------------------
" go up one directory
+ " -------------------
" call Decho('case "go up one directory": newdir == "../"')
if w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
" force a refresh
" call Decho("clear buffer<".expand("%")."> with :%d")
setlocal noro ma
+" call Decho("setlocal noro ma")
keepjumps %d
endif
@@ -2248,16 +2810,18 @@ fun! s:NetBrowseChgDir(islocal,newdir,...)
endif
" call Decho("unix: dirname<".dirname."> (go up one dir)")
endif
+ call s:SetRexDir(a:islocal,dirname)
- elseif w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
+ elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
" call Decho('case liststyle is TREELIST and w:netrw_treedict exists')
- " force a refresh (for TREELIST, wait for NetTreeDir() to force the refresh)
+ " force a refresh (for TREELIST, wait for NetrwTreeDir() to force the refresh)
setlocal noro ma
+" call Decho("setlocal noro ma")
if !(exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir"))
" call Decho("clear buffer<".expand("%")."> with :%d")
keepjumps %d
endif
- let treedir = s:NetTreeDir()
+ let treedir = s:NetrwTreeDir()
let s:treecurpos = nbcd_curpos
let haskey= 0
" call Decho("w:netrw_treedict<".string(w:netrw_treedict).">")
@@ -2304,972 +2868,2597 @@ fun! s:NetBrowseChgDir(islocal,newdir,...)
let dirname= substitute(treedir,'/*$','/','')
" call Decho("go down one dir: treedir<".treedir.">")
endif
+ call s:SetRexDir(a:islocal,dirname)
else
" go down one directory
let dirname= s:ComposePath(dirname,newdir)
" call Decho("go down one dir: dirname<".dirname."> newdir<".newdir.">")
+ call s:SetRexDir(a:islocal,dirname)
+ endif
+
+ call s:NetrwOptionRestore("s:")
+ if dolockout
+" call Decho("doing modification lockout settings: ma nomod noro")
+ setlocal ma nomod noro
+" call Decho("setlocal ma nomod noro")
endif
-" call Dret("s:NetBrowseChgDir <".dirname."> : curpos<".string(getpos(".")).">")
+" call Dret("s:NetrwBrowseChgDir <".dirname."> : curpos<".string(getpos(".")).">")
return dirname
endfun
" ---------------------------------------------------------------------
-" s:NetHide: this function is invoked by the "a" map for browsing {{{2
-" and switches the hiding mode
-fun! s:NetHide(islocal)
-" call Dfunc("NetHide(islocal=".a:islocal.")")
- let g:netrw_hide=(g:netrw_hide+1)%3
- exe "norm! 0"
- if g:netrw_hide && g:netrw_list_hide == ""
- call netrw#ErrorMsg(s:WARNING,"your hiding list is empty!",49)
-" call Dret("NetHide")
- return
+" s:NetrwBrowseX: allows users to write custom functions to operate on {{{2
+" files given their extension. Passes 0=local, 1=remote
+fun! netrw#NetrwBrowseX(fname,remote)
+" call Dfunc("NetrwBrowseX(fname<".a:fname."> remote=".a:remote.")")
+
+ " set up the filename
+ " (lower case the extension, make a local copy of a remote file)
+ let exten= substitute(a:fname,'.*\.\(.\{-}\)','\1','e')
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ let exten= substitute(exten,'^.*$','\L&\E','')
+ endif
+ let fname= escape(a:fname,"%#")
+" call Decho("fname<".fname."> after escape()")
+
+ " seems kde systems often have gnome-open due to dependencies, even though
+ " gnome-open's subsidiary display tools are largely absent. Kde systems
+ " usually have "kdeinit" running, though... (tnx Mikolaj Machowski)
+ if !exists("s:haskdeinit")
+ if has("unix")
+ let s:haskdeinit= s:System("system",'ps -e') =~ 'kdeinit'
+ if v:shell_error
+ let s:haskdeinit = 0
+ endif
+ else
+ let s:haskdeinit= 0
endif
- call netrw#NetSavePosn()
- call s:NetRefresh(a:islocal,s:NetBrowseChgDir(a:islocal,'./'))
-" call Dret("NetHide")
-endfun
+" call Decho("setting s:haskdeinit=".s:haskdeinit)
+ endif
-" ---------------------------------------------------------------------
+ if a:remote == 1
+ " create a local copy
+ let fname= fnamemodify(tempname(),":r").".".exten
+" call Decho("a:remote=".a:remote.": create a local copy of <".a:fname."> as <".fname.">")
+ exe "silent keepjumps bot 1new ".a:fname
+ setlocal bh=delete
+" call Decho("read <".fname.">, now writing: exe w! ".fname)
+ exe "silent! w! ".fname
+ q
+ endif
+" call Decho("exten<".exten."> "."netrwFileHandlers#NFH_".exten."():exists=".exists("*netrwFileHandlers#NFH_".exten))
-" ===========================================
-" s:NetPreview: {{{2
-fun! s:NetPreview(path) range
-" call Dfunc("NetPreview(path<".a:path.">)")
- if has("quickfix")
- if !isdirectory(a:path)
- exe "pedit ".escape(a:path,g:netrw_fname_escape)
- elseif !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:WARNING,"sorry, cannot preview a directory such as <".a:path.">",38)
+ " set up redirection
+ if &srr =~ "%s"
+ if (has("win32") || has("win95") || has("win64") || has("win16"))
+ let redir= substitute(&srr,"%s","nul","")
+ else
+ let redir= substitute(&srr,"%s","/dev/null","")
endif
- elseif !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:WARNING,"sorry, to preview your vim needs the quickfix feature compiled in",39)
+ elseif (has("win32") || has("win95") || has("win64") || has("win16"))
+ let redir= &srr . "nul"
+ else
+ let redir= &srr . "/dev/null"
endif
-" call Dret("NetPreview")
-endfun
+" call Decho("redir{".redir."} srr{".&srr."}")
-" ---------------------------------------------------------------------
-" s:NetSortStyle: change sorting style (name - time - size) and refresh display {{{2
-fun! s:NetSortStyle(islocal)
-" call Dfunc("s:NetSortStyle(islocal=".a:islocal.") netrw_sort_by<".g:netrw_sort_by.">")
- call s:NetSaveWordPosn()
+ " extract any viewing options. Assumes that they're set apart by quotes.
+ if exists("g:netrw_browsex_viewer")
+ if g:netrw_browsex_viewer =~ '\s'
+ let viewer = substitute(g:netrw_browsex_viewer,'\s.*$','','')
+ let viewopt = substitute(g:netrw_browsex_viewer,'^\S\+\s*','','')." "
+ let oviewer = ''
+ let cnt = 1
+ while !executable(viewer) && viewer != oviewer
+ let viewer = substitute(g:netrw_browsex_viewer,'^\(\(^\S\+\s\+\)\{'.cnt.'}\S\+\)\(.*\)$','\1','')
+ let viewopt = substitute(g:netrw_browsex_viewer,'^\(\(^\S\+\s\+\)\{'.cnt.'}\S\+\)\(.*\)$','\3','')." "
+ let cnt = cnt + 1
+ let oviewer = viewer
+" call Decho("!exe: viewer<".viewer."> viewopt<".viewopt.">")
+ endwhile
+ else
+ let viewer = g:netrw_browsex_viewer
+ let viewopt = ""
+ endif
+" call Decho("viewer<".viewer."> viewopt<".viewopt.">")
+ endif
- let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'
- norm! 0
- call netrw#NetSavePosn()
- call s:NetRefresh(a:islocal,s:NetBrowseChgDir(a:islocal,'./'))
+ " execute the file handler
+ if exists("g:netrw_browsex_viewer") && g:netrw_browsex_viewer == '-'
+" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">")
+ let ret= netrwFileHandlers#Invoke(exten,fname)
+
+ elseif exists("g:netrw_browsex_viewer") && executable(viewer)
+" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">")
+" call Decho("exe silent !".viewer." ".viewopt.shellescape(fname).redir)
+ exe "silent !".viewer." ".viewopt.shellescape(fname).redir
+ let ret= v:shell_error
+
+ elseif has("win32") || has("win64")
+" call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname))
+ exe 'silent !start rundll32 url.dll,FileProtocolHandler '.shellescape(fname)
+ call inputsave()|call input("Press <cr> to continue")|call inputrestore()
+ let ret= v:shell_error
+
+ elseif has("unix") && executable("gnome-open") && !s:haskdeinit
+" call Decho("exe silent !gnome-open ".shellescape(fname)." ".redir)
+ exe "silent !gnome-open ".shellescape(fname).redir
+ let ret= v:shell_error
+
+ elseif has("unix") && executable("kfmclient") && s:haskdeinit
+" call Decho("exe silent !kfmclient exec ".shellescape(fname)." ".redir)
+ exe "silent !kfmclient exec ".shellescape(fname)." ".redir
+ let ret= v:shell_error
+
+ elseif has("macunix") && executable("open")
+" call Decho("exe silent !open ".shellescape(fname)." ".redir)
+ exe "silent !open ".shellescape(fname)." ".redir
+ let ret= v:shell_error
+
+ else
+ " netrwFileHandlers#Invoke() always returns 0
+ let ret= netrwFileHandlers#Invoke(exten,fname)
+ endif
-" call Dret("s:NetSortStyle : netrw_sort_by<".g:netrw_sort_by.">")
+ " if unsuccessful, attempt netrwFileHandlers#Invoke()
+ if ret
+ let ret= netrwFileHandlers#Invoke(exten,fname)
+ endif
+
+" redraw!
+
+ " cleanup: remove temporary file,
+ " delete current buffer if success with handler,
+ " return to prior buffer (directory listing)
+ " Feb 12, 2008: had to de-activiate removal of
+ " temporary file because it wasn't getting seen.
+" if a:remote == 1 && fname != a:fname
+" call Decho("deleting temporary file<".fname.">")
+" call s:System("delete",fname)
+" endif
+
+ if a:remote == 1
+ setlocal bh=delete bt=nofile
+ if g:netrw_use_noswf
+ setlocal noswf
+ endif
+ exe "norm! \<c-o>"
+" redraw!
+ endif
+
+" call Dret("NetrwBrowseX")
endfun
" ---------------------------------------------------------------------
-" Remote Directory Browsing Support: {{{1
-" ===========================================
+" netrw#Explore: launch the local browser in the directory of the current file {{{2
+" dosplit==0: the window will be split iff the current file has
+" been modified
+" dosplit==1: the window will be split before running the local
+" browser
+fun! netrw#Explore(indx,dosplit,style,...)
+" call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified." a:0=".a:0)
+ if !exists("b:netrw_curdir")
+ let b:netrw_curdir= getcwd()
+" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)")
+ endif
+ let curfile= b:netrw_curdir
+" call Decho("curfile<".curfile.">")
-" ---------------------------------------------------------------------
-" s:RemoteListing: {{{2
-fun! s:RemoteListing()
-" call Dfunc("s:RemoteListing() b:netrw_curdir<".b:netrw_curdir.">)")
+ " save registers
+ silent! let keepregstar = @*
+ silent! let keepregplus = @+
+ silent! let keepregslash= @/
- call s:RemotePathAnalysis(b:netrw_curdir)
+ " if dosplit or file has been modified
+ if a:dosplit || &modified || a:style == 6
+" call Decho("case: dosplit=".a:dosplit." modified=".&modified." a:style=".a:style)
+ call s:SaveWinVars()
- " sanity check:
- if exists("b:netrw_method") && b:netrw_method =~ '[235]'
-" call Decho("b:netrw_method=".b:netrw_method)
- if !executable("ftp")
- if !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ftp",18)
- endif
- call s:NetOptionRestore()
-" call Dret("s:RemoteListing")
- return
+ if a:style == 0 " Explore, Sexplore
+" call Decho("style=0: Explore or Sexplore")
+ exe g:netrw_winsize."wincmd s"
+
+ elseif a:style == 1 "Explore!, Sexplore!
+" call Decho("style=1: Explore! or Sexplore!")
+ exe g:netrw_winsize."wincmd v"
+
+ elseif a:style == 2 " Hexplore
+" call Decho("style=2: Hexplore")
+ exe "bel ".g:netrw_winsize."wincmd s"
+
+ elseif a:style == 3 " Hexplore!
+" call Decho("style=3: Hexplore!")
+ exe "abo ".g:netrw_winsize."wincmd s"
+
+ elseif a:style == 4 " Vexplore
+" call Decho("style=4: Vexplore")
+ exe "lefta ".g:netrw_winsize."wincmd v"
+
+ elseif a:style == 5 " Vexplore!
+" call Decho("style=5: Vexplore!")
+ exe "rightb ".g:netrw_winsize."wincmd v"
+
+ elseif a:style == 6 " Texplore
+ call s:SaveBufVars()
+" call Decho("style = 6: Texplore")
+ tabnew
+ call s:RestoreBufVars()
endif
+ call s:RestoreWinVars()
+ endif
+ norm! 0
- elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == ''
- if !exists("g:netrw_quiet")
- if g:netrw_list_cmd == ""
- call netrw#ErrorMsg(s:ERROR,g:netrw_ssh_cmd." is not executable on your system",47)
- else
- call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ".g:netrw_list_cmd,19)
+ if a:0 > 0
+" call Decho("case [a:0=".a:0."]>0: a:1<".a:1.">")
+ if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin))
+ let dirname= substitute(a:1,'\~',expand("$HOME"),'')
+" call Decho("using dirname<".dirname."> (case: ~ && unix||cygwin)")
+ elseif a:1 == '.'
+ let dirname= exists("b:netrw_curdir")? b:netrw_curdir : getcwd()
+ if dirname !~ '/$'
+ let dirname= dirname."/"
endif
+" call Decho("using dirname<".dirname."> (case: ".(exists("b:netrw_curdir")? "b:netrw_curdir" : "getcwd()").")")
+ elseif a:1 =~ '\$'
+ let dirname= expand(a:1)
+ else
+ let dirname= a:1
+" call Decho("using dirname<".dirname.">")
endif
-
- call s:NetOptionRestore()
-" call Dret("s:RemoteListing")
+ else
+ " clear explore
+" call Decho("clearing explore variables")
+ 2match none
+ if exists("s:explore_match") |unlet s:explore_match |endif
+ if exists("s:explore_indx") |unlet s:explore_indx |endif
+ if exists("s:dirstarstar") |unlet s:dirstarstar |endif
+ if exists("s:dirstarstar") |unlet s:dirstarstar |endif
+ if exists("w:netrw_explore_indx") |unlet w:netrw_explore_indx |endif
+ if exists("w:netrw_explore_listlen")|unlet w:netrw_explore_listlen|endif
+ if exists("w:netrw_explore_list") |unlet w:netrw_explore_list |endif
+ if exists("w:netrw_explore_bufnr") |unlet w:netrw_explore_bufnr |endif
+" redraw!
+ echo " "
+ echo " "
+" call Dret("netrw#Explore : cleared list")
return
- endif " (remote handling sanity check)
+ endif
- if exists("b:netrw_method")
-" call Decho("setting w:netrw_method<".b:netrw_method.">")
- let w:netrw_method= b:netrw_method
+ if dirname =~ '/\*\*/'
+ " handle .../**/.../filepat
+" call Decho("case Explore .../**/.../filepat")
+ let prefixdir= substitute(dirname,'^\(.\{-}\)\*\*.*$','\1','')
+ if prefixdir =~ '^/' || (prefixdir =~ '^\a:/' && (has("win32") || has("win95") || has("win64") || has("win16")))
+ let b:netrw_curdir = prefixdir
+ else
+ let b:netrw_curdir= getcwd().'/'.prefixdir
+ endif
+ let dirname= substitute(dirname,'^.\{-}\(\*\*/.*\)$','\1','')
+ let starpat= 4;
+" call Decho("pwd<".getcwd()."> dirname<".dirname.">")
+" call Decho("case Explore ../**/../filepat (starpat=".starpat.")")
+
+ elseif dirname =~ '^\*//'
+ " starpat=1: Explore *//pattern (current directory only search for files containing pattern)
+" call Decho("case Explore *//pattern")
+ let pattern= substitute(dirname,'^\*//\(.*\)$','\1','')
+ let starpat= 1
+" call Decho("Explore *//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">")
+ if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
+
+ elseif dirname =~ '^\*\*//'
+ " starpat=2: Explore **//pattern (recursive descent search for files containing pattern)
+" call Decho("case Explore **//pattern")
+ let pattern= substitute(dirname,'^\*\*//','','')
+ let starpat= 2
+" call Decho("Explore **//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">")
+
+ elseif dirname =~ '^\*/'
+ " starpat=3: Explore */filepat (search in current directory for filenames matching filepat)
+ let starpat= 3
+" call Decho("case Explore */filepat (starpat=".starpat.")")
+
+ elseif dirname=~ '^\*\*/'
+ " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat)
+ let starpat= 4
+" call Decho("case Explore **/filepat (starpat=".starpat.")")
+ else
+ let starpat= 0
endif
- if s:method == "ftp"
- " use ftp to get remote file listing
-" call Decho("use ftp to get remote file listing")
- let s:method = "ftp"
- let listcmd = g:netrw_ftp_list_cmd
- if g:netrw_sort_by =~ '^t'
- let listcmd= g:netrw_ftp_timelist_cmd
- elseif g:netrw_sort_by =~ '^s'
- let listcmd= g:netrw_ftp_sizelist_cmd
+ if starpat == 0 && a:indx >= 0
+ " [Explore Hexplore Vexplore Sexplore] [dirname]
+" call Decho("case dirname<".dirname."> a:indx=".a:indx.": Explore Hexplore Vexplore Sexplore")
+ if dirname == ""
+ let dirname= substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e')
+ endif
+ if dirname =~ '^scp:' || dirname =~ '^ftp:'
+" call Decho("calling NetrwBrowse(0,dirname<".dirname.">)")
+ call s:NetrwBrowse(0,dirname)
+ else
+ if dirname == ""|let dirname= getcwd()|endif
+" call Decho("calling LocalBrowseCheck(dirname<".dirname.">)")
+ call netrw#LocalBrowseCheck(dirname)
endif
-" call Decho("listcmd<".listcmd."> (using g:netrw_ftp_list_cmd)")
- call s:NetBrowseFtpCmd(s:path,listcmd)
-" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))'
- if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
- " shorten the listing
-" call Decho("generate short listing")
- exe "keepjumps ".w:netrw_bannercnt
+" call Decho("curfile<".curfile.">")
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ call search('\<'.substitute(curfile,'^.*[/\\]','','e').'\>','cW')
+ else
+ call search('\<'.substitute(curfile,'^.*/','','e').'\>','cW')
+ endif
- " cleanup
- if g:netrw_ftp_browse_reject != ""
- exe "silent! g/".g:netrw_ftp_browse_reject."/keepjumps d"
+ " starpat=1: Explore *//pattern (current directory only search for files containing pattern)
+ " starpat=2: Explore **//pattern (recursive descent search for files containing pattern)
+ " starpat=3: Explore */filepat (search in current directory for filenames matching filepat)
+ " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat)
+ elseif a:indx <= 0
+ " Nexplore, Pexplore, Explore: handle starpat
+" call Decho("case Nexplore, Pexplore, <s-down>, <s-up>: starpat=".starpat." a:indx=".a:indx)
+ if !mapcheck("<s-up>","n") && !mapcheck("<s-down>","n") && exists("b:netrw_curdir")
+" call Decho("set up <s-up> and <s-down> maps")
+ let s:didstarstar= 1
+ nnoremap <buffer> <silent> <s-up> :Pexplore<cr>
+ nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
+ endif
+
+ if has("path_extra")
+" call Decho("starpat=".starpat.": has +path_extra")
+ if !exists("w:netrw_explore_indx")
+ let w:netrw_explore_indx= 0
endif
- silent! keepjumps %s/\r$//e
+ let indx = a:indx
+" call Decho("starpat=".starpat.": set indx= [a:indx=".indx."]")
+"
+ if indx == -1
+ " Nexplore
+" call Decho("case Nexplore with starpat=".starpat.": (indx=".indx.")")
+ if !exists("w:netrw_explore_list") " sanity check
+ call netrw#ErrorMsg(s:WARNING,"using Nexplore or <s-down> improperly; see help for netrw-starstar",40)
+ silent! let @* = keepregstar
+ silent! let @+ = keepregstar
+ silent! let @/ = keepregslash
+" call Dret("netrw#Explore")
+ return
+ endif
+ let indx= w:netrw_explore_indx
+ if indx < 0 | let indx= 0 | endif
+ if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif
+ let curfile= w:netrw_explore_list[indx]
+" call Decho("indx=".indx." curfile<".curfile.">")
+ while indx < w:netrw_explore_listlen && curfile == w:netrw_explore_list[indx]
+ let indx= indx + 1
+" call Decho("indx=".indx." (Nexplore while loop)")
+ endwhile
+ if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif
+" call Decho("Nexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx)
- " if there's no ../ listed, then put ./ and ../ in
- let line1= line(".")
- exe "keepjumps ".w:netrw_bannercnt
- let line2= search('^\.\.\/\%(\s\|$\)','cnW')
- if line2 == 0
-" call Decho("netrw is putting ./ and ../ into listing")
- keepjumps put='../'
- keepjumps put='./'
+ elseif indx == -2
+ " Pexplore
+" call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")")
+ if !exists("w:netrw_explore_list") " sanity check
+ call netrw#ErrorMsg(s:WARNING,"using Pexplore or <s-up> improperly; see help for netrw-starstar",41)
+ silent! let @* = keepregstar
+ silent! let @+ = keepregstar
+ silent! let @/ = keepregslash
+" call Dret("netrw#Explore")
+ return
+ endif
+ let indx= w:netrw_explore_indx
+ if indx < 0 | let indx= 0 | endif
+ if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif
+ let curfile= w:netrw_explore_list[indx]
+" call Decho("indx=".indx." curfile<".curfile.">")
+ while indx >= 0 && curfile == w:netrw_explore_list[indx]
+ let indx= indx - 1
+" call Decho("indx=".indx." (Pexplore while loop)")
+ endwhile
+ if indx < 0 | let indx= 0 | endif
+" call Decho("Pexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx)
+
+ else
+ " Explore -- initialize
+ " build list of files to Explore with Nexplore/Pexplore
+" call Decho("starpat=".starpat.": case Explore: initialize (indx=".indx.")")
+ let w:netrw_explore_indx= 0
+ if !exists("b:netrw_curdir")
+ let b:netrw_curdir= getcwd()
+ endif
+" call Decho("starpat=".starpat.": b:netrw_curdir<".b:netrw_curdir.">")
+
+ " switch on starpat to build the w:netrw_explore_list of files
+ if starpat == 1
+ " starpat=1: Explore *//pattern (current directory only search for files containing pattern)
+" call Decho("starpat=".starpat.": build *//pattern list")
+ exe "vimgrep /".pattern."/gj ".b:netrw_curdir."/*"
+ let w:netrw_explore_list = map(getqflist(),'bufname(v:val.bufnr)')
+ if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
+
+ elseif starpat == 2
+ " starpat=2: Explore **//pattern (recursive descent search for files containing pattern)
+" call Decho("starpat=".starpat.": build **//pattern list")
+ try
+ exe "silent vimgrep /".pattern."/gj "."**/*"
+ catch /^Vim\%((\a\+)\)\=:E480/
+ call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45)
+ if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
+ silent! let @* = keepregstar
+ silent! let @+ = keepregstar
+ silent! let @/ = keepregslash
+" call Dret("netrw#Explore : no files matched pattern")
+ return
+ endtry
+ let s:netrw_curdir = b:netrw_curdir
+ let w:netrw_explore_list = getqflist()
+ let w:netrw_explore_list = map(w:netrw_explore_list,'s:netrw_curdir."/".bufname(v:val.bufnr)')
+
+ elseif starpat == 3
+ " starpat=3: Explore */filepat (search in current directory for filenames matching filepat)
+" call Decho("starpat=".starpat.": build */filepat list")
+ let dirname = substitute(dirname,'^\*/','','')
+ let w:netrw_explore_list= split(expand(b:netrw_curdir."/".dirname),'\n')
+ if &hls | let keepregslash= s:ExplorePatHls(dirname) | endif
+
+ elseif starpat == 4
+ " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat)
+" call Decho("starpat=".starpat.": build **/filepat list")
+ let w:netrw_explore_list= split(expand(b:netrw_curdir."/".dirname),'\n')
+ if &hls | let keepregslash= s:ExplorePatHls(dirname) | endif
+ endif " switch on starpat to build w:netrw_explore_list
+
+ let w:netrw_explore_listlen = len(w:netrw_explore_list)
+" call Decho("w:netrw_explore_list<".string(w:netrw_explore_list).">")
+" call Decho("w:netrw_explore_listlen=".w:netrw_explore_listlen)
+
+ if w:netrw_explore_listlen == 0 || (w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/')
+ call netrw#ErrorMsg(s:WARNING,"no files matched",42)
+ silent! let @* = keepregstar
+ silent! let @+ = keepregstar
+ silent! let @/ = keepregslash
+" call Dret("netrw#Explore : no files matched")
+ return
+ endif
+ endif " if indx ... endif
+
+ " NetrwStatusLine support - for exploring support
+ let w:netrw_explore_indx= indx
+" call Decho("explorelist<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen)
+
+ " wrap the indx around, but issue a note
+ if indx >= w:netrw_explore_listlen || indx < 0
+" call Decho("wrap indx (indx=".indx." listlen=".w:netrw_explore_listlen.")")
+ let indx = (indx < 0)? ( w:netrw_explore_listlen - 1 ) : 0
+ let w:netrw_explore_indx= indx
+ call netrw#ErrorMsg(s:NOTE,"no more files match Explore pattern",43)
+ sleep 1
endif
- exe "keepjumps ".line1
- keepjumps norm! 0
-" call Decho("line1=".line1." line2=".line2." line(.)=".line("."))
- if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup
-" call Decho("M$ ftp cleanup")
- exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+//'
- else " normal ftp cleanup
-" call Decho("normal ftp cleanup")
- exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e'
- exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e'
- exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e'
+ exe "let dirfile= w:netrw_explore_list[".indx."]"
+" call Decho("dirfile=w:netrw_explore_list[indx=".indx."]= <".dirfile.">")
+ let newdir= substitute(dirfile,'/[^/]*$','','e')
+" call Decho("newdir<".newdir.">")
+
+" call Decho("calling LocalBrowseCheck(newdir<".newdir.">)")
+ call netrw#LocalBrowseCheck(newdir)
+ if !exists("w:netrw_liststyle")
+ let w:netrw_liststyle= g:netrw_liststyle
+ endif
+ if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:LONGLIST
+ call search('^'.substitute(dirfile,"^.*/","","").'\>',"W")
+ else
+ call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w")
+ endif
+ let w:netrw_explore_mtchcnt = indx + 1
+ let w:netrw_explore_bufnr = bufnr("%")
+ let w:netrw_explore_line = line(".")
+ call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}')
+" call Decho("explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line)
+
+ else
+" call Decho("your vim does not have +path_extra")
+ if !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44)
endif
+ silent! let @* = keepregstar
+ silent! let @+ = keepregstar
+ silent! let @/ = keepregslash
+" call Dret("netrw#Explore : missing +path_extra")
+ return
endif
else
- " use ssh to get remote file listing {{{3
-" call Decho("use ssh to get remote file listing: s:netrw_shq<".g:netrw_shq."> s:path<".s:path."> s:netrw_cd_escape<".s:netrw_cd_escape.">")
- let listcmd= s:MakeSshCmd(g:netrw_list_cmd)
-" call Decho("listcmd<".listcmd."> (using g:netrw_list_cmd)")
- if g:netrw_scp_cmd =~ '^pscp'
-" call Decho("1: exe silent r! ".listcmd.g:netrw_shq.s:path.g:netrw_shq)
- exe "silent r! ".listcmd.g:netrw_shq.s:path.g:netrw_shq
- " remove rubbish and adjust listing format of 'pscp' to 'ssh ls -FLa' like
- g/^Listing directory/d
- g/^d[-rwx][-rwx][-rwx]/s+$+/+e
- silent g/^l[-rwx][-rwx][-rwx]/s+$+@+e
- if g:netrw_liststyle != s:LONGLIST
- g/^[dlsp-][-rwx][-rwx][-rwx]/s/^.*\s\(\S\+\)$/\1/e
- endif
+" call Decho("case Explore newdir<".dirname.">")
+ if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && dirname =~ '/'
+ silent! unlet w:netrw_treedict
+ silent! unlet w:netrw_treetop
+ endif
+ let newdir= dirname
+ if !exists("b:netrw_curdir")
+ call netrw#LocalBrowseCheck(getcwd())
else
- if s:path == ""
-" call Decho("2: exe silent r! ".listcmd)
- exe "silent r! ".listcmd
- else
-" call Decho("3: exe silent r! ".listcmd." ".g:netrw_shq.s:path.g:netrw_shq)
- exe "silent r! ".listcmd." ".g:netrw_shq.s:path.g:netrw_shq
- endif
+ call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,newdir))
endif
+ endif
- " cleanup
- if g:netrw_ftp_browse_reject != ""
-" call Decho("(cleanup) exe silent! g/".g:netrw_ssh_browse_reject."/keepjumps d")
- exe "silent! g/".g:netrw_ssh_browse_reject."/keepjumps d"
+ " visual display of **/ **// */ Exploration files
+ if exists("w:netrw_explore_indx") && exists("b:netrw_curdir")
+ if !exists("s:explore_prvdir") || s:explore_prvdir != b:netrw_curdir
+ " only update match list if current directory isn't the same as before
+ let s:explore_prvdir = b:netrw_curdir
+ let s:explore_match = ""
+ let dirlen = strlen(b:netrw_curdir)
+ if b:netrw_curdir !~ '/$'
+ let dirlen= dirlen + 1
+ endif
+ let prvfname= ""
+ for fname in w:netrw_explore_list
+" call Decho("fname<".fname.">")
+ if fname =~ '^'.b:netrw_curdir
+ if s:explore_match == ""
+ let s:explore_match= '\<'.escape(strpart(fname,dirlen),g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>'
+ else
+ let s:explore_match= s:explore_match.'\|\<'.escape(strpart(fname,dirlen),g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>'
+ endif
+ elseif fname !~ '^/' && fname != prvfname
+ if s:explore_match == ""
+ let s:explore_match= '\<'.escape(fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>'
+ else
+ let s:explore_match= s:explore_match.'\|\<'.escape(fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>'
+ endif
+ endif
+ let prvfname= fname
+ endfor
+" call Decho("explore_match<".s:explore_match.">")
+ exe "2match netrwMarkFile /".s:explore_match."/"
endif
+ echo "<s-up>==Pexplore <s-down>==Nexplore"
+ else
+ 2match none
+ if exists("s:explore_match") | unlet s:explore_match | endif
+ if exists("s:explore_prvdir") | unlet s:explore_prvdir | endif
+ echo " "
+" call Decho("cleared explore match list")
endif
- if w:netrw_liststyle == s:LONGLIST
- " do a long listing; these substitutions need to be done prior to sorting {{{3
-" call Decho("fix long listing:")
+ silent! let @* = keepregstar
+ silent! let @+ = keepregstar
+ silent! let @/ = keepregslash
+" call Dret("netrw#Explore : @/<".@/.">")
+endfun
- if s:method == "ftp"
- " cleanup
- exe "keepjumps ".w:netrw_bannercnt
- while getline(".") =~ g:netrw_ftp_browse_reject
- keepjumps d
- endwhile
- " if there's no ../ listed, then put ./ and ../ in
- let line1= line(".")
- keepjumps 1
- silent keepjumps call search('^\.\.\/\%(\s\|$\)','W')
- let line2= line(".")
- if line2 == 0
- exe 'keepjumps '.w:netrw_bannercnt."put='./'"
- if b:netrw_curdir != '/'
- exe 'keepjumps '.w:netrw_bannercnt."put='../'"
+" ---------------------------------------------------------------------
+" s:NetrwHide: this function is invoked by the "a" map for browsing {{{2
+" and switches the hiding mode. The actual hiding is done by
+" s:NetrwListHide().
+" g:netrw_hide= 0: show all
+" 1: show not-hidden files
+" 2: show hidden files only
+fun! s:NetrwHide(islocal)
+" call Dfunc("NetrwHide(islocal=".a:islocal.") g:netrw_hide=".g:netrw_hide)
+ let svpos= netrw#NetrwSavePosn()
+
+ if exists("s:netrwmarkfilelist_{bufnr('%')}")
+" call Decho(((g:netrw_hide == 1)? "unhide" : "hide")." files in markfilelist<".string(s:netrwmarkfilelist_{bufnr("%")}).">")
+" call Decho("g:netrw_list_hide<".g:netrw_list_hide.">")
+
+ " hide the files in the markfile list
+ for fname in s:netrwmarkfilelist_{bufnr("%")}
+" call Decho("match(g:netrw_list_hide<".g:netrw_list_hide.'> fname<\<'.fname.'\>>)='.match(g:netrw_list_hide,'\<'.fname.'\>')." isk=".&isk)
+ if match(g:netrw_list_hide,'\<'.fname.'\>') != -1
+ " remove fname from hiding list
+ let g:netrw_list_hide= substitute(g:netrw_list_hide,'..\<'.escape(fname,g:netrw_fname_escape).'\>..','','')
+ let g:netrw_list_hide= substitute(g:netrw_list_hide,',,',',','g')
+ let g:netrw_list_hide= substitute(g:netrw_list_hide,'^,\|,$','','')
+" call Decho("unhide: g:netrw_list_hide<".g:netrw_list_hide.">")
+ else
+ " append fname to hiding list
+ if exists("g:netrw_list_hide") && g:netrw_list_hide != ""
+ let g:netrw_list_hide= g:netrw_list_hide.',\<'.escape(fname,g:netrw_fname_escape).'\>'
+ else
+ let g:netrw_list_hide= '\<'.escape(fname,g:netrw_fname_escape).'\>'
endif
+" call Decho("hide: g:netrw_list_hide<".g:netrw_list_hide.">")
endif
- exe "keepjumps ".line1
- keepjumps norm! 0
- endif
+ endfor
+ unlet s:netrwmarkfilelist_{bufnr("%")}
+ unlet s:netrwmarkfilemtch_{bufnr("%")}
+ 2match none
+ let g:netrw_hide= 1
- if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup
-" call Decho("M$ ftp site listing cleanup")
- exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+\)\(\w.*\)$/\2\t\1/'
- elseif exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$")
-" call Decho("normal ftp site listing cleanup: bannercnt=".w:netrw_bannercnt." line($)=".line("$"))
- exe 'silent keepjumps '.w:netrw_bannercnt.',$s/ -> .*$//e'
- exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e'
- exe 'silent keepjumps '.w:netrw_bannercnt
+ else
+
+ " switch between show-all/show-not-hidden/show-hidden
+ let g:netrw_hide=(g:netrw_hide+1)%3
+ exe "norm! 0"
+ if g:netrw_hide && g:netrw_list_hide == ""
+ call netrw#ErrorMsg(s:WARNING,"your hiding list is empty!",49)
+" call Dret("NetrwHide")
+ return
endif
endif
-" if exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$") " Decho
-" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."))'
-" endif " Decho
-" call Dret("s:RemoteListing")
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+" call Dret("NetrwHide")
endfun
" ---------------------------------------------------------------------
-" NetGetWord: it gets the directory named under the cursor {{{2
-fun! s:NetGetWord()
-" call Dfunc("NetGetWord() line#".line(".")." liststyle=".g:netrw_liststyle." virtcol=".virtcol("."))
- call s:UseBufWinVars()
+" s:NetrwHidden: invoked by "gh" {{{2
+fun! s:NetrwHidden(islocal)
+" call Dfunc("s:NetrwHidden()")
+ " save current position
+ let svpos= netrw#NetrwSavePosn()
+
+ if g:netrw_list_hide =~ '\(^\|,\)\\(^\\|\\s\\s\\)\\zs\\.\\S\\+'
+ " remove pattern from hiding list
+ let g:netrw_list_hide= substitute(g:netrw_list_hide,'\(^\|,\)\\(^\\|\\s\\s\\)\\zs\\.\\S\\+','','')
+ elseif strlen(g:netrw_list_hide) >= 1
+ let g:netrw_list_hide= g:netrw_list_hide . ',\(^\|\s\s\)\zs\.\S\+'
+ else
+ let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
+ endif
- " insure that w:netrw_liststyle is set up
- if !exists("w:netrw_liststyle")
- if exists("g:netrw_liststyle")
- let w:netrw_liststyle= g:netrw_liststyle
+ " refresh screen and return to saved position
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+" call Dret("s:NetrwHidden")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwLeftmouse: handles the <leftmouse> when in a netrw browsing window {{{2
+fun! s:NetrwLeftmouse(islocal)
+" call Dfunc("s:NetrwLeftmouse(islocal=".a:islocal.")")
+ if a:islocal
+ if exists("b:netrw_curdir")
+ call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+ endif
+ else
+ if exists("b:netrw_curdir")
+ call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
+ endif
+ endif
+" call Dret("s:NetrwLeftmouse")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwListHide: uses [range]g~...~d to delete files that match comma {{{2
+" separated patterns given in g:netrw_list_hide
+fun! s:NetrwListHide()
+" call Dfunc("NetrwListHide() hide=".g:netrw_hide." listhide<".g:netrw_list_hide.">")
+
+ " find a character not in the "hide" string to use as a separator for :g and :v commands
+ " How-it-works: take the hiding command, convert it into a range. Duplicate
+ " characters don't matter. Remove all such characters from the '/~...90'
+ " string. Use the first character left as a separator character.
+ let listhide= g:netrw_list_hide
+ let sep = strpart(substitute('/~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1)
+" call Decho("sep=".sep)
+
+ while listhide != ""
+ if listhide =~ ','
+ let hide = substitute(listhide,',.*$','','e')
+ let listhide = substitute(listhide,'^.\{-},\(.*\)$','\1','e')
else
- let w:netrw_liststyle= s:THINLIST
+ let hide = listhide
+ let listhide = ""
endif
-" call Decho("w:netrw_liststyle=".w:netrw_liststyle)
+
+ " Prune the list by hiding any files which match
+ if g:netrw_hide == 1
+" call Decho("hiding<".hide."> listhide<".listhide.">")
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d'
+ elseif g:netrw_hide == 2
+" call Decho("showing<".hide."> listhide<".listhide.">")
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @'
+ endif
+ endwhile
+ if g:netrw_hide == 2
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d'
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e'
endif
- if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt
- " Active Banner support
-" call Decho("active banner handling")
- norm! 0
- let dirname= "./"
- let curline= getline(".")
+" call Dret("NetrwListHide")
+endfun
- if curline =~ '"\s*Sorted by\s'
- norm s
- let s:netrw_skipbrowse= 1
- echo 'Pressing "s" also works'
+" ---------------------------------------------------------------------
+" NetrwHideEdit: allows user to edit the file/directory hiding list
+fun! s:NetrwHideEdit(islocal)
+" call Dfunc("NetrwHideEdit(islocal=".a:islocal.")")
- elseif curline =~ '"\s*Sort sequence:'
- let s:netrw_skipbrowse= 1
- echo 'Press "S" to edit sorting sequence'
+ " save current cursor position
+ let svpos= netrw#NetrwSavePosn()
- elseif curline =~ '"\s*Quick Help:'
- norm ?
- let s:netrw_skipbrowse= 1
- echo 'Pressing "?" also works'
+ " get new hiding list from user
+ call inputsave()
+ let newhide= input("Edit Hiding List: ",g:netrw_list_hide)
+ call inputrestore()
+ let g:netrw_list_hide= newhide
+" call Decho("new g:netrw_list_hide<".g:netrw_list_hide.">")
- elseif curline =~ '"\s*\%(Hiding\|Showing\):'
- norm a
- let s:netrw_skipbrowse= 1
- echo 'Pressing "a" also works'
+ " refresh the listing
+ silent call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./"))
- elseif line("$") > w:netrw_bannercnt
- exe 'silent keepjumps '.w:netrw_bannercnt
- endif
+ " restore cursor position
+ call netrw#NetrwRestorePosn(svpos)
- elseif w:netrw_liststyle == s:THINLIST
-" call Decho("thin column handling")
- norm! 0
- let dirname= getline(".")
+" call Dret("NetrwHideEdit")
+endfun
- elseif w:netrw_liststyle == s:LONGLIST
-" call Decho("long column handling")
- norm! 0
- let dirname= substitute(getline("."),'^\(\%(\S\+ \)*\S\+\).\{-}$','\1','e')
+" ---------------------------------------------------------------------
+" NetSortSequence: allows user to edit the sorting sequence
+fun! s:NetSortSequence(islocal)
+" call Dfunc("NetSortSequence(islocal=".a:islocal.")")
- elseif w:netrw_liststyle == s:TREELIST
-" call Decho("treelist handling")
- let dirname= substitute(getline("."),'^\(| \)*','','e')
+ let svpos= netrw#NetrwSavePosn()
+ call inputsave()
+ let newsortseq= input("Edit Sorting Sequence: ",g:netrw_sort_sequence)
+ call inputrestore()
- else
-" call Decho("obtain word from wide listing")
- let dirname= getline(".")
+ " refresh the listing
+ let g:netrw_sort_sequence= newsortseq
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
- if !exists("b:netrw_cpf")
- let b:netrw_cpf= 0
- exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^./if virtcol("$") > b:netrw_cpf|let b:netrw_cpf= virtcol("$")|endif'
-" call Decho("computed cpf")
+" call Dret("NetSortSequence")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwMakeDir: this function makes a directory (both local and remote) {{{2
+fun! s:NetrwMakeDir(usrhost)
+" call Dfunc("NetrwMakeDir(usrhost<".a:usrhost.">)")
+
+ " get name of new directory from user. A bare <CR> will skip.
+ " if its currently a directory, also request will be skipped, but with
+ " a message.
+ call inputsave()
+ let newdirname= input("Please give directory name: ")
+ call inputrestore()
+" call Decho("newdirname<".newdirname.">")
+
+ if newdirname == ""
+" call Dret("NetrwMakeDir : user aborted with bare <cr>")
+ return
+ endif
+
+ if a:usrhost == ""
+" call Decho("local mkdir")
+
+ " Local mkdir:
+ " sanity checks
+ let fullnewdir= b:netrw_curdir.'/'.newdirname
+" call Decho("fullnewdir<".fullnewdir.">")
+ if isdirectory(fullnewdir)
+ if !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a directory!",24)
+ endif
+" call Dret("NetrwMakeDir : directory<".newdirname."> exists previously")
+ return
+ endif
+ if s:FileReadable(fullnewdir)
+ if !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a file!",25)
+ endif
+" call Dret("NetrwMakeDir : file<".newdirname."> exists previously")
+ return
endif
-" call Decho("buf#".bufnr("%")."<".bufname("%").">")
- let filestart = (virtcol(".")/b:netrw_cpf)*b:netrw_cpf
-" call Decho("filestart= ([virtcol=".virtcol(".")."]/[b:netrw_cpf=".b:netrw_cpf."])*b:netrw_cpf=".filestart." bannercnt=".w:netrw_bannercnt)
-" call Decho("1: dirname<".dirname.">")
- if filestart > 0|let dirname= substitute(dirname,'^.\{'.filestart.'}','','')|endif
-" call Decho("2: dirname<".dirname.">")
- let dirname = substitute(dirname,'^\(.\{'.b:netrw_cpf.'}\).*$','\1','e')
-" call Decho("3: dirname<".dirname.">")
- let dirname = substitute(dirname,'\s\+$','','e')
-" call Decho("4: dirname<".dirname.">")
+ " requested new local directory is neither a pre-existing file or
+ " directory, so make it!
+ if exists("*mkdir")
+ call mkdir(fullnewdir,"p")
+ else
+ let netrw_origdir= s:NetrwGetcwd(1)
+ exe 'keepjumps lcd '.fnameescape(b:netrw_curdir)
+" call Decho("netrw_origdir<".netrw_origdir.">: lcd b:netrw_curdir<".fnameescape(b:netrw_curdir).">")
+" call Decho("exe silent! !".g:netrw_local_mkdir.' '.shellescape(newdirname))
+ exe "silent! !".g:netrw_local_mkdir.' '.shellescape(newdirname)
+ if !g:netrw_keepdir
+ exe 'keepjumps lcd '.fnameescape(netrw_origdir)
+" call Decho("netrw_keepdir=".g:netrw_keepdir.": keepjumps lcd ".fnameescape(netrw_origdir)." getcwd<".getcwd().">")
+ endif
+ endif
+
+ if v:shell_error == 0
+ " refresh listing
+" call Decho("refresh listing")
+ let svpos= netrw#NetrwSavePosn()
+ call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+ elseif !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",26)
+ endif
+" redraw!
+
+ elseif !exists("b:netrw_method") || b:netrw_method == 4
+ " Remote mkdir:
+" call Decho("remote mkdir")
+ let mkdircmd = s:MakeSshCmd(g:netrw_mkdir_cmd)
+ let newdirname= substitute(b:netrw_curdir,'^\%(.\{-}/\)\{3}\(.*\)$','\1','').newdirname
+" call Decho("exe silent! !".mkdircmd." ".shellescape(newdirname))
+ exe "silent! !".mkdircmd." ".shellescape(newdirname)
+ if v:shell_error == 0
+ " refresh listing
+ let svpos= netrw#NetrwSavePosn()
+ call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+ elseif !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",27)
+ endif
+" redraw!
+
+ elseif b:netrw_method == 2
+ " COMBAK -- future work
+ call netrw#ErrorMsg(s:ERROR,"making directories via ftp not currently supported",68)
+ elseif b:netrw_method == 3
+ " COMBAK -- future work
+ call netrw#ErrorMsg(s:ERROR,"making directories via ftp not currently supported",68)
endif
-" call Dret("NetGetWord <".dirname.">")
- return dirname
+" call Dret("NetrwMakeDir")
endfun
" ---------------------------------------------------------------------
-" NetBrowseRm: remove/delete a remote file or directory {{{2
-fun! s:NetBrowseRm(usrhost,path) range
-" call Dfunc("NetBrowseRm(usrhost<".a:usrhost."> path<".a:path.">) virtcol=".virtcol("."))
-" call Decho("firstline=".a:firstline." lastline=".a:lastline)
+" s:NetrwMarkFile: (invoked by mf) This function is used to both {{{2
+" mark and unmark files. If a markfile list exists,
+" then the rename and delete functions will use it instead
+" of whatever may happen to be under the cursor at that
+" moment. When the mouse and gui are available,
+" shift-leftmouse may also be used to mark files.
+fun! s:NetrwMarkFile(islocal,fname)
+" call Dfunc("s:NetrwMarkFile(islocal=".a:islocal." fname<".a:fname.">)")
+ let curbufnr= bufnr("%")
+ let curdir = b:netrw_curdir
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+ " markfile list exists
+" call Decho("starting s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">")
+" call Decho("starting s:netrwmarkfilemtch_{curbufnr}<".s:netrwmarkfilemtch_{curbufnr}.">")
+
+ if index(s:netrwmarkfilelist_{curbufnr},a:fname) == -1
+ " append filename to local-directory markfilelist
+" call Decho("append filename<".a:fname."> to local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">")
+ call add(s:netrwmarkfilelist_{curbufnr},a:fname)
+ let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\|\<'.escape(a:fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>'
- " preparation for removing multiple files/directories
- let ctr= a:firstline
- let all= 0
+ else
+ " remove filename from local markfilelist
+" call Decho("remove filename<".a:fname."> from local markfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">")
+ call filter(s:netrwmarkfilelist_{curbufnr},'v:val != a:fname')
+ if s:netrwmarkfilelist_{curbufnr} == []
+ " local markfilelist is empty; remove it entirely
+" call Decho("markfile list now empty, unlet s:netrwmarkfilelist_".curbufnr." and ...mtch_".curbufnr)
+ call s:NetrwUnmarkList(curbufnr,curdir)
+ else
+ " rebuild match list to display markings correctly
+" call Decho("rebuild s:netrwmarkfilemtch_".curbufnr)
+ let s:netrwmarkfilemtch_{curbufnr}= ""
+ let first = 1
+ for fname in s:netrwmarkfilelist_{curbufnr}
+ if first
+ let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\<'.escape(fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>'
+ else
+ let s:netrwmarkfilemtch_{curbufnr}= s:netrwmarkfilemtch_{curbufnr}.'\|\<'.escape(fname,g:netrw_markfileesc."'".g:netrw_markfileesc."'").'\>'
+ endif
+ let first= 0
+ endfor
+" call Decho("ending s:netrwmarkfilelist_"curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}).">")
+" call Decho("ending s:netrwmarkfilemtch_"curbufnr."<".s:netrwmarkfilemtch_{curbufnr}.">")
+ endif
+ endif
- " remove multiple files and directories
- while ctr <= a:lastline
- exe ctr
+ else
+ " initialize new markfilelist
- let rmfile= s:NetGetWord()
-" call Decho("rmfile<".rmfile.">")
+" call Decho("add fname<".a:fname."> to new markfilelist_".curbufnr)
+ let s:netrwmarkfilelist_{curbufnr}= []
+ call add(s:netrwmarkfilelist_{curbufnr},a:fname)
+" call Decho("ending s:netrwmarkfilelist_{curbufnr}<".string(s:netrwmarkfilelist_{curbufnr}).">")
- if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '[\/]$')
- " attempt to remove file
-" call Decho("attempt to remove file")
- if !all
- echohl Statement
- call inputsave()
- let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
- call inputrestore()
- echohl NONE
- if ok == ""
- let ok="no"
- endif
- let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
- if ok =~ 'a\%[ll]'
- let all= 1
- endif
+ " build initial markfile matching pattern
+ if a:fname =~ '/$'
+ let s:netrwmarkfilemtch_{curbufnr}= '\<'.escape(a:fname,g:netrw_markfileesc)
+ else
+ let s:netrwmarkfilemtch_{curbufnr}= '\<'.escape(a:fname,g:netrw_markfileesc).'\>'
+ endif
+" call Decho("ending s:netrwmarkfilemtch_".curbufnr."<".s:netrwmarkfilemtch_{curbufnr}.">")
+ endif
+
+ " handle global markfilelist
+ if exists("s:netrwmarkfilelist")
+ let dname= s:ComposePath(b:netrw_curdir,a:fname)
+ if index(s:netrwmarkfilelist,dname) == -1
+ " append new filename to global markfilelist
+ call add(s:netrwmarkfilelist,s:ComposePath(b:netrw_curdir,a:fname))
+" call Decho("append filename<".a:fname."> to global markfilelist<".string(s:netrwmarkfilelist).">")
+ else
+ " remove new filename from global markfilelist
+" call Decho("filter(".string(s:netrwmarkfilelist).",'v:val != '.".dname.")")
+ call filter(s:netrwmarkfilelist,'v:val != "'.dname.'"')
+" call Decho("ending s:netrwmarkfilelist <".string(s:netrwmarkfilelist).">")
+ if s:netrwmarkfilelist == []
+ unlet s:netrwmarkfilelist
endif
+ endif
+ else
+ " initialize new global-directory markfilelist
+ let s:netrwmarkfilelist= []
+ call add(s:netrwmarkfilelist,s:ComposePath(b:netrw_curdir,a:fname))
+" call Decho("init s:netrwmarkfilelist<".string(s:netrwmarkfilelist).">")
+ endif
- if all || ok =~ 'y\%[es]' || ok == ""
- if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
- silent! keepjumps .,$d
- call s:NetBrowseFtpCmd(a:path,"delete ".rmfile)
- else
- let netrw_rm_cmd= s:MakeSshCmd(g:netrw_rm_cmd)
-" call Decho("attempt to remove file: system(".netrw_rm_cmd.")")
- let ret= s:System("system",netrw_rm_cmd)
-" call Decho("returned=".ret." errcode=".v:shell_error)
+ " set up 2match'ing to netrwmarkfilemtch list
+ if exists("s:netrwmarkfilemtch_{curbufnr}") && s:netrwmarkfilemtch_{curbufnr} != ""
+" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/")
+ exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{curbufnr}."/"
+ else
+" call Decho("2match none")
+ 2match none
+ endif
+" call Dret("s:NetrwMarkFile : netrwmarkfilelist_".curbufnr."<".(exists("s:netrwmarkfilelist_{curbufnr}")? string(s:netrwmarkfilelist_{curbufnr}) : " doesn't exist").">")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwMarkFileCompress: (invoked by mz) This function is used to {{{2
+" compress/decompress files using the programs
+" in g:netrw_compress and g:netrw_uncompress,
+" using g:netrw_compress_suffix to know which to
+" do. By default:
+" g:netrw_compress = "gzip"
+" g:netrw_decompress = { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , ".tar" : "tar -xf"}
+fun! s:NetrwMarkFileCompress(islocal)
+" call Dfunc("s:NetrwMarkFileCompress(islocal=".a:islocal.")")
+ let svpos = netrw#NetrwSavePosn()
+ let curdir = b:netrw_curdir
+ let curbufnr = bufnr("%")
+
+ if exists("s:netrwmarkfilelist_{curbufnr}") && exists("g:netrw_compress") && exists("g:netrw_decompress")
+ for fname in s:netrwmarkfilelist_{curbufnr}
+ " for every filename in the marked list
+ for sfx in sort(keys(g:netrw_decompress))
+ if fname =~ '\'.sfx.'$'
+ " fname has a suffix indicating that its compressed; apply associated decompression routine
+ let exe= g:netrw_decompress[sfx]
+" call Decho("fname<".fname."> is compressed so decompress with <".exe.">")
+ if a:islocal
+ if g:netrw_keepdir
+ let fname= s:ComposePath(curdir,fname)
+ endif
+ else
+ let fname= b:netrw_curdir.fname
+ endif
+ if executable(exe)
+ if a:islocal
+ call system(exe." ".fname)
+ else
+ call s:RemoteSystem(exe." ".fname)
+ endif
+ else
+ call netrw#ErrorMsg(s:WARNING,"unable to apply<".exe."> to file<".fname.">",50)
+ endif
+ break
endif
- elseif ok =~ 'q\%[uit]'
- break
+ endfor
+ if exists("exe")
+ unlet exe
+ elseif a:islocal
+ " fname not a compressed file, so compress it
+ call system(g:netrw_compress." ".s:ComposePath(b:netrw_curdir,fname))
+ else
+ " fname not a compressed file, so compress it
+ call s:RemoteSystem(g:netrw_compress." ".fname)
endif
+ endfor
+ call s:NetrwUnmarkList(curbufnr,curdir)
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+ endif
+" call Dret("s:NetrwMarkFileCompress")
+endfun
+" ---------------------------------------------------------------------
+" s:NetrwMarkFileCopy: (invoked by mc) copy marked files to target {{{2
+" If no marked files, then set up directory as the
+" target. Currently does not support copying entire
+" directories. Uses the local-buffer marked file list.
+" Returns 1=success (used by NetrwMarkFileMove())
+" 0=failure
+fun! s:NetrwMarkFileCopy(islocal)
+" call Dfunc("s:NetrwMarkFileCopy(islocal=".a:islocal.") target<".(exists("s:netrwmftgt")? s:netrwmftgt : '---').">")
+
+ " sanity checks
+ if !exists("s:netrwmarkfilelist_{bufnr('%')}") || empty(s:netrwmarkfilelist_{bufnr('%')})
+ call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+" call Dret("s:NetrwMarkFileCopy 0")
+ return 0
+ endif
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".bufnr('%')."<".string(s:netrwmarkfilelist_{bufnr('%')}))
+ if !exists("s:netrwmftgt")
+ call netrw#ErrorMsg(2,"your marked file target is empty! (:help netrw-mt)",67)
+" call Dret("s:NetrwMarkFileCopy 0")
+ return 0
+ endif
+" call Decho("sanity chk passed: s:netrwmftgt<".s:netrwmftgt.">")
+ let curdir = b:netrw_curdir
+ let curbufnr = bufnr("%")
+
+ if a:islocal && s:netrwmftgt_islocal
+ " Copy marked files, local directory to local directory
+" call Decho("copy from local to local")
+ let args= join(map(copy(s:netrwmarkfilelist_{bufnr('%')}),"b:netrw_curdir.\"/\".shellescape(v:val)"))
+" call Decho("system(".g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt).")")
+ call system(g:netrw_localcopycmd." ".args." ".shellescape(s:netrwmftgt))
+
+ elseif a:islocal && !s:netrwmftgt_islocal
+ " Copy marked files, local directory to remote directory
+" call Decho("copy from local to remote")
+ call s:NetrwUpload(s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
+
+ elseif !a:islocal && s:netrwmftgt_islocal
+" call Decho("copy from remote to local")
+ call netrw#NetrwObtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},s:netrwmftgt)
+
+ elseif !a:islocal && !s:netrwmftgt_islocal
+" call Decho("copy from remote to remote")
+ let curdir = getcwd()
+ let tmpdir = s:GetTempfile("")
+ if tmpdir !~ '/'
+ let tmpdir= curdir."/".tmpdir
+ endif
+ if exists("*mkdir")
+ call mkdir(tmpdir)
else
- " attempt to remove directory
-" call Decho("attempt to remove directory")
- if !all
- call inputsave()
- let ok= input("Confirm deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
- call inputrestore()
- if ok == ""
- let ok="no"
- endif
- let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
- if ok =~ 'a\%[ll]'
- let all= 1
- endif
+ exe "silent! !".g:netrw_local_mkdir.' '.shellescape(tmpdir)
+ endif
+ if isdirectory(tmpdir)
+ exe "keepjumps lcd ".fnameescape(tmpdir)
+ call netrw#NetrwObtain(a:islocal,s:netrwmarkfilelist_{bufnr('%')},tmpdir)
+ let localfiles= map(copy(s:netrwmarkfilelist_{bufnr('%')}),'substitute(v:val,"^.*/","","")')
+ call s:NetrwUpload(localfiles,s:netrwmftgt)
+ if getcwd() == tmpdir
+ for fname in s:netrwmarkfilelist_{bufnr('%')}
+ call s:System("delete",fname)
+ endfor
+ exe "keepjumps lcd ".fnameescape(curdir)
+ exe "silent !".g:netrw_local_rmdir." ".fnameescape(tmpdir)
+ else
+ exe "keepjumps lcd ".fnameescape(curdir)
endif
+ endif
+ endif
- if all || ok =~ 'y\%[es]' || ok == ""
- if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
- call s:NetBrowseFtpCmd(a:path,"rmdir ".rmfile)
- else
- let rmfile = substitute(a:path.rmfile,'/$','','')
- let netrw_rmdir_cmd = s:MakeSshCmd(g:netrw_rmdir_cmd).' '.rmfile
-" call Decho("attempt to remove dir: system(".netrw_rmdir_cmd.")")
- let ret= s:System("system",netrw_rmdir_cmd)
-" call Decho("returned=".ret." errcode=".v:shell_error)
+ " -------
+ " cleanup
+ " -------
+" call Decho("cleanup")
- if v:shell_error != 0
-" call Decho("v:shell_error not 0")
- let netrw_rmf_cmd= s:MakeSshCmd(g:netrw_rmf_cmd).' '.substitute(rmfile,'[\/]$','','e')
-" call Decho("2nd attempt to remove dir: system(".netrw_rmf_cmd.")")
- let ret= s:System("system",netrw_rmf_cmd)
-" call Decho("returned=".ret." errcode=".v:shell_error)
+ " remove markings from local buffer
+ call s:NetrwUnmarkList(curbufnr,curdir)
- if v:shell_error != 0 && !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",22)
- endif
- endif
- endif
+ " refresh buffers
+ if !s:netrwmftgt_islocal
+ call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
+ endif
+ if a:islocal
+ call s:NetrwRefreshDir(a:islocal,b:netrw_curdir)
+ endif
+ call s:LocalBrowseShellCmdRefresh()
+
+" call Dret("s:NetrwMarkFileCopy 1")
+ return 1
+endfun
- elseif ok =~ 'q\%[uit]'
+" ---------------------------------------------------------------------
+" s:NetrwMarkFileDiff: (invoked by md) This function is used to {{{2
+" invoke vim's diff mode on the marked files.
+" Either two or three files can be so handled.
+" Uses the global marked file list.
+fun! s:NetrwMarkFileDiff(islocal)
+" call Dfunc("s:NetrwMarkFileDiff(islocal=".a:islocal.") b:netrw_curdir<".b:netrw_curdir.">")
+ let curbufnr= bufnr("%")
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+
+ let cnt = 0
+ let curdir = b:netrw_curdir
+ for fname in s:netrwmarkfilelist
+ let cnt= cnt + 1
+ if !a:islocal
+ let fname= curdir.fname
+ endif
+ if cnt == 1
+" call Decho("diffthis: ".fname)
+ exe "e ".fname
+ diffthis
+ elseif cnt == 2 || cnt == 3
+ vsplit
+ wincmd l
+" call Decho("diffthis: ".fname)
+ exe "e ".fname
+ diffthis
+ else
break
endif
+ endfor
+ call s:NetrwUnmarkList(curbufnr,curdir)
+ endif
+" call Dret("s:NetrwMarkFileDiff")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwMarkFileEdit: (invoked by me) put marked files on arg list and start editing them {{{2
+" Uses global markfilelist
+fun! s:NetrwMarkFileEdit(islocal)
+" call Dfunc("s:NetrwMarkFileEdit(islocal=".a:islocal.")")
+
+ let curdir = b:netrw_curdir
+ let curbufnr = bufnr("%")
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+ call s:SetRexDir(a:islocal,curdir)
+ if a:islocal && g:netrw_keepdir
+ " use complete paths if its local and keepdir enabled
+ let flist= ""
+ for fname in s:netrwmarkfilelist
+" let flist= flist." ".s:ComposePath(curdir,fname)
+ let flist= flist." ".fname
+ endfor
+ else
+" let flist= substitute(escape(join(s:netrwmarkfilelist_{curbufnr},"\t"),' '),"\t",' ','g')
+ let flist= substitute(escape(join(s:netrwmarkfilelist,"\t"),' '),"\t",' ','g')
endif
+ " unmark markedfile list
+" call s:NetrwUnmarkList(curbufnr,curdir)
+ call s:NetrwUnmarkAll()
+" call Decho("exe silent args ".flist)
+ exe "silent args ".flist
+ endif
+
+" call Dret("s:NetrwMarkFileEdit")
+endfun
- let ctr= ctr + 1
- endwhile
+" ---------------------------------------------------------------------
+" s:NetrwMarkFileExe: (invoked by mx) execute arbitrary command on marked files, one at a time {{{2
+" Uses the local marked-file list.
+fun! s:NetrwMarkFileExe(islocal)
+" call Dfunc("s:NetrwMarkFileExe(islocal=".a:islocal.")")
+ let svpos = netrw#NetrwSavePosn()
+ let curdir = b:netrw_curdir
+ let curbufnr = bufnr("%")
+
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+ " get the command
+ call inputsave()
+ let cmd= input("Enter command: ","","file")
+ call inputrestore()
+" call Decho("cmd<".cmd.">")
- " refresh the (remote) directory listing
-" call Decho("refresh remote directory listing")
- call netrw#NetSavePosn()
- call s:NetRefresh(0,s:NetBrowseChgDir(0,'./'))
+ " apply command to marked files. Substitute: filename -> %
+ " If no %, then append a space and the filename to the command
+ for fname in s:netrwmarkfilelist_{curbufnr}
+ if a:islocal
+ if g:netrw_keepdir
+ let fname= s:ComposePath(curdir,fname)
+ endif
+ else
+ let fname= b:netrw_curdir.fname
+ endif
+ if cmd =~ '%'
+ let xcmd= substitute(cmd,'%',fname,'g')
+ else
+ let xcmd= cmd.' '.fname
+ endif
+ if a:islocal
+" call Decho("local: xcmd<".xcmd.">")
+ let ret= system(xcmd)
+ else
+" call Decho("remote: xcmd<".xcmd.">")
+ let ret= s:RemoteSystem(xcmd)
+ endif
+ if v:shell_error < 0
+ call netrw#ErrorMsg(s:ERROR,"command<".xcmd."> failed, aborting",54)
+ break
+ else
+ echo ret
+ endif
+ endfor
+
+ " unmark marked file list
+ call s:NetrwUnmarkList(curbufnr,curdir)
-" call Dret("NetBrowseRm")
+ " refresh the listing
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+ else
+ call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
+ endif
+
+" call Dret("s:NetrwMarkFileExe")
endfun
" ---------------------------------------------------------------------
-" NetBrowseRename: rename a remote file or directory {{{2
-fun! s:NetBrowseRename(usrhost,path) range
-" call Dfunc("NetBrowseRename(usrhost<".a:usrhost."> path<".a:path.">)")
+" s:NetrwMarkHideSfx: (invoked by mh) (un)hide files having same suffix
+" as the marked file(s) (toggles suffix presence)
+" Uses the local marked file list.
+fun! s:NetrwMarkHideSfx(islocal)
+" call Dfunc("s:NetrwMarkHideSfx(islocal=".a:islocal.")")
+ let svpos = netrw#NetrwSavePosn()
+ let curbufnr = bufnr("%")
+
+ " s:netrwmarkfilelist_{curbufnr}: the List of marked files
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+
+ for fname in s:netrwmarkfilelist_{curbufnr}
+" call Decho("s:NetrwMarkFileCopy: fname<".fname.">")
+ " construct suffix pattern
+ if fname =~ '\.'
+ let sfxpat= "^.*".substitute(fname,'^.*\(\.[^. ]\+\)$','\1','')
+ else
+ let sfxpat= '^\%(\%(\.\)\@!.\)*$'
+ endif
+ " determine if its in the hiding list or not
+ let inhidelist= 0
+ if g:netrw_list_hide != ""
+ let itemnum = 0
+ let hidelist= split(g:netrw_list_hide,',')
+ for hidepat in hidelist
+ if sfxpat == hidepat
+ let inhidelist= 1
+ break
+ endif
+ let itemnum= itemnum + 1
+ endfor
+ endif
+" call Decho("fname<".fname."> inhidelist=".inhidelist." sfxpat<".sfxpat.">")
+ if inhidelist
+ " remove sfxpat from list
+ call remove(hidelist,itemnum)
+ let g:netrw_list_hide= join(hidelist,",")
+ elseif g:netrw_list_hide != ""
+ " append sfxpat to non-empty list
+ let g:netrw_list_hide= g:netrw_list_hide.",".sfxpat
+ else
+ " set hiding list to sfxpat
+ let g:netrw_list_hide= sfxpat
+ endif
+ endfor
- " preparation for removing multiple files/directories
- let ctr = a:firstline
- let rename_cmd = s:MakeSshCmd(g:netrw_rename_cmd)
+ " refresh the listing
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+ else
+ call netrw#ErrorMsg(s:ERROR,"no files marked!",59)
+ endif
- " attempt to rename files/directories
- while ctr <= a:lastline
- exe "keepjumps ".ctr
+" call Dret("s:NetrwMarkHideSfx")
+endfun
- norm! 0
- let oldname= s:NetGetWord()
-" call Decho("oldname<".oldname.">")
+" ---------------------------------------------------------------------
+" s:NetrwMarkFileGrep: (invoked by mg) This function applies vimgrep to marked files {{{2
+" Uses the global markfilelist
+fun! s:NetrwMarkFileGrep(islocal)
+" call Dfunc("s:NetrwMarkFileGrep(islocal=".a:islocal.")")
+ let svpos = netrw#NetrwSavePosn()
+ let curdir = b:netrw_curdir
+ let curbufnr = bufnr("%")
+
+ if exists("s:netrwmarkfilelist")
+" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">")
+ let netrwmarkfilelist= ""
+ for fname in s:netrwmarkfilelist
+" call Decho("fname<".fname.">")
+ let fname = escape(substitute(fname,"[\"']","","g")," ")
+ let netrwmarkfilelist = netrwmarkfilelist." ".fname
+ endfor
+ call s:NetrwUnmarkAll()
+ " ask user for pattern
call inputsave()
- let newname= input("Moving ".oldname." to : ",oldname)
+ let pat= input("Enter pattern: ","")
call inputrestore()
-
- if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
- call s:NetBrowseFtpCmd(a:path,"rename ".oldname." ".newname)
- else
- let oldname= a:path.oldname
- let newname= a:path.newname
-" call Decho("system(rename_cmd".' "'.escape(oldname," ").'" "'.escape(newname,s:netrw_cd_escape).'"')
- let ret= s:System("system",rename_cmd.' "'.escape(oldname,s:netrw_cd_escape).'" "'.escape(newname,s:netrw_cd_escape).'"')
+ if pat !~ '^\s'
+ if pat !~ '^/'
+ let pat= '/'.pat.'/'
+ endif
+ let pat= " ".pat
endif
- let ctr= ctr + 1
- endwhile
+ " use vimgrep for both local and remote
+" call Decho("exe vimgrep".pat." ".netrwmarkfilelist)
+ exe "vimgrep".pat." ".netrwmarkfilelist
- " refresh the directory
- let curline= line(".")
- call s:NetBrowse(0,s:NetBrowseChgDir(0,'./'))
- exe "keepjumps ".curline
-" call Dret("NetBrowseRename")
+ 2match none
+ call netrw#NetrwRestorePosn(svpos)
+ endif
+
+" call Dret("s:NetrwMarkFileGrep")
endfun
" ---------------------------------------------------------------------
-" NetRefresh: {{{2
-fun! s:NetRefresh(islocal,dirname)
-" call Dfunc("NetRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction)
- " at the current time (Mar 19, 2007) all calls to NetRefresh() call NetBrowseChgDir() first.
- " NetBrowseChgDir() may clear the display; hence a NetSavePosn() may not work if its placed here.
- " Also, NetBrowseChgDir() now does a NetSavePosn() itself.
- setlocal ma noro
-" call Decho("clear buffer<".expand("%")."> with :%d")
- %d
- if a:islocal
- call netrw#LocalBrowseCheck(a:dirname)
- else
- call s:NetBrowse(a:islocal,a:dirname)
+" s:NetrwMarkFileMove: (invoked by mm) execute arbitrary command on marked files, one at a time {{{2
+" uses the global marked file list
+" s:netrwmfloc= 0: target directory is remote
+" = 1: target directory is local
+fun! s:NetrwMarkFileMove(islocal)
+" call Dfunc("s:NetrwMarkFileMove(islocal=".a:islocal.")")
+ let curdir = b:netrw_curdir
+ let curbufnr = bufnr("%")
+
+ " sanity check
+ if !exists("s:netrwmarkfilelist_{bufnr('%')}") || empty(s:netrwmarkfilelist_{bufnr('%')})
+ call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66)
+" call Dret("s:NetrwMarkFileMove")
+ return
+ endif
+" call Decho("sanity chk passed: s:netrwmarkfilelist_".bufnr('%')."<".string(s:netrwmarkfilelist_{bufnr('%')}))
+ if !exists("s:netrwmftgt")
+ call netrw#ErrorMsg(2,"your marked file target is empty! (:help netrw-mt)",67)
+" call Dret("s:NetrwMarkFileCopy 0")
+ return 0
+ endif
+" call Decho("sanity chk passed: s:netrwmftgt<".s:netrwmftgt.">")
+
+ if a:islocal && s:netrwmftgt_islocal
+ " move: local -> local
+" call Decho("move from local to local")
+" call Decho("(s:NetrwMarkFileMove) local to local move")
+ if executable(g:netrw_localmovecmd)
+ for fname in s:netrwmarkfilelist_{bufnr("%")}
+" call Decho("system(".g:netrw_localmovecmd." ".shellescape(fname)." ".shellescape(s:netrwmftgt).")")
+ let ret= system(g:netrw_localmovecmd." ".shellescape(fname)." ".shellescape(s:netrwmftgt))
+ if v:shell_error < 0
+ call netrw#ErrorMsg(s:ERROR,"command<".g:netrw_localmovecmd."> failed, aborting",54)
+ break
+ endif
+ endfor
+ else
+ call netrw#ErrorMsg(s:ERROR,"command<".g:netrw_localmovecmd."> is not executable!",57)
+ endif
+
+ elseif a:islocal && !s:netrwmftgt_islocal
+ " move: local -> remote
+" call Decho("move from local to remote")
+" call Decho("copy")
+ let mflist= s:netrwmarkfilelist_{bufnr("%")}
+ call s:NetrwMarkFileCopy(a:islocal)
+" call Decho("remove")
+ for fname in mflist
+ let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
+ let ok = s:NetrwLocalRmFile(b:netrw_curdir,barefname,1)
+ endfor
+ unlet mflist
+
+ elseif !a:islocal && s:netrwmftgt_islocal
+ " move: remote -> local
+" call Decho("move from remote to local")
+" call Decho("copy")
+ let mflist= s:netrwmarkfilelist_{bufnr("%")}
+ call s:NetrwMarkFileCopy(a:islocal)
+" call Decho("remove")
+ for fname in mflist
+ let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
+ let ok = s:NetrwRemoteRmFile(b:netrw_curdir,barefname,1)
+ endfor
+ unlet mflist
+
+ elseif !a:islocal && !s:netrwmftgt_islocal
+ " move: remote -> remote
+" call Decho("move from remote to remote")
+" call Decho("copy")
+ let mflist= s:netrwmarkfilelist_{bufnr("%")}
+ call s:NetrwMarkFileCopy(a:islocal)
+" call Decho("remove")
+ for fname in mflist
+ let barefname = substitute(fname,'^\(.*/\)\(.\{-}\)$','\2','')
+ let ok = s:NetrwRemoteRmFile(b:netrw_curdir,barefname,1)
+ endfor
+ unlet mflist
endif
- call netrw#NetRestorePosn()
- redraw!
-" call Dret("NetRefresh")
-endfun
-" ---------------------------------------------------------------------
-" NetSplit: mode {{{2
-" =0 : net and o
-" =1 : net and t
-" =2 : net and v
-" =3 : local and o
-" =4 : local and t
-" =5 : local and v
-fun! s:NetSplit(mode)
-" call Dfunc("NetSplit(mode=".a:mode.") alto=".g:netrw_alto." altv=".g:netrw_altv)
+ " -------
+ " cleanup
+ " -------
+" call Decho("cleanup")
- call s:SaveWinVars()
+ " remove markings from local buffer
+ call s:NetrwUnmarkList(curbufnr,curdir) " remove markings from local buffer
- if a:mode == 0
- " remote and o
- exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
- let s:didsplit= 1
- call s:RestoreWinVars()
- call s:NetBrowse(0,s:NetBrowseChgDir(0,s:NetGetWord()))
- unlet s:didsplit
+ " refresh buffers
+ if !s:netrwmftgt_islocal
+ call s:NetrwRefreshDir(s:netrwmftgt_islocal,s:netrwmftgt)
+ endif
+ if a:islocal
+ call s:NetrwRefreshDir(a:islocal,b:netrw_curdir)
+ endif
+ call s:LocalBrowseShellCmdRefresh()
+
+" call Dret("s:NetrwMarkFileMove")
+endfun
- elseif a:mode == 1
- " remote and t
- let cursorword = s:NetGetWord()
- tabnew
- let s:didsplit= 1
- call s:RestoreWinVars()
- call s:NetBrowse(0,s:NetBrowseChgDir(0,cursorword))
- unlet s:didsplit
+" ---------------------------------------------------------------------
+" s:NetrwMarkFilePrint: (invoked by mp) This function prints marked files {{{2
+" using the hardcopy command. Local marked-file list only.
+fun! s:NetrwMarkFilePrint(islocal)
+" call Dfunc("s:NetrwMarkFilePrint(islocal=".a:islocal.")")
+ let curbufnr= bufnr("%")
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+ let netrwmarkfilelist = s:netrwmarkfilelist_{curbufnr}
+ let curdir = b:netrw_curdir
+ call s:NetrwUnmarkList(curbufnr,curdir)
+ for fname in netrwmarkfilelist
+ if a:islocal
+ if g:netrw_keepdir
+ let fname= s:ComposePath(curdir,fname)
+ endif
+ else
+ let fname= curdir.fname
+ endif
+ 1split
+ " the autocmds will handle both local and remote files
+" call Decho("exe silent e ".escape(fname,' '))
+ exe "silent e ".escape(fname,' ')
+" call Decho("hardcopy")
+ hardcopy
+ q
+ endfor
+ 2match none
+ endif
+" call Dret("s:NetrwMarkFilePrint")
+endfun
- elseif a:mode == 2
- " remote and v
- exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"
- let s:didsplit= 1
- call s:RestoreWinVars()
- call s:NetBrowse(0,s:NetBrowseChgDir(0,s:NetGetWord()))
- unlet s:didsplit
+" ---------------------------------------------------------------------
+" s:NetrwMarkFileRegexp: (invoked by mr) This function is used to mark {{{2
+" files when given a regexp (for which a prompt is
+" issued).
+fun! s:NetrwMarkFileRegexp(islocal)
+" call Dfunc("s:NetrwMarkFileRegexp(islocal=".a:islocal.")")
- elseif a:mode == 3
- " local and o
- exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
- let s:didsplit= 1
- call s:RestoreWinVars()
- call netrw#LocalBrowseCheck(s:NetBrowseChgDir(1,s:NetGetWord()))
- unlet s:didsplit
+ " get the regular expression
+ call inputsave()
+ let regexp= input("Enter regexp: ","","file")
+ call inputrestore()
- elseif a:mode == 4
- " local and t
- let netrw_curdir= b:netrw_curdir
- let cursorword = s:NetGetWord()
- tabnew
- let b:netrw_curdir= netrw_curdir
- let s:didsplit= 1
- call s:RestoreWinVars()
- call netrw#LocalBrowseCheck(s:NetBrowseChgDir(1,cursorword))
- unlet s:didsplit
+ if a:islocal
+ " get the matching list of files using local glob()
+" call Decho("handle local regexp")
+ let dirname = escape(b:netrw_curdir,g:netrw_glob_escape)
+ let filelist = glob(s:ComposePath(dirname,regexp))
+ if filelist != ""
+ let filelist= filelist."\n"
+ endif
- elseif a:mode == 5
- " local and v
- exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"
- let s:didsplit= 1
- call s:RestoreWinVars()
- call netrw#LocalBrowseCheck(s:NetBrowseChgDir(1,s:NetGetWord()))
- unlet s:didsplit
+ " mark the list of files
+ while filelist != ""
+ if filelist =~ '\n'
+ let filename = substitute(filelist,'\n.*$','','e')
+ let filelist = substitute(filelist,'^.\{-}\n\(.*\)$','\1','e')
+ else
+ let filename = filelist
+ let filelist = ""
+ endif
+" call Decho("filelist<".filelist.">")
+" call Decho("filename<".filename.">")
+ call s:NetrwMarkFile(a:islocal,substitute(filename,'^.*/','',''))
+ endwhile
else
- call netrw#ErrorMsg(s:ERROR,"(NetSplit) unsupported mode=".a:mode,45)
+" call Decho("handle remote regexp")
+
+ " convert displayed listing into a filelist
+ let eikeep = &ei
+ let areg = @a
+ silent %y a
+ set ei=all ma
+" call Decho("set ei=all ma")
+ 1split
+ enew
+ silent norm! "ap
+ 2
+ let bannercnt= search('^" =====','W')
+ exe "silent 1,".bannercnt."d"
+ set bt=nofile
+ if g:netrw_liststyle == s:LONGLIST
+ silent %s/\s\{2,}\S.*$//e
+ elseif g:netrw_liststyle == s:WIDELIST
+ silent %s/\s\{2,}/\r/ge
+ elseif g:netrw_liststyle == s:TREELIST
+ silent %s/^| //e
+ silent! g/^ .*$/d
+ endif
+ " convert regexp into the more usual glob-style format
+ let regexp= substitute(regexp,'\*','.*','g')
+" call Decho("regexp<".regexp.">")
+ exe "silent! v/".escape(regexp,'/')."/d"
+ let filelist= getline(1,line("$"))
+ q!
+ for filename in filelist
+ call s:NetrwMarkFile(a:islocal,substitute(filename,'^.*/','',''))
+ endfor
+ unlet filelist
+ let @a = areg
+ let &ei = eikeep
endif
-" call Dret("NetSplit")
+" call Dret("s:NetrwMarkFileRegexp")
endfun
" ---------------------------------------------------------------------
-" NetBrowseX: allows users to write custom functions to operate on {{{2
-" files given their extension. Passes 0=local, 1=remote
-fun! netrw#NetBrowseX(fname,remote)
-" call Dfunc("NetBrowseX(fname<".a:fname."> remote=".a:remote.")")
-
- " set up the filename
- " (lower case the extension, make a local copy of a remote file)
- let exten= substitute(a:fname,'.*\.\(.\{-}\)','\1','e')
- if has("win32") || has("win95") || has("win64") || has("win16")
- let exten= substitute(exten,'^.*$','\L&\E','')
+" s:NetrwMarkFileSource: (invoked by ms) This function sources marked files {{{2
+" Uses the local marked file list.
+fun! s:NetrwMarkFileSource(islocal)
+" call Dfunc("s:NetrwMarkFileSource(islocal=".a:islocal.")")
+ let curbufnr= bufnr("%")
+ if exists("s:netrwmarkfilelist_{curbufnr}")
+ let netrwmarkfilelist = s:netrwmarkfilelist_{bufnr("%")}
+ let curdir = b:netrw_curdir
+ call s:NetrwUnmarkList(curbufnr,curdir)
+ for fname in netrwmarkfilelist
+ if a:islocal
+ if g:netrw_keepdir
+ let fname= s:ComposePath(curdir,fname)
+ endif
+ else
+ let fname= curdir.fname
+ endif
+ " the autocmds will handle sourcing both local and remote files
+" call Decho("exe so ".escape(fname,' '))
+ exe "so ".escape(fname,' ')
+ endfor
+ 2match none
endif
- let fname= escape(a:fname,"%#")
-" call Decho("fname<".fname."> after escape()")
+" call Dret("s:NetrwMarkFileSource")
+endfun
- " seems kde systems often have gnome-open due to dependencies, even though
- " gnome-open's subsidiary display tools are largely absent. Kde systems
- " usually have "kdeinit" running, though... (tnx Mikolaj Machowski)
- if !exists("s:haskdeinit")
- if has("unix")
- let s:haskdeinit= s:System("system",'ps -e') =~ 'kdeinit'
- if v:shell_error
- let s:haskdeinit = 0
+" ---------------------------------------------------------------------
+" s:NetrwMarkFileTag: (invoked by mT) This function applies g:netrw_ctags to marked files {{{2
+" Uses the global markfilelist
+fun! s:NetrwMarkFileTag(islocal)
+" call Dfunc("s:NetrwMarkFileTag(islocal=".a:islocal.")")
+ let svpos = netrw#NetrwSavePosn()
+ let curdir = b:netrw_curdir
+ let curbufnr = bufnr("%")
+
+ if exists("s:netrwmarkfilelist")
+" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">")
+ if a:islocal && g:netrw_keepdir
+ let netrwmarkfilelist= ""
+ for fname in s:netrwmarkfilelist
+" let netrwmarkfilelist= netrwmarkfilelist." ".s:ComposePath(curdir,fname)
+ let netrwmarkfilelist= netrwmarkfilelist." ".fname
+ endfor
+ else
+ let netrwmarkfilelist= string(s:netrwmarkfilelist)
+ let netrwmarkfilelist= substitute(netrwmarkfilelist,'[[\],]','','g')
+ endif
+ call s:NetrwUnmarkAll()
+
+ if a:islocal
+ if executable(g:netrw_ctags)
+ call map(netrwmarkfilelist,"shellescape(v:val)")
+" call Decho("call system(".g:netrw_ctags." ".netrwmarkfilelist.")")
+ call system(g:netrw_ctags." ".netrwmarkfilelist)
+ else
+ call netrw#ErrorMsg(s:ERROR,"g:netrw_ctags<".g:netrw_ctags."> is not executable!",51)
endif
else
- let s:haskdeinit= 0
+ let cmd= s:RemoteSystem(g:netrw_ctags." ".netrwmarkfilelist)
+ call netrw#NetrwObtain(a:islocal,"tags")
+ let curdir= b:netrw_curdir
+ 1split
+ e tags
+ let path= substitute(curdir,'^\(.*\)/[^/]*$','\1/','')
+" call Decho("curdir<".curdir."> path<".path.">")
+ exe '%s/\t\(\S\+\)\t/\t'.escape(path,'/').'\1\t/e'
+ wq!
+ endif
+ 2match none
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+ endif
+
+" call Dret("s:NetrwMarkFileTag")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwMarkFileTgt: (invoked by mt) This function sets up a marked file target {{{2
+" Sets up two variables,
+" s:netrwmftgt : holds the target directory
+" s:netrwmftgt_islocal : 0=target directory is remote
+" 1=target directory is local
+fun! s:NetrwMarkFileTgt(islocal)
+" call Dfunc("s:NetrwMarkFileTgt(islocal=".a:islocal.")")
+ let svpos = netrw#NetrwSavePosn()
+ let curdir = b:netrw_curdir
+ let hadtgt = exists("s:netrwmftgt")
+ if !exists("w:netrw_bannercnt")
+ let w:netrw_bannercnt= b:netrw_bannercnt
+ endif
+
+ " set up target
+ if line(".") < w:netrw_bannercnt
+ " if cursor in banner region, use b:netrw_curdir for the target
+ let s:netrwmftgt= b:netrw_curdir
+" call Decho("inbanner: s:netrwmftgt<".s:netrwmftgt.">")
+
+ else
+ " get word under cursor.
+ " * If directory, use it for the target.
+ " * If file, use b:netrw_curdir for the target
+ let curword= s:NetrwGetWord()
+ let tgtdir = s:ComposePath(curdir,curword)
+ if a:islocal && isdirectory(tgtdir)
+ let s:netrwmftgt = tgtdir
+" call Decho("local isdir: s:netrwmftgt<".s:netrwmftgt.">")
+ elseif !a:islocal && tgtdir =~ '/$'
+ let s:netrwmftgt = tgtdir
+" call Decho("remote isdir: s:netrwmftgt<".s:netrwmftgt.">")
+ else
+ let s:netrwmftgt = curdir
+" call Decho("isfile: s:netrwmftgt<".s:netrwmftgt.">")
endif
-" call Decho("setting s:haskdeinit=".s:haskdeinit)
endif
-
- if a:remote == 1
- " create a local copy
- let fname= fnamemodify(tempname(),":t:r").".".exten
-" call Decho("a:remote=".a:remote.": create a local copy of <".a:fname."> as <".fname.">")
- exe "silent keepjumps bot 1new ".a:fname
- setlocal bh=delete
-" call Decho("exe w! ".fname)
- exe "w! ".fname
- q
+ if a:islocal
+ " simplify the target (eg. /abc/def/../ghi -> /abc/ghi)
+ let s:netrwmftgt= simplify(s:netrwmftgt)
+" call Decho("simplify: s:netrwmftgt<".s:netrwmftgt.">")
endif
-" call Decho("exten<".exten."> "."netrwFileHandlers#NFH_".exten."():exists=".exists("*netrwFileHandlers#NFH_".exten))
+ if g:netrw_cygwin
+ let s:netrwmftgt= substitute(system("cygpath ".shellescape(s:netrwmftgt)),'\n$','','')
+ let s:netrwmftgt= substitute(s:netrwmftgt,'\n$','','')
+ endif
+ let s:netrwmftgt_islocal= a:islocal
- " set up redirection
- if &srr =~ "%s"
- let redir= substitute(&srr,"%s","/dev/null","")
- else
- let redir= &srr . "/dev/null"
+ if g:netrw_fastbrowse > 0
+ call s:LocalBrowseShellCmdRefresh()
+ endif
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+ if !hadtgt
+ norm! j
endif
-" call Decho("redir{".redir."} srr{".&srr."}")
- " execute the file handler
- if exists("g:netrw_browsex_viewer") && g:netrw_browsex_viewer == '-'
-" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">")
- let ret= netrwFileHandlers#Invoke(exten,fname)
+" call Dret("s:NetrwMarkFileTgt : netrwmftgt<".(exists("s:netrwmftgt")? s:netrwmftgt : "").">")
+endfun
- elseif exists("g:netrw_browsex_viewer") && executable(g:netrw_browsex_viewer)
-" call Decho("g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">")
-" call Decho("exe silent !".g:netrw_browsex_viewer." '".escape(fname,'%#')."' ".redir)
- exe "silent !".g:netrw_browsex_viewer." '".escape(fname,'%#')."'".redir
- let ret= v:shell_error
+" ---------------------------------------------------------------------
+" s:NetrwUnmarkList: delete local marked file lists and remove their contents from the global marked-file list {{{2
+fun! s:NetrwUnmarkList(curbufnr,curdir)
+" call Dfunc("s:NetrwUnmarkList(curbufnr=".a:curbufnr." curdir<".a:curdir.">)")
+
+ " remove all files in local marked-file list from global list
+ if exists("s:netrwmarkfilelist_{a:curbufnr}")
+ for mfile in s:netrwmarkfilelist_{a:curbufnr}
+ let dfile = s:ComposePath(a:curdir,mfile) " prepend directory to mfile
+ let idx = index(s:netrwmarkfilelist,dfile) " get index in list of dfile
+ call remove(s:netrwmarkfilelist,idx) " remove from global list
+ endfor
+ if s:netrwmarkfilelist == []
+ unlet s:netrwmarkfilelist
+ endif
+
+ " getting rid of the local marked-file lists is easy
+ unlet s:netrwmarkfilelist_{a:curbufnr}
+ endif
+ if exists("s:netrwmarkfilemtch_{a:curbufnr}")
+ unlet s:netrwmarkfilemtch_{a:curbufnr}
+ endif
+ 2match none
+" call Dret("s:NetrwUnmarkList")
+endfun
- elseif has("win32") || has("win64")
-" call Decho('exe silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"')
- exe 'silent !start rundll32 url.dll,FileProtocolHandler "'.escape(fname, '%#').'"'
- call inputsave()|call input("Press <cr> to continue")|call inputrestore()
- let ret= v:shell_error
+" ---------------------------------------------------------------------
+" s:NetrwUnmarkAll: remove the global marked file list and all local ones {{{2
+fun! s:NetrwUnmarkAll()
+" call Dfunc("s:NetrwUnmarkAll()")
+ if exists("s:netrwmarkfilelist")
+ unlet s:netrwmarkfilelist
+ endif
+ silent call s:NetrwUnmarkAll2()
+ 2match none
+" call Dret("s:NetrwUnmarkAll")
+endfun
- elseif has("unix") && executable("gnome-open") && !s:haskdeinit
-" call Decho("exe silent !gnome-open '".escape(fname,'%#')."' ".redir)
- exe "silent !gnome-open '".escape(fname,'%#')."'".redir
- let ret= v:shell_error
+" ---------------------------------------------------------------------
+" s:NetrwUnmarkAll2: {{{2
+fun! s:NetrwUnmarkAll2()
+" call Dfunc("s:NetrwUnmarkAll2()")
+ redir => netrwmarkfilelist_let
+ let
+ redir END
+ let netrwmarkfilelist_list= split(netrwmarkfilelist_let,'\n') " convert let string into a let list
+ call filter(netrwmarkfilelist_list,"v:val =~ '^s:netrwmarkfilelist_'") " retain only those vars that start as s:netrwmarkfilelist_
+ call map(netrwmarkfilelist_list,"substitute(v:val,'\\s.*$','','')") " remove what the entries are equal to
+ for flist in netrwmarkfilelist_list
+ let curbufnr= substitute(flist,'s:netrwmarkfilelist_','','')
+ unlet s:netrwmarkfilelist_{curbufnr}
+ unlet s:netrwmarkfilemtch_{curbufnr}
+ endfor
+" call Dret("s:NetrwUnmarkAll2")
+endfun
- elseif has("unix") && executable("kfmclient") && s:haskdeinit
-" call Decho("exe silent !kfmclient exec '".escape(fname,'%#')."' ".redir)
- exe "silent !kfmclient exec '".escape(fname,'%#')."' ".redir
- let ret= v:shell_error
+" ---------------------------------------------------------------------
+" s:NetrwUnMarkFile: {{{2
+fun! s:NetrwUnMarkFile(islocal)
+" call Dfunc("s:NetrwUnMarkFile(islocal=".a:islocal.")")
+ let svpos = netrw#NetrwSavePosn()
+ let curbufnr = bufnr("%")
+
+ " unmark marked file list (although I expect s:NetrwUpload()
+ " to do it, I'm just making sure)
+ if exists("s:netrwmarkfilelist_{bufnr('%')}")
+" call Decho("unlet'ing: s:netrwmarkfile[list|mtch]_".bufnr("%"))
+ unlet s:netrwmarkfilelist
+ unlet s:netrwmarkfilelist_{curbufnr}
+ unlet s:netrwmarkfilemtch_{curbufnr}
+ 2match none
+ endif
+
+" call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+" call Dret("s:NetrwUnMarkFile")
+endfun
- else
- " netrwFileHandlers#Invoke() always returns 0
- let ret= netrwFileHandlers#Invoke(exten,fname)
- endif
+" ---------------------------------------------------------------------
+" s:NetrwMenu: generates the menu for gvim and netrw {{{2
+fun! s:NetrwMenu(domenu)
- " if unsuccessful, attempt netrwFileHandlers#Invoke()
- if ret
- let ret= netrwFileHandlers#Invoke(exten,fname)
+ if !exists("g:NetrwMenuPriority")
+ let g:NetrwMenuPriority= 80
endif
- redraw!
+ if has("menu") && has("gui_running") && &go =~ 'm' && g:netrw_menu
+" call Dfunc("NetrwMenu(domenu=".a:domenu.")")
- " cleanup: remove temporary file,
- " delete current buffer if success with handler,
- " return to prior buffer (directory listing)
- if a:remote == 1 && fname != a:fname
-" call Decho("deleting temporary file<".fname.">")
- call s:System("delete",fname)
- endif
+ if !exists("s:netrw_menu_enabled") && a:domenu
+" call Decho("initialize menu")
+ let s:netrw_menu_enabled= 1
+ exe 'silent! menu '.g:NetrwMenuPriority.'.1 '.g:NetrwTopLvlMenu.'Help<tab><F1> <F1>'
+ call s:NetrwBookmarkMenu() " provide some history! uses priorities 2,3, reserves 4
+ exe 'silent! menu '.g:NetrwMenuPriority.'.5 '.g:NetrwTopLvlMenu.'-Sep1- :'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.6 '.g:NetrwTopLvlMenu.'Go\ Up\ Directory<tab>- -'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.7 '.g:NetrwTopLvlMenu.'Apply\ Special\ Viewer<tab>x x'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.8.1 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Current\ Directory<tab>mb mb'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.8.2 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Bookmark\ Delete<tab>mB mB'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.8.3 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Goto\ Bookmark<tab>gb gb'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.8.4 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Goto\ Prev\ Dir\ (History)<tab>u u'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.8.5 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.Goto\ Next\ Dir\ (History)<tab>U U'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.8.6 '.g:NetrwTopLvlMenu.'Bookmarks\ and\ History.List<tab>qb qb'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.9.1 '.g:NetrwTopLvlMenu.'Browsing\ Control.Edit\ File\ Hiding\ List<tab>'."<ctrl-h> \<Plug>NetrwHideEdit"
+ exe 'silent! menu '.g:NetrwMenuPriority.'.9.2 '.g:NetrwTopLvlMenu.'Browsing\ Control.Edit\ Sorting\ Sequence<tab>S S'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.9.3 '.g:NetrwTopLvlMenu.'Browsing\ Control.Quick\ Hide/Unhide\ Dot\ Files<tab>'."gh gh"
+ exe 'silent! menu '.g:NetrwMenuPriority.'.9.4 '.g:NetrwTopLvlMenu.'Browsing\ Control.Refresh\ Listing<tab>'."<ctrl-l> \<Plug>NetrwRefresh"
+ exe 'silent! menu '.g:NetrwMenuPriority.'.9.5 '.g:NetrwTopLvlMenu.'Browsing\ Control.Settings/Options<tab>:NetrwSettings '.":NetrwSettings\<cr>"
+ exe 'silent! menu '.g:NetrwMenuPriority.'.10 '.g:NetrwTopLvlMenu.'Delete\ File/Directory<tab>D D'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.11.1 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Current\ Window<tab><cr> '."\<cr>"
+ exe 'silent! menu '.g:NetrwMenuPriority.'.11.2 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.Preview\ File/Directory<tab>p p'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.11.3 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ Previous\ Window<tab>P P'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.11.4 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Window<tab>o o'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.11.5 '.g:NetrwTopLvlMenu.'Edit\ File/Dir.In\ New\ Vertical\ Window<tab>v v'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.12.1 '.g:NetrwTopLvlMenu.'Explore.Directory\ Name :Explore '
+ exe 'silent! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (curdir\ only)<tab>:Explore\ */ :Explore */'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.12.2 '.g:NetrwTopLvlMenu.'Explore.Filenames\ Matching\ Pattern\ (+subdirs)<tab>:Explore\ **/ :Explore **/'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.12.3 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ Pattern\ (curdir\ only)<tab>:Explore\ *// :Explore *//'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Files\ Containing\ Pattern\ (+subdirs)<tab>:Explore\ **// :Explore **//'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Next\ Match<tab>:Nexplore :Nexplore<cr>'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.12.4 '.g:NetrwTopLvlMenu.'Explore.Prev\ Match<tab>:Pexplore :Pexplore<cr>'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.13 '.g:NetrwTopLvlMenu.'Make\ Subdirectory<tab>d d'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.1 '.g:NetrwTopLvlMenu.'Marked\ Files.Mark\ File<tab>mf mf'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.2 '.g:NetrwTopLvlMenu.'Marked\ Files.Mark\ Files\ by\ Regexp<tab>mr mr'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.3 '.g:NetrwTopLvlMenu.'Marked\ Files.Hide-Show-List\ Control<tab>a a'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.4 '.g:NetrwTopLvlMenu.'Marked\ Files.Copy\ To\ Target<tab>mc mc'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.5 '.g:NetrwTopLvlMenu.'Marked\ Files.Delete<tab>D D'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.6 '.g:NetrwTopLvlMenu.'Marked\ Files.Diff<tab>md md'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.7 '.g:NetrwTopLvlMenu.'Marked\ Files.Edit<tab>me me'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.8 '.g:NetrwTopLvlMenu.'Marked\ Files.Exe\ Cmd<tab>mx mx'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.9 '.g:NetrwTopLvlMenu.'Marked\ Files.Move\ To\ Target<tab>mm mm'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.10 '.g:NetrwTopLvlMenu.'Marked\ Files.Obtain<tab>O O'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.11 '.g:NetrwTopLvlMenu.'Marked\ Files.Print<tab>mp mp'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.12 '.g:NetrwTopLvlMenu.'Marked\ Files.Replace<tab>R R'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.13 '.g:NetrwTopLvlMenu.'Marked\ Files.Set\ Target<tab>mt mt'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.14 '.g:NetrwTopLvlMenu.'Marked\ Files.Tag<tab>mT mT'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.14.15 '.g:NetrwTopLvlMenu.'Marked\ Files.Zip/Unzip/Compress/Uncompress<tab>mz mz'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.15 '.g:NetrwTopLvlMenu.'Obtain\ File<tab>O O'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.16.1 '.g:NetrwTopLvlMenu.'Style.Listing\ Style\ (thin-long-wide-tree)<tab>i i'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.16.2 '.g:NetrwTopLvlMenu.'Style.Normal-Hide-Show<tab>a a'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.16.3 '.g:NetrwTopLvlMenu.'Style.Reverse\ Sorting\ Order<tab>'."r r"
+ exe 'silent! menu '.g:NetrwMenuPriority.'.16.4 '.g:NetrwTopLvlMenu.'Style.Sorting\ Method\ (name-time-size)<tab>s s'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.17 '.g:NetrwTopLvlMenu.'Rename\ File/Directory<tab>R R'
+ exe 'silent! menu '.g:NetrwMenuPriority.'.18 '.g:NetrwTopLvlMenu.'Set\ Current\ Directory<tab>c c'
+ let s:netrw_menucnt= 28
- if a:remote == 1
- setlocal bh=delete bt=nofile
- if g:netrw_use_noswf
- setlocal noswf
+ elseif !a:domenu
+ let s:netrwcnt = 0
+ let curwin = winnr()
+ windo if getline(2) =~ "Netrw" | let s:netrwcnt= s:netrwcnt + 1 | endif
+ exe curwin."wincmd w"
+
+ if s:netrwcnt <= 1
+" call Decho("clear menus")
+ exe 'silent! unmenu '.g:NetrwTopLvlMenu
+" call Decho('exe silent! unmenu '.g:NetrwTopLvlMenu.'*')
+ silent! unlet s:netrw_menu_enabled
+ endif
endif
- exe "norm! \<c-o>"
- redraw!
+" call Dret("NetrwMenu")
endif
-" call Dret("NetBrowseX")
endfun
" ---------------------------------------------------------------------
-" NetBrowseFtpCmd: unfortunately, not all ftp servers honor options for ls {{{2
-" This function assumes that a long listing will be received. Size, time,
-" and reverse sorts will be requested of the server but not otherwise
-" enforced here.
-fun! s:NetBrowseFtpCmd(path,listcmd)
-" call Dfunc("NetBrowseFtpCmd(path<".a:path."> listcmd<".a:listcmd.">) netrw_method=".w:netrw_method)
-" call Decho("line($)=".line("$")." bannercnt=".w:netrw_bannercnt)
+" s:NetrwObtain: obtain file under cursor or from markfile list {{{2
+" Used by the O maps (as <SID>NetrwObtain())
+fun! s:NetrwObtain(islocal)
+" call Dfunc("NetrwObtain(islocal=".a:islocal.")")
+
+ if exists("s:netrwmarkfilelist_{bufnr('%')}")
+ let islocal= s:netrwmarkfilelist_{bufnr("%")}[1] !~ '^\a\+://'
+ call netrw#NetrwObtain(islocal,s:netrwmarkfilelist_{bufnr("%")})
+ call s:NetrwUnmarkList(bufnr('%'),b:netrw_curdir)
+ else
+ call netrw#NetrwObtain(a:islocal,expand("<cWORD>"))
+ endif
- " because WinXX ftp uses unix style input
- let ffkeep= &ff
- setlocal ma ff=unix noro
+" call Dret("NetrwObtain")
+endfun
- " clear off any older non-banner lines
- " note that w:netrw_bannercnt indexes the line after the banner
-" call Decho('exe silent! keepjumps '.w:netrw_bannercnt.",$d (clear off old non-banner lines)")
- exe "silent! keepjumps ".w:netrw_bannercnt.",$d"
+" ---------------------------------------------------------------------
+" netrw#NetrwObtain: {{{2
+" netrw#NetrwObtain(islocal,fname[,tgtdirectory])
+" islocal=0 obtain from remote source
+" =1 obtain from local source
+" fname : a filename or a list of filenames
+" tgtdir : optional place where files are to go (not present, uses getcwd())
+fun! netrw#NetrwObtain(islocal,fname,...)
+" call Dfunc("netrw#NetrwObtain(islocal=".a:islocal." fname<".((type(a:fname) == 1)? a:fname : string(a:fname)).">) a:0=".a:0)
+ " NetrwStatusLine support - for obtaining support
- ".........................................
- if w:netrw_method == 2 || w:netrw_method == 5
- " ftp + <.netrc>: Method #2
- if a:path != ""
- put ='cd \"'.a:path.'\"'
- endif
- if exists("g:netrw_ftpextracmd")
- exe "put ='".g:netrw_ftpextracmd."'"
-" call Decho("filter input: ".getline("."))
- endif
- exe "put ='".a:listcmd."'"
-" exe w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
- if exists("g:netrw_port") && g:netrw_port != ""
-" call Decho("exe ".g:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
- exe g:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
+ if type(a:fname) == 1
+ let fnamelist= [ a:fname ]
+ elseif type(a:fname) == 3
+ let fnamelist= a:fname
+ else
+ call netrw#ErrorMsg(s:ERROR,"attempting to use NetrwObtain on something not a filename or a list",62)
+" call Dret("netrw#NetrwObtain")
+ return
+ endif
+" call Decho("fnamelist<".string(fnamelist).">")
+ if a:0 > 0
+ let tgtdir= a:1
+ else
+ let tgtdir= getcwd()
+ endif
+" call Decho("tgtdir<".tgtdir.">")
+
+ if a:islocal
+ " obtain a file from b:netrw_curdir to getcwd()
+" call Decho("obtain a local file from ".b:netrw_curdir." to ".tgtdir
+ if exists("b:netrw_curdir") && getcwd() != b:netrw_curdir
+ let topath= s:ComposePath(tgtdir,"")
+ if (has("win32") || has("win95") || has("win64") || has("win16"))
+ " transfer files one at time
+ for fname in fnamelist
+" call Decho("system(".g:netrw_localcopycmd." ".fname." ".shellescape(topath).")")
+ call system(g:netrw_localcopycmd." ".fname." ".shellescape(topath))
+ endfor
+ else
+ " transfer files with one command
+ let filelist= join(map(copy(fname),"shellescape(v:val)"))
+" call Decho("system(".g:netrw_localcopycmd." ".filelist." ".shellescape(topath).")")
+ call system(g:netrw_localcopycmd." ".filelist." ".shellescape(topath))
+ endif
+ elseif !exists("b:netrw_curdir")
+ call netrw#ErrorMsg(s:ERROR,"local browsing directory doesn't exist!",36)
else
-" call Decho("exe ".g:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
- exe g:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine
+ call netrw#ErrorMsg(s:WARNING,"local browsing directory and current directory are identical",37)
endif
- ".........................................
- elseif w:netrw_method == 3
- " ftp + machine,id,passwd,filename: Method #3
+ else
+" call Decho("obtain a remote file from ".b:netrw_curdir." to ".tgtdir)
+ if type(a:fname) == 1
+ call s:SetupNetrwStatusLine('%f %h%m%r%=%9*Obtaining '.a:fname)
+ endif
+ call s:NetrwMethod(b:netrw_curdir)
+
+ if b:netrw_method == 4
+ " obtain file using scp
+" call Decho("obtain via scp (method#4)")
+ if exists("g:netrw_port") && g:netrw_port != ""
+ let useport= " ".g:netrw_scpport." ".g:netrw_port
+ else
+ let useport= ""
+ endif
+ if b:netrw_fname =~ '/'
+ let path= substitute(b:netrw_fname,'^\(.*/\).\{-}$','\1','')
+ else
+ let path= ""
+ endif
+ let filelist= join(map(copy(fnamelist),'shellescape(g:netrw_machine.":".escape(path.v:val,g:netrw_fname_escape))'))
+" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".filelist." ".shellescape(tgtdir))
+ exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".filelist." ".shellescape(tgtdir)
+
+ elseif b:netrw_method == 2
+ " obtain file using ftp + .netrc
+" call Decho("obtain via ftp+.netrc (method #2)")
+ call s:SaveBufVars()|silent keepjumps new|call s:RestoreBufVars()
+ let tmpbufnr= bufnr("%")
+ setlocal ff=unix
+ if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
+ exe "put ='".g:netrw_ftpmode."'"
+" call Decho("filter input: ".getline('$'))
+ endif
+
+ if exists("b:netrw_fname") && b:netrw_fname != ""
+ call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
+" call Decho("filter input: ".getline('$'))
+ endif
+
+ if exists("g:netrw_ftpextracmd")
+ exe "put ='".g:netrw_ftpextracmd."'"
+" call Decho("filter input: ".getline('$'))
+ endif
+ for fname in fnamelist
+ call setline(line("$")+1,'get "'.fname.'"')
+" call Decho("filter input: ".getline('$'))
+ endfor
+ if exists("g:netrw_port") && g:netrw_port != ""
+" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
+ else
+" call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
+ endif
+ " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+ if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
+ let debugkeep= &debug
+ setlocal debug=msg
+ call netrw#ErrorMsg(s:ERROR,getline(1),4)
+ let &debug= debugkeep
+ endif
+
+ elseif b:netrw_method == 3
+ " obtain with ftp + machine, id, passwd, and fname (ie. no .netrc)
+" call Decho("obtain via ftp+mipf (method #3)")
+ call s:SaveBufVars()|silent keepjumps new|call s:RestoreBufVars()
+ let tmpbufnr= bufnr("%")
setlocal ff=unix
+
if exists("g:netrw_port") && g:netrw_port != ""
put ='open '.g:netrw_machine.' '.g:netrw_port
+" call Decho("filter input: ".getline('$'))
else
put ='open '.g:netrw_machine
+" call Decho("filter input: ".getline('$'))
endif
if exists("g:netrw_ftp") && g:netrw_ftp == 1
put =g:netrw_uid
- put ='\"'.g:netrw_passwd.'\"'
+" call Decho("filter input: ".getline('$'))
+ put ='\"'.s:netrw_passwd.'\"'
+" call Decho("filter input: ".getline('$'))
else
- put ='user \"'.g:netrw_uid.'\" \"'.g:netrw_passwd.'\"'
+ put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+" call Decho("filter input: ".getline('$'))
endif
- if a:path != ""
- put ='cd \"'.a:path.'\"'
- endif
- if exists("g:netrw_ftpextracmd")
- exe "put ='".g:netrw_ftpextracmd."'"
-" call Decho("filter input: ".getline("."))
- endif
- exe "put ='".a:listcmd."'"
+ if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
+ put =g:netrw_ftpmode
+" call Decho("filter input: ".getline('$'))
+ endif
+
+ if exists("b:netrw_fname") && b:netrw_fname != ""
+ call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
+" call Decho("filter input: ".getline('$'))
+ endif
+
+ if exists("g:netrw_ftpextracmd")
+ exe "put ='".g:netrw_ftpextracmd."'"
+" call Decho("filter input: ".getline('$'))
+ endif
+
+ if exists("g:netrw_ftpextracmd")
+ exe "put ='".g:netrw_ftpextracmd."'"
+" call Decho("filter input: ".getline('$'))
+ endif
+ for fname in fnamelist
+ call setline(line("$")+1,'get "'.fname.'"')
+ endfor
+" call Decho("filter input: ".getline('$'))
" perform ftp:
" -i : turns off interactive prompting from ftp
" -n unix : DON'T use <.netrc>, even though it exists
" -n win32: quit being obnoxious about password
-" exe w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
-" call Decho("exe ".g:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i -n")
- exe g:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i -n"
+ norm! 1Gdd
+" call Decho("executing: %!".g:netrw_ftp_cmd." -i -n")
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
+ " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+ if getline(1) !~ "^$"
+" call Decho("error<".getline(1).">")
+ if !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:ERROR,getline(1),5)
+ endif
+ endif
+ endif
- ".........................................
- else
- call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . choice . ">",23)
endif
- " cleanup for Windows
- if has("win32") || has("win95") || has("win64") || has("win16")
- silent! keepjumps %s/\r$//e
- endif
- if a:listcmd == "dir"
- " infer directory/link based on the file permission string
- silent! keepjumps g/d\%([-r][-w][-x]\)\{3}/s@$@/@
- silent! keepjumps g/l\%([-r][-w][-x]\)\{3}/s/$/@/
- if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
- exe "silent! keepjumps ".w:netrw_bannercnt.',$s/^\%(\S\+\s\+\)\{8}//e'
+ " cleanup
+ if exists("tmpbufnr")
+ if bufnr("%") != tmpbufnr
+ exe tmpbufnr."bw!"
+ else
+ q!
endif
endif
- " ftp's listing doesn't seem to include ./ or ../
- if !search('^\.\/$\|\s\.\/$','wn')
- exe 'keepjumps '.w:netrw_bannercnt
- put ='./'
- endif
- if !search('^\.\.\/$\|\s\.\.\/$','wn')
- exe 'keepjumps '.w:netrw_bannercnt
- put ='../'
- endif
-
- " restore settings
- let &ff= ffkeep
-" call Dret("NetBrowseFtpCmd")
+" call Dret("netrw#NetrwObtain")
endfun
" ---------------------------------------------------------------------
-" NetListHide: uses [range]g~...~d to delete files that match comma {{{2
-" separated patterns given in g:netrw_list_hide
-fun! s:NetListHide()
-" call Dfunc("NetListHide() hide=".g:netrw_hide." listhide<".g:netrw_list_hide.">")
+" s:NetrwPrevWinOpen: open file/directory in previous window. {{{2
+" If there's only one window, then the window will first be split.
+" Returns:
+" choice = 0 : didn't have to choose
+" choice = 1 : saved modified file in window first
+" choice = 2 : didn't save modified file, opened window
+" choice = 3 : cancel open
+fun! s:NetrwPrevWinOpen(islocal)
+" call Dfunc("NetrwPrevWinOpen(islocal=".a:islocal.")")
- " find a character not in the "hide" string to use as a separator for :g and :v commands
- " How-it-works: take the hiding command, convert it into a range. Duplicate
- " characters don't matter. Remove all such characters from the '/~...90'
- " string. Use the first character left as a separator character.
- let listhide= g:netrw_list_hide
- let sep = strpart(substitute('/~@#$%^&*{};:,<.>?|1234567890','['.escape(listhide,'-]^\').']','','ge'),1,1)
-" call Decho("sep=".sep)
+ " grab a copy of the b:netrw_curdir to pass it along to newly split windows
+ let curdir = b:netrw_curdir
- while listhide != ""
- if listhide =~ ','
- let hide = substitute(listhide,',.*$','','e')
- let listhide = substitute(listhide,'^.\{-},\(.*\)$','\1','e')
+ " get last window number and the word currently under the cursor
+ let lastwinnr = winnr("$")
+ let curword = s:NetrwGetWord()
+ let choice = 0
+" call Decho("lastwinnr=".lastwinnr." curword<".curword.">")
+
+ let didsplit = 0
+ if lastwinnr == 1
+ " if only one window, open a new one first
+" call Decho("only one window, so open a new one (g:netrw_alto=".g:netrw_alto.")")
+ if g:netrw_preview
+" call Decho("exe ".(g:netrw_alto? "top " : "bot ")."vert ".g:netrw_winsize."wincmd s")
+ exe (g:netrw_alto? "top " : "bot ")."vert ".g:netrw_winsize."wincmd s"
else
- let hide = listhide
- let listhide= ""
+" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s")
+ exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
endif
+ let didsplit = 1
- " Prune the list by hiding any files which match
- if g:netrw_hide == 1
-" call Decho("hiding<".hide."> listhide<".listhide.">")
- exe 'silent keepjumps '.w:netrw_bannercnt.',$g'.sep.hide.sep.'d'
- elseif g:netrw_hide == 2
-" call Decho("showing<".hide."> listhide<".listhide.">")
- exe 'silent keepjumps '.w:netrw_bannercnt.',$g'.sep.hide.sep.'s@^@ /-KEEP-/ @'
+ else
+ call s:SaveBufVars()
+" call Decho("wincmd p")
+ wincmd p
+ call s:RestoreBufVars()
+ " if the previous window's buffer has been changed (is modified),
+ " and it doesn't appear in any other extant window, then ask the
+ " user if s/he wants to abandon modifications therein.
+ let bnr = winbufnr(0)
+ let bnrcnt = 0
+ if &mod
+" call Decho("detected: prev window's buffer has been modified: bnr=".bnr." winnr#".winnr())
+ let eikeep= &ei
+ set ei=all
+ windo if winbufnr(0) == bnr | let bnrcnt=bnrcnt+1 | endif
+ exe bnr."wincmd p"
+ let &ei= eikeep
+" call Decho("bnr=".bnr." bnrcnt=".bnrcnt." buftype=".&bt." winnr#".winnr())
+ if bnrcnt == 1
+ let bufname= bufname(winbufnr(winnr()))
+ let choice= confirm("Save modified file<".bufname.">?","&Yes\n&No\n&Cancel")
+" call Decho("bufname<".bufname."> choice=".choice." winnr#".winnr())
+
+ if choice == 1
+ " Yes -- write file & then browse
+ let v:errmsg= ""
+ silent w
+ if v:errmsg != ""
+ call netrw#ErrorMsg(s:ERROR,"unable to write <".bufname.">!",30)
+ if didsplit
+ q
+ else
+ wincmd p
+ endif
+" call Dret("NetrwPrevWinOpen ".choice." : unable to write <".bufname.">")
+ return choice
+ endif
+
+ elseif choice == 2
+ " No -- don't worry about changed file, just browse anyway
+ setlocal nomod
+ call netrw#ErrorMsg(s:WARNING,bufname." changes to ".bufname." abandoned",31)
+ wincmd p
+
+ else
+ " Cancel -- don't do this
+ if didsplit
+ q
+ else
+ wincmd p
+ endif
+" call Dret("NetrwPrevWinOpen ".choice." : cancelled")
+ return choice
+ endif
+ endif
endif
- endwhile
- if g:netrw_hide == 2
- exe 'silent keepjumps '.w:netrw_bannercnt.',$v@^ /-KEEP-/ @d'
- exe 'silent keepjumps '.w:netrw_bannercnt.',$s@^\%( /-KEEP-/ \)\+@@e'
endif
-" call Dret("NetListHide")
+ " restore b:netrw_curdir (window split/enew may have lost it)
+ let b:netrw_curdir= curdir
+ if a:islocal < 2
+ if a:islocal
+ call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(a:islocal,curword))
+ else
+ call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,curword))
+ endif
+ endif
+" call Dret("NetrwPrevWinOpen ".choice)
+ return choice
endfun
" ---------------------------------------------------------------------
-" NetHideEdit: allows user to edit the file/directory hiding list
-fun! s:NetHideEdit(islocal)
-" call Dfunc("NetHideEdit(islocal=".a:islocal.")")
+" s:NetrwUpload: load fname to tgt (used by NetrwMarkFileCopy()) {{{2
+" Always assumed to be local -> remote
+" call s:NetrwUpload(filename, target)
+" call s:NetrwUpload(filename, target, fromdirectory)
+fun! s:NetrwUpload(fname,tgt,...)
+" call Dfunc("s:NetrwUpload(fname<".((type(a:fname) == 1)? a:fname : string(a:fname))."> tgt<".a:tgt.">) a:0=".a:0)
+
+ if a:tgt =~ '^\a\+://'
+ let tgtdir= substitute(a:tgt,'^\a\+://[^/]\+/\(.\{-}\)$','\1','')
+ else
+ let tgtdir= substitute(a:tgt,'^\(.*\)/[^/]*$','\1','')
+ endif
+" call Decho("tgtdir<".tgtdir.">")
- " save current cursor position
- let s:nhe_curpos= getpos(".")
+ if a:0 > 0
+ let fromdir= a:1
+ else
+ let fromdir= getcwd()
+ endif
+" call Decho("fromdir<".fromdir.">")
+
+ if type(a:fname) == 1
+ " handle uploading a single file using NetWrite
+" call Decho("handle uploading a single file via NetWrite")
+ 1split
+ let efname= escape(a:fname,g:netrw_fname_escape)
+" call Decho("exe e ".efname)
+ exe "e ".efname
+" call Decho("now locally editing<".expand("%").">, has ".line("$")." lines")
+ if a:tgt =~ '/$'
+ let wfname= substitute(a:fname,'^.*/','','')
+ let wfname= escape(a:tgt.wfname,g:netrw_fname_escape)
+" call Decho("exe w! ".wfname)
+ exe "w! ".wfname
+ else
+ let wfname= escape(a:tgt,g:netrw_fname_escape)
+" call Decho("writing local->remote: exe w ".wfname)
+ exe "w ".wfname
+" call Decho("done writing local->remote")
+ endif
+ q!
+
+ elseif type(a:fname) == 3
+ " handle uploading a list of files via scp
+" call Decho("handle uploading a list of files via scp")
+ let curdir= getcwd()
+ if a:tgt =~ '^scp:'
+ exe "keepjumps silent lcd ".fnameescape(fromdir)
+ let filelist= copy(s:netrwmarkfilelist_{bufnr('%')})
+ let args = join(map(filelist,"shellescape(v:val)"))
+ if exists("g:netrw_port") && g:netrw_port != ""
+ let useport= " ".g:netrw_scpport." ".g:netrw_port
+ else
+ let useport= ""
+ endif
+ let machine = substitute(a:tgt,'^scp://\([^/:]\+\).*$','\1','')
+ let tgt = substitute(a:tgt,'^scp://[^/]\+/\(.*\)$','\1','')
+" call Decho("exe ".s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".args." ".shellescape(machine.":".escape(tgt,g:netrw_fname_escape)))
+ exe s:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".args." ".shellescape(machine.":".escape(tgt,g:netrw_fname_escape))
+ exe "keepjumps silent lcd ".fnameescape(curdir)
- " get new hiding list from user
- call inputsave()
- let newhide= input("Edit Hiding List: ",g:netrw_list_hide)
- call inputrestore()
- let g:netrw_list_hide= newhide
-" call Decho("new g:netrw_list_hide<".g:netrw_list_hide.">")
+ elseif a:tgt =~ '^ftp:'
+ call s:NetrwMethod(a:tgt)
- " refresh the listing
- silent call s:NetRefresh(a:islocal,s:NetBrowseChgDir(a:islocal,"./"))
+ if b:netrw_method == 2
+ " handle uploading a list of files via ftp+.netrc
+ let netrw_fname = b:netrw_fname
+ silent keepjumps new
+" call Decho("filter input window#".winnr())
- " restore cursor position
- call setpos('.',s:nhe_curpos)
- unlet s:nhe_curpos
+ exe "put ='".g:netrw_ftpmode."'"
+" call Decho("filter input: ".getline('$'))
-" call Dret("NetHideEdit")
-endfun
+ if exists("g:netrw_ftpextracmd")
+ exe "put ='".g:netrw_ftpextracmd."'"
+" call Decho("filter input: ".getline('$'))
+ endif
-" ---------------------------------------------------------------------
-" NetSortSequence: allows user to edit the sorting sequence
-fun! s:NetSortSequence(islocal)
-" call Dfunc("NetSortSequence(islocal=".a:islocal.")")
+ call setline(line("$")+1,'lcd "'.fromdir.'"')
+" call Decho("filter input: ".getline('$'))
- call inputsave()
- let newsortseq= input("Edit Sorting Sequence: ",g:netrw_sort_sequence)
- call inputrestore()
+ call setline(line("$")+1,'cd "'.tgtdir.'"')
+" call Decho("filter input: ".getline('$'))
- " refresh the listing
- let g:netrw_sort_sequence= newsortseq
- call netrw#NetSavePosn()
- call s:NetRefresh(a:islocal,s:NetBrowseChgDir(a:islocal,'./'))
+ for fname in a:fname
+ call setline(line("$")+1,'put "'.fname.'"')
+" call Decho("filter input: ".getline('$'))
+ endfor
-" call Dret("NetSortSequence")
-endfun
+ if exists("g:netrw_port") && g:netrw_port != ""
+" call Decho("executing: ".s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
+ else
+" call Decho("filter input window#".winnr())
+" call Decho("executing: ".s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
+ endif
+ " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+ silent g/Local directory now/d
+ if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
+ call netrw#ErrorMsg(s:ERROR,getline(1),14)
+ else
+ bw!|q
+ endif
-" ---------------------------------------------------------------------
-" NetListStyle: {{{2
-" islocal=0: remote browsing
-" =1: local browsing
-fun! s:NetListStyle(islocal)
-" call Dfunc("NetListStyle(islocal=".a:islocal.") w:netrw_liststyle=".w:netrw_liststyle)
- let fname = s:NetGetWord()
- if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif
- let w:netrw_liststyle = (w:netrw_liststyle + 1) % s:MAXLIST
-" call Decho("fname<".fname.">")
-" call Decho("chgd w:netrw_liststyle to ".w:netrw_liststyle)
-" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">")
+ elseif b:netrw_method == 3
+ " upload with ftp + machine, id, passwd, and fname (ie. no .netrc)
+ let netrw_fname= b:netrw_fname
+ call s:SaveBufVars()|silent keepjumps new|call s:RestoreBufVars()
+ let tmpbufnr= bufnr("%")
+ setlocal ff=unix
- if w:netrw_liststyle == s:THINLIST
- " use one column listing
-" call Decho("use one column list")
- let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
+ if exists("g:netrw_port") && g:netrw_port != ""
+ put ='open '.g:netrw_machine.' '.g:netrw_port
+" call Decho("filter input: ".getline('$'))
+ else
+ put ='open '.g:netrw_machine
+" call Decho("filter input: ".getline('$'))
+ endif
- elseif w:netrw_liststyle == s:LONGLIST
- " use long list
-" call Decho("use long list")
- let g:netrw_list_cmd = g:netrw_list_cmd." -l"
+ if exists("g:netrw_ftp") && g:netrw_ftp == 1
+ put =g:netrw_uid
+" call Decho("filter input: ".getline('$'))
+ call setline(line("$")+1,'"'.s:netrw_passwd.'"')
+" call Decho("filter input: ".getline('$'))
+ else
+ put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
+" call Decho("filter input: ".getline('$'))
+ endif
- elseif w:netrw_liststyle == s:WIDELIST
- " give wide list
-" call Decho("use wide list")
- let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
+ call setline(line("$")+1,'lcd "'.fromdir.'"')
+" call Decho("filter input: ".getline('$'))
- elseif w:netrw_liststyle == s:TREELIST
-" call Decho("use tree list")
- let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
+ if exists("b:netrw_fname") && b:netrw_fname != ""
+ call setline(line("$")+1,'cd "'.b:netrw_fname.'"')
+" call Decho("filter input: ".getline('$'))
+ endif
- else
- call netrw#ErrorMsg(s:WARNING,"bad value for g:netrw_liststyle (=".w:netrw_liststyle.")",46)
- let g:netrw_liststyle = s:THINLIST
- let w:netrw_liststyle = g:netrw_liststyle
- let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge')
+ if exists("g:netrw_ftpextracmd")
+ exe "put ='".g:netrw_ftpextracmd."'"
+" call Decho("filter input: ".getline('$'))
+ endif
+
+ for fname in a:fname
+ call setline(line("$")+1,'put "'.fname.'"')
+" call Decho("filter input: ".getline('$'))
+ endfor
+
+ " perform ftp:
+ " -i : turns off interactive prompting from ftp
+ " -n unix : DON'T use <.netrc>, even though it exists
+ " -n win32: quit being obnoxious about password
+ norm! 1Gdd
+" call Decho("executing: ".s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n")
+ exe s:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
+ " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+ silent g/Local directory now/d
+ if getline(1) !~ "^$" && !exists("g:netrw_quiet") && getline(1) !~ '^Trying '
+ let debugkeep= &debug
+ setlocal debug=msg
+ call netrw#ErrorMsg(s:ERROR,getline(1),15)
+ let &debug = debugkeep
+ let mod = 1
+ else
+ bw!|q
+ endif
+ endif
+ else
+ call netrw#ErrorMsg(s:ERROR,"can't obtain files with protocol from<".a:tgt.">",63)
+ endif
endif
- setlocal ma noro
- " clear buffer - this will cause NetBrowse/LocalBrowseCheck to do a refresh
+" call Dret("s:NetrwUpload")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwPreview: {{{2
+fun! s:NetrwPreview(path) range
+" call Dfunc("NetrwPreview(path<".a:path.">)")
+ call s:NetrwOptionSave("s:")
+ call s:NetrwSafeOptions()
+ if has("quickfix")
+ if !isdirectory(a:path)
+ exe (g:netrw_preview? "vert " : "")."pedit ".escape(a:path,g:netrw_fname_escape)
+ elseif !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:WARNING,"sorry, cannot preview a directory such as <".a:path.">",38)
+ endif
+ elseif !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:WARNING,"sorry, to preview your vim needs the quickfix feature compiled in",39)
+ endif
+ call s:NetrwOptionRestore("s:")
+" call Dret("NetrwPreview")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwRefresh: {{{2
+fun! s:NetrwRefresh(islocal,dirname)
+" call Dfunc("NetrwRefresh(islocal<".a:islocal.">,dirname=".a:dirname.") hide=".g:netrw_hide." sortdir=".g:netrw_sort_direction)
+ " at the current time (Mar 19, 2007) all calls to NetrwRefresh() call NetrwBrowseChgDir() first.
+ " NetrwBrowseChgDir() may clear the display; hence a NetrwSavePosn() may not work if its placed here.
+ " Also, NetrwBrowseChgDir() now does a NetrwSavePosn() itself.
+ setlocal ma noro
+" call Decho("setlocal ma noro")
" call Decho("clear buffer<".expand("%")."> with :%d")
%d
+ if a:islocal
+ call netrw#LocalBrowseCheck(a:dirname)
+ else
+ call s:NetrwBrowse(a:islocal,a:dirname)
+ endif
+ call netrw#NetrwRestorePosn()
- " refresh the listing
- call netrw#NetSavePosn()
- call s:NetRefresh(a:islocal,s:NetBrowseChgDir(a:islocal,'./'))
-
- " keep cursor on the filename
- silent keepjumps $
- let result= search('\%(^\%(|\+\s\)\=\|\s\{2,}\)\zs'.escape(fname,'.\[]*$^').'\%(\s\{2,}\|$\)','bc')
-" call Decho("search result=".result." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'N/A'))
- if result <= 0 && exists("w:netrw_bannercnt")
- exe w:netrw_bannercnt
+ " restore file marks
+ if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != ""
+" call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/")
+ exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/"
+ else
+" call Decho("2match none")
+ 2match none
endif
-" call Dret("NetListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : ""))
+" redraw!
+" call Dret("NetrwRefresh")
endfun
" ---------------------------------------------------------------------
-" NetWideListing: {{{2
-fun! s:NetWideListing()
+" s:NetrwRefreshDir: refreshes a directory by name {{{2
+" Called by NetrwMarkFileCopy()
+" Interfaces to s:NetrwRefresh() and s:LocalBrowseShellCmdRefresh()
+fun! s:NetrwRefreshDir(islocal,dirname)
+" call Dfunc("s:NetrwRefreshDir(islocal=".a:islocal." dirname<".a:dirname.">) fastbrowse=".g:netrw_fastbrowse)
+ if g:netrw_fastbrowse == 0
+ " slowest mode (keep buffers refreshed, local or remote)
+" call Decho("slowest mode: keep buffers refreshed, local or remote")
+ let tgtwin= bufwinnr(a:dirname)
+" call Decho("tgtwin= bufwinnr(".a:dirname.")=".tgtwin)
+
+ if tgtwin > 0
+ " tgtwin is being displayed, so refresh it
+ let curwin= winnr()
+" call Decho("refresh tgtwin#".tgtwin." (curwin#".curwin.")")
+ exe tgtwin."wincmd w"
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ exe curwin."wincmd w"
- if w:netrw_liststyle == s:WIDELIST
-" call Dfunc("NetWideListing() w:netrw_liststyle=".w:netrw_liststyle.' fo='.&fo.' l:fo='.&l:fo)
- " look for longest filename (cpf=characters per filename)
- " cpf: characters per file
- " fpl: files per line
- " fpc: files per column
- setlocal ma noro
- 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'
+ elseif bufnr(a:dirname) > 0
+ let bn= bufnr(a:dirname)
+" call Decho("bd bufnr(".a:dirname.")=".bn)
+ exe "silent bd ".bn
+ endif
+
+ elseif g:netrw_fastbrowse <= 1
+" call Decho("medium-speed mode: refresh local buffers only")
+ call s:LocalBrowseShellCmdRefresh()
+ endif
+" call Dret("s:NetrwRefreshDir")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwSetSort: sets up the sort based on the g:netrw_sort_sequence {{{2
+" What this function does is to compute a priority for the patterns
+" in the g:netrw_sort_sequence. It applies a substitute to any
+" "files" that satisfy each pattern, putting the priority / in
+" front. An "*" pattern handles the default priority.
+fun! s:NetrwSetSort()
+" call Dfunc("SetSort() bannercnt=".w:netrw_bannercnt)
+ if w:netrw_liststyle == s:LONGLIST
+ let seqlist = substitute(g:netrw_sort_sequence,'\$','\\%(\t\\|\$\\)','ge')
+ else
+ let seqlist = g:netrw_sort_sequence
+ endif
+ " sanity check -- insure that * appears somewhere
+ if seqlist == ""
+ let seqlist= '*'
+ elseif seqlist !~ '\*'
+ let seqlist= seqlist.',*'
+ endif
+ let priority = 1
+ while seqlist != ""
+ if seqlist =~ ','
+ let seq = substitute(seqlist,',.*$','','e')
+ let seqlist = substitute(seqlist,'^.\{-},\(.*\)$','\1','e')
else
-" call Dret("NetWideListing")
- return
+ let seq = seqlist
+ let seqlist = ""
endif
-" call Decho("max file strlen+1=".b:netrw_cpf)
- let b:netrw_cpf= b:netrw_cpf + 1
+ let sepchr= "\<Char-0xff>"
+ if priority < 10
+ let spriority= "00".priority.sepchr
+ elseif priority < 100
+ let spriority= "0".priority.sepchr
+ else
+ let spriority= priority.sepchr
+ endif
+" call Decho("priority=".priority." spriority<".spriority."> seq<".seq."> seqlist<".seqlist.">")
- " determine qty files per line (fpl)
- let w:netrw_fpl= winwidth(0)/b:netrw_cpf
- if w:netrw_fpl <= 0
- let w:netrw_fpl= 1
+ " sanity check
+ if w:netrw_bannercnt > line("$")
+ " apparently no files were left after a Hiding pattern was used
+" call Dret("SetSort : no files left after hiding")
+ return
endif
-" call Decho("fpl= ".winwidth(0)."/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl)
+ if seq == '*'
+ let starpriority= spriority
+ else
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$g/'.seq.'/s/^/'.spriority.'/'
+ " sometimes multiple sorting patterns will match the same file or directory.
+ " The following substitute is intended to remove the excess matches.
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$g/^\d\{3}'.sepchr.'\d\{3}\//s/^\d\{3}'.sepchr.'\(\d\{3}\/\).\@=/\1/e'
+ endif
+ let priority = priority + 1
+ endwhile
+ if exists("starpriority")
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$v/^\d\{3}'.sepchr.'/s/^/'.starpriority.'/'
+ endif
- " make wide display
- exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'s",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
-" call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]")
- silent! let keepregstar = @*
- while line("$") >= newcolstart
- if newcolend > line("$") | let newcolend= line("$") | endif
- let newcolqty= newcolend - newcolstart
- exe newcolstart
- if newcolqty == 0
- exe "silent keepjumps norm! 0\<c-v>$hx".w:netrw_bannercnt."G$p"
- else
- exe "silent keepjumps norm! 0\<c-v>".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p'
- endif
- exe "silent keepjumps ".newcolstart.','.newcolend.'d'
- exe 'silent keepjumps '.w:netrw_bannercnt
- endwhile
- silent! let @*= keepregstar
- exe "silent keepjumps ".w:netrw_bannercnt.',$s/\s\+$//e'
- setlocal noma nomod ro
-" call Dret("NetWideListing")
+ " Following line associated with priority -- items that satisfy a priority
+ " pattern get prefixed by ###/ which permits easy sorting by priority.
+ " Sometimes files can satisfy multiple priority patterns -- only the latest
+ " priority pattern needs to be retained. So, at this point, these excess
+ " priority prefixes need to be removed, but not directories that happen to
+ " be just digits themselves.
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{3}'.sepchr.'\)\%(\d\{3}'.sepchr.'\)\+\ze./\1/e'
+
+" call Dret("SetSort")
+endfun
+
+" =====================================================================
+" s:NetrwSortStyle: change sorting style (name - time - size) and refresh display {{{2
+fun! s:NetrwSortStyle(islocal)
+" call Dfunc("s:NetrwSortStyle(islocal=".a:islocal.") netrw_sort_by<".g:netrw_sort_by.">")
+ call s:NetrwSaveWordPosn()
+ let svpos= netrw#NetrwSavePosn()
+
+ let g:netrw_sort_by= (g:netrw_sort_by =~ 'n')? 'time' : (g:netrw_sort_by =~ 't')? 'size' : 'name'
+ norm! 0
+ call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+
+" call Dret("s:NetrwSortStyle : netrw_sort_by<".g:netrw_sort_by.">")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwSplit: mode {{{2
+" =0 : net and o
+" =1 : net and t
+" =2 : net and v
+" =3 : local and o
+" =4 : local and t
+" =5 : local and v
+fun! s:NetrwSplit(mode)
+" call Dfunc("s:NetrwSplit(mode=".a:mode.") alto=".g:netrw_alto." altv=".g:netrw_altv)
+
+ call s:SaveWinVars()
+
+ if a:mode == 0
+ " remote and o
+" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s")
+ exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
+ let s:didsplit= 1
+ call s:RestoreWinVars()
+ call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
+ unlet s:didsplit
+
+ elseif a:mode == 1
+ " remote and t
+ let cursorword = s:NetrwGetWord()
+" call Decho("tabnew")
+ tabnew
+ let s:didsplit= 1
+ call s:RestoreWinVars()
+ call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,cursorword))
+ unlet s:didsplit
+
+ elseif a:mode == 2
+ " remote and v
+" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v")
+ exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"
+ let s:didsplit= 1
+ call s:RestoreWinVars()
+ call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord()))
+ unlet s:didsplit
+
+ elseif a:mode == 3
+ " local and o
+" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s")
+ exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
+ let s:didsplit= 1
+ call s:RestoreWinVars()
+ call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+ unlet s:didsplit
+
+ elseif a:mode == 4
+ " local and t
+ let netrw_curdir= b:netrw_curdir
+ let cursorword = s:NetrwGetWord()
+" call Decho("tabnew")
+ tabnew
+ let b:netrw_curdir= netrw_curdir
+ let s:didsplit= 1
+ call s:RestoreWinVars()
+ call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,cursorword))
+ unlet s:didsplit
+
+ elseif a:mode == 5
+ " local and v
+" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v")
+ exe (g:netrw_altv? "rightb " : "lefta ").g:netrw_winsize."wincmd v"
+ let s:didsplit= 1
+ call s:RestoreWinVars()
+ call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord()))
+ unlet s:didsplit
+
+ else
+ call netrw#ErrorMsg(s:ERROR,"(NetrwSplit) unsupported mode=".a:mode,45)
endif
+" call Dret("s:NetrwSplit")
+endfun
+
+" ---------------------------------------------------------------------
+" NetrwStatusLine: {{{2
+fun! NetrwStatusLine()
+
+" vvv NetrwStatusLine() debugging vvv
+" let g:stlmsg=""
+" if !exists("w:netrw_explore_bufnr")
+" let g:stlmsg="!X<explore_bufnr>"
+" elseif w:netrw_explore_bufnr != bufnr("%")
+" let g:stlmsg="explore_bufnr!=".bufnr("%")
+" endif
+" if !exists("w:netrw_explore_line")
+" let g:stlmsg=" !X<explore_line>"
+" elseif w:netrw_explore_line != line(".")
+" let g:stlmsg=" explore_line!={line(.)<".line(".").">"
+" endif
+" if !exists("w:netrw_explore_list")
+" let g:stlmsg=" !X<explore_list>"
+" endif
+" ^^^ NetrwStatusLine() debugging ^^^
+
+ if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
+ " restore user's status line
+ let &stl = s:netrw_users_stl
+ let &laststatus = s:netrw_users_ls
+ if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
+ if exists("w:netrw_explore_line") |unlet w:netrw_explore_line |endif
+ return ""
+ else
+ return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen
+ endif
endfun
" ---------------------------------------------------------------------
-" NetTreeDir: determine tree directory given current cursor position {{{2
+" s:NetrwTreeDir: determine tree directory given current cursor position {{{2
" (full path directory with trailing slash returned)
-fun! s:NetTreeDir()
-" call Dfunc("NetTreeDir() curline#".line(".")."<".getline(".")."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
+fun! s:NetrwTreeDir()
+" call Dfunc("NetrwTreeDir() curline#".line(".")."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%").">")
let treedir= b:netrw_curdir
" call Decho("set initial treedir<".treedir.">")
- let s:treecurpos= getpos(".")
+ let s:treecurpos= netrw#NetrwSavePosn()
if w:netrw_liststyle == s:TREELIST
" call Decho("w:netrrw_liststyle is TREELIST:")
@@ -3288,7 +5477,7 @@ fun! s:NetTreeDir()
" now force a refresh
" call Decho("clear buffer<".expand("%")."> with :%d")
keepjumps %d
-" call Dret("NetTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">")
+" call Dret("NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">")
return b:netrw_curdir
endif
@@ -3303,7 +5492,7 @@ fun! s:NetTreeDir()
" construct treedir by searching backwards at correct depth
" call Decho("constructing treedir<".treedir."> depth<".depth.">")
while depth != "" && search('^'.depth.'[^|].\{-}/$','bW')
- let dirname= substitute(getline("."),'^\(| \)*','','e')
+ let dirname= substitute(getline('.'),'^\(| \)*','','e')
let treedir= dirname.treedir
let depth = substitute(depth,'^| ','','')
" call Decho("constructing treedir<".treedir.">: dirname<".dirname."> while depth<".depth.">")
@@ -3313,23 +5502,23 @@ fun! s:NetTreeDir()
else
let treedir= w:netrw_treetop.'/'.treedir
endif
-" call Decho("bufnr(.)=".bufnr(".")." line($)=".line("$")." line(.)=".line("."))
+" call Decho("bufnr(.)=".bufnr("%")." line($)=".line("$")." line(.)=".line("."))
endif
let treedir= substitute(treedir,'//$','/','')
" " now force a refresh
-" call Decho("clear buffer<".expand("%")."> with :%d")
+"" call DECHO("clear buffer<".expand("%")."> with :%d")
" setlocal ma noro
" keepjumps %d
-" call Dret("NetTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">")
+" call Dret("NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".string(s:treecurpos).">")
return treedir
endfun
" ---------------------------------------------------------------------
-" NetTreeDisplay: recursive tree display {{{2
-fun! s:NetTreeDisplay(dir,depth)
-" call Dfunc("NetTreeDisplay(dir<".a:dir."> depth<".a:depth.">)")
+" s:NetrwTreeDisplay: recursive tree display {{{2
+fun! s:NetrwTreeDisplay(dir,depth)
+" call Dfunc("NetrwTreeDisplay(dir<".a:dir."> depth<".a:depth.">)")
" insure that there are no folds
setlocal nofen
@@ -3360,37 +5549,39 @@ fun! s:NetTreeDisplay(dir,depth)
" display subtrees (if any)
let depth= "| ".a:depth
+
" call Decho("display subtrees with depth<".depth."> and current leaves")
for entry in w:netrw_treedict[a:dir]
let direntry= substitute(dir.entry,'/$','','e')
" call Decho("dir<".dir."> entry<".entry."> direntry<".direntry.">")
if entry =~ '/$' && has_key(w:netrw_treedict,direntry)
" call Decho("<".direntry."> is a key in treedict - display subtree for it")
- call s:NetTreeDisplay(direntry,depth)
+ call s:NetrwTreeDisplay(direntry,depth)
elseif entry =~ '/$' && has_key(w:netrw_treedict,direntry.'/')
" call Decho("<".direntry."/> is a key in treedict - display subtree for it")
- call s:NetTreeDisplay(direntry.'/',depth)
+ call s:NetrwTreeDisplay(direntry.'/',depth)
else
" call Decho("<".entry."> is not a key in treedict (no subtree)")
call setline(line("$")+1,depth.entry)
endif
endfor
-" call Dret("NetTreeDisplay")
+" call Dret("NetrwTreeDisplay")
endfun
" ---------------------------------------------------------------------
-" NetTreeListing: displays tree listing from treetop on down, using NetTreeDisplay() {{{2
-fun! s:NetTreeListing(dirname)
+" s:NetrwTreeListing: displays tree listing from treetop on down, using NetrwTreeDisplay() {{{2
+fun! s:NetrwTreeListing(dirname)
if w:netrw_liststyle == s:TREELIST
-" call Dfunc("NetTreeListing() bufname<".expand("%").">")
+" call Dfunc("NetrwTreeListing() bufname<".expand("%").">")
" call Decho("curdir<".a:dirname.">")
+" call Decho("win#".winnr().": w:netrw_treetop ".(exists("w:netrw_treetop")? "exists" : "doesn't exit")." w:netrw_treedict ".(exists("w:netrw_treedict")? "exists" : "doesn't exit"))
" update the treetop
" call Decho("update the treetop")
if !exists("w:netrw_treetop")
let w:netrw_treetop= a:dirname
" call Decho("w:netrw_treetop<".w:netrw_treetop."> (reusing)")
- elseif (w:netrw_treetop =~ ('^'.a:dirname) && strlen(a:dirname) < strlen(w:netrw_treetop)) || a:dirname !~ ('^'.w:netrw_treetop)
+ elseif (w:netrw_treetop =~ ('^'.a:dirname) && s:Strlen(a:dirname) < s:Strlen(w:netrw_treetop)) || a:dirname !~ ('^'.w:netrw_treetop)
let w:netrw_treetop= a:dirname
" call Decho("w:netrw_treetop<".w:netrw_treetop."> (went up)")
endif
@@ -3405,7 +5596,7 @@ fun! s:NetTreeListing(dirname)
" call Decho("bannercnt=".w:netrw_bannercnt." line($)=".line("$"))
exe "silent! keepjumps ".w:netrw_bannercnt.',$g@^\.\.\=/$@d'
let w:netrw_treedict[a:dirname]= getline(w:netrw_bannercnt,line("$"))
-" call Decho("treedict=".string(w:netrw_treedict))
+" call Decho("w:treedict[".a:dirname."]= ".w:netrw_treedict[a:dirname])
exe "silent! keepjumps ".w:netrw_bannercnt.",$d"
" if past banner, record word
@@ -3414,671 +5605,851 @@ fun! s:NetTreeListing(dirname)
else
let fname= ""
endif
+" call Decho("fname<".fname.">")
" display from treetop on down
- call s:NetTreeDisplay(w:netrw_treetop,"")
-
- " place cursor
- if !exists("s:nbcd_curpos")
- if fname != ""
-" call Decho("(NetTreeListing) place cursor <".fname.">")
- call search('\<'.fname.'\>','cw')
- elseif exists("w:netrw_bannercnt")
- exe (w:netrw_bannercnt+1)
-" call Decho("(NetTreeListing) place cursor line#".(w:netrw_bannercnt+1))
- endif
- endif
+ call s:NetrwTreeDisplay(w:netrw_treetop,"")
-" call Dret("NetTreeListing : bufname<".expand("%").">")
+" call Dret("NetrwTreeListing : bufname<".expand("%").">")
endif
endfun
" ---------------------------------------------------------------------
-" NetSaveWordPosn: used by the "s" command in both remote and local {{{2
-" browsing. Along with NetRestoreWordPosn(), it keeps the cursor on
-" the same word even though the sorting has changed its order of appearance.
-fun! s:NetSaveWordPosn()
-" call Dfunc("NetSaveWordPosn()")
- let s:netrw_saveword= '^'.escape(getline("."),s:netrw_cd_escape).'$'
-" call Dret("NetSaveWordPosn : saveword<".s:netrw_saveword.">")
-endfun
+" s:NetrwWideListing: {{{2
+fun! s:NetrwWideListing()
+
+ if w:netrw_liststyle == s:WIDELIST
+" call Dfunc("NetrwWideListing() w:netrw_liststyle=".w:netrw_liststyle.' fo='.&fo.' l:fo='.&l:fo)
+ " look for longest filename (cpf=characters per filename)
+ " cpf: characters per file
+ " fpl: files per line
+ " fpc: files per column
+ setlocal ma noro
+" call Decho("setlocal ma noro")
+ 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
+" call Decho("max file strlen+1=".b:netrw_cpf)
+ let b:netrw_cpf= b:netrw_cpf + 1
+
+ " determine qty files per line (fpl)
+ let w:netrw_fpl= winwidth(0)/b:netrw_cpf
+ if w:netrw_fpl <= 0
+ let w:netrw_fpl= 1
+ endif
+" call Decho("fpl= ".winwidth(0)."/[b:netrw_cpf=".b:netrw_cpf.']='.w:netrw_fpl)
+
+ " make wide display
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^.*$/\=escape(printf("%-'.b:netrw_cpf.'s",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
+" call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]")
+ silent! let keepregstar = @*
+ while line("$") >= newcolstart
+ if newcolend > line("$") | let newcolend= line("$") | endif
+ let newcolqty= newcolend - newcolstart
+ exe newcolstart
+ if newcolqty == 0
+ exe "silent keepjumps norm! 0\<c-v>$hx".w:netrw_bannercnt."G$p"
+ else
+ exe "silent keepjumps norm! 0\<c-v>".newcolqty.'j$hx'.w:netrw_bannercnt.'G$p'
+ endif
+ exe "silent keepjumps ".newcolstart.','.newcolend.'d'
+ exe 'silent keepjumps '.w:netrw_bannercnt
+ endwhile
+ silent! let @*= keepregstar
+ exe "silent keepjumps ".w:netrw_bannercnt.',$s/\s\+$//e'
+ setlocal noma nomod ro
+" call Dret("NetrwWideListing")
+ endif
-" ---------------------------------------------------------------------
-" NetRestoreWordPosn: used by the "s" command; see NetSaveWordPosn() above {{{2
-fun! s:NetRestoreWordPosn()
-" call Dfunc("NetRestoreWordPosn()")
- silent! call search(s:netrw_saveword,'w')
-" call Dret("NetRestoreWordPosn")
endfun
" ---------------------------------------------------------------------
-" NetMakeDir: this function makes a directory (both local and remote) {{{2
-fun! s:NetMakeDir(usrhost)
-" call Dfunc("NetMakeDir(usrhost<".a:usrhost.">)")
+" s:PerformListing: {{{2
+fun! s:PerformListing(islocal)
+" call Dfunc("s:PerformListing(islocal=".a:islocal.") buf(%)=".bufnr("%")."<".bufname("%").">")
- " get name of new directory from user. A bare <CR> will skip.
- " if its currently a directory, also request will be skipped, but with
- " a message.
- call inputsave()
- let newdirname= input("Please give directory name: ")
- call inputrestore()
-" call Decho("newdirname<".newdirname.">")
+ call s:NetrwSafeOptions()
+ setlocal noro ma
+" call Decho("setlocal noro ma")
- if newdirname == ""
-" call Dret("NetMakeDir : user aborted with bare <cr>")
- return
+" if exists("g:netrw_silent") && g:netrw_silent == 0 && &ch >= 1 " Decho
+" call Decho("(netrw) Processing your browsing request...")
+" endif " Decho
+
+" call Decho('w:netrw_liststyle='.(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'))
+ if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict")
+ " force a refresh for tree listings
+" call Decho("force refresh for treelisting: clear buffer<".expand("%")."> with :%d")
+ keepjumps %d
endif
- if a:usrhost == ""
+ " save current directory on directory history list
+ call s:NetrwBookmarkDir(3,b:netrw_curdir)
- " Local mkdir:
- " sanity checks
- let fullnewdir= b:netrw_curdir.'/'.newdirname
-" call Decho("fullnewdir<".fullnewdir.">")
- if isdirectory(fullnewdir)
- if !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a directory!",24)
- endif
-" call Dret("NetMakeDir : directory<".newdirname."> exists previously")
- return
- endif
- if s:FileReadable(fullnewdir)
- if !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a file!",25)
- endif
-" call Dret("NetMakeDir : file<".newdirname."> exists previously")
- return
+ " Set up the banner {{{3
+" call Decho("set up banner")
+ keepjumps put ='\" ============================================================================'
+ keepjumps put ='\" Netrw Directory Listing (netrw '.g:loaded_netrw.')'
+ keepjumps put ='\" '.b:netrw_curdir
+ keepjumps 1d
+ let w:netrw_bannercnt= 3
+ exe "keepjumps ".w:netrw_bannercnt
+
+ let sortby= g:netrw_sort_by
+ if g:netrw_sort_direction =~ "^r"
+ let sortby= sortby." reversed"
+ endif
+
+ " Sorted by... {{{3
+" call Decho("handle specified sorting: g:netrw_sort_by<".g:netrw_sort_by.">")
+ if g:netrw_sort_by =~ "^n"
+" call Decho("directories will be sorted by name")
+ " sorted by name
+ keepjumps put ='\" Sorted by '.sortby
+ keepjumps put ='\" Sort sequence: '.g:netrw_sort_sequence
+ let w:netrw_bannercnt= w:netrw_bannercnt + 2
+ else
+" call Decho("directories will be sorted by size or time")
+ " sorted by size or date
+ keepjumps put ='\" Sorted by '.sortby
+ let w:netrw_bannercnt= w:netrw_bannercnt + 1
+ endif
+ exe "keepjumps ".w:netrw_bannercnt
+
+ " show copy/move target, if any
+ if exists("s:netrwmftgt") && exists("s:netrwmftgt_islocal")
+" call Decho("show copy/move target<".s:netrwmftgt.">")
+ keepjumps put =''
+ if s:netrwmftgt_islocal
+ call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (local)')
+ else
+ call setline(line("."),'" Copy/Move Tgt: '.s:netrwmftgt.' (remote)')
endif
+ let w:netrw_bannercnt= w:netrw_bannercnt + 1
+ else
+" call Decho("s:netrwmftgt does not exist, don't make Copy/Move Tgt")
+ endif
+ exe "keepjumps ".w:netrw_bannercnt
- " requested new local directory is neither a pre-existing file or
- " directory, so make it!
- if exists("*mkdir")
- call mkdir(fullnewdir,"p")
+ " Hiding... -or- Showing... {{{3
+" call Decho("handle hiding/showing (g:netrw_hide=".g:netrw_list_hide." g:netrw_list_hide<".g:netrw_list_hide.">)")
+ if g:netrw_list_hide != "" && g:netrw_hide
+ if g:netrw_hide == 1
+ keepjumps put ='\" Hiding: '.g:netrw_list_hide
else
- let netrw_origdir= s:NetGetcwd(1)
- 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.' '.g:netrw_shq.newdirname.g:netrw_shq)
- exe "silent! !".g:netrw_local_mkdir.' '.g:netrw_shq.newdirname.g:netrw_shq
- 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
+ keepjumps put ='\" Showing: '.g:netrw_list_hide
endif
+ let w:netrw_bannercnt= w:netrw_bannercnt + 1
+ endif
+ exe "keepjumps ".w:netrw_bannercnt
+ keepjumps put ='\" Quick Help: <F1>:help -:go up dir D:delete R:rename s:sort-by x:exec'
+ keepjumps put ='\" ============================================================================'
+ let w:netrw_bannercnt= w:netrw_bannercnt + 2
- if v:shell_error == 0
- " refresh listing
-" call Decho("refresh listing")
- call netrw#NetSavePosn()
- call s:NetRefresh(1,s:NetBrowseChgDir(1,'./'))
- elseif !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",26)
+ " bannercnt should index the line just after the banner
+ let w:netrw_bannercnt= w:netrw_bannercnt + 1
+ exe "keepjumps ".w:netrw_bannercnt
+" call Decho("bannercnt=".w:netrw_bannercnt." (should index line just after banner) line($)=".line("$"))
+
+ " set up syntax highlighting {{{3
+" call Decho("set up syntax highlighting")
+ if has("syntax")
+ setlocal ft=netrw
+ if !exists("g:syntax_on") || !g:syntax_on
+ setlocal ft=
endif
- redraw!
+ endif
- else
- " Remote mkdir:
- let mkdircmd = s:MakeSshCmd(g:netrw_mkdir_cmd)
- let newdirname= substitute(b:netrw_curdir,'^\%(.\{-}/\)\{3}\(.*\)$','\1','').newdirname
-" call Decho("exe silent! !".mkdircmd." ".g:netrw_shq.newdirname.g:netrw_shq)
- exe "silent! !".mkdircmd." ".g:netrw_shq.newdirname.g:netrw_shq
- if v:shell_error == 0
- " refresh listing
- call netrw#NetSavePosn()
- call s:NetRefresh(0,s:NetBrowseChgDir(0,'./'))
- elseif !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",27)
+ " get list of files
+" call Decho("Get list of files - islocal=".a:islocal)
+ if a:islocal
+ call s:LocalListing()
+ else " remote
+ call s:NetrwRemoteListing()
+ endif
+" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." (banner complete)")
+
+ " manipulate the directory listing (hide, sort) {{{3
+ if line("$") >= w:netrw_bannercnt
+" call Decho("manipulate directory listing (hide)")
+" call Decho("g:netrw_hide=".g:netrw_hide." g:netrw_list_hide<".g:netrw_list_hide.">")
+ if g:netrw_hide && g:netrw_list_hide != ""
+ call s:NetrwListHide()
+ endif
+ if line("$") >= w:netrw_bannercnt
+" call Decho("manipulate directory listing (sort) : g:netrw_sort_by<".g:netrw_sort_by.">")
+
+ if g:netrw_sort_by =~ "^n"
+ " sort by name
+ call s:NetrwSetSort()
+
+ if w:netrw_bannercnt < line("$")
+" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction." (bannercnt=".w:netrw_bannercnt.")")
+ if g:netrw_sort_direction =~ 'n'
+ " normal direction sorting
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'
+ else
+ " reverse direction sorting
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'
+ endif
+ endif
+ " remove priority pattern prefix
+" call Decho("remove priority pattern prefix")
+ let sepchr= "\<Char-0xff>"
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{3}'.sepchr.'//e'
+
+ elseif a:islocal
+ if w:netrw_bannercnt < line("$")
+" call Decho("g:netrw_sort_direction=".g:netrw_sort_direction)
+ if g:netrw_sort_direction =~ 'n'
+" call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort')
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$sort'
+ else
+" call Decho('exe silent keepjumps '.w:netrw_bannercnt.',$sort!')
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$sort!'
+ endif
+ endif
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\d\{-}\///e'
+ endif
+
+ elseif g:netrw_sort_direction =~ 'r'
+" call Decho('reverse the sorted listing')
+ exe 'silent keepjumps '.w:netrw_bannercnt.'g/^/m '.w:netrw_bannercnt
endif
- redraw!
endif
-" call Dret("NetMakeDir")
+ " convert to wide/tree listing {{{3
+" call Decho("modify display if wide/tree listing style")
+ call s:NetrwWideListing()
+ call s:NetrwTreeListing(b:netrw_curdir)
+
+ if exists("w:netrw_bannercnt") && line("$") > w:netrw_bannercnt
+ " place cursor on the top-left corner of the file listing
+" call Decho("place cursor on top-left corner of file listing")
+ exe 'silent keepjumps '.w:netrw_bannercnt
+ norm! 0
+ endif
+
+ " record previous current directory
+ let w:netrw_prvdir= b:netrw_curdir
+" call Decho("record netrw_prvdir<".w:netrw_prvdir.">")
+
+ " save certain window-oriented variables into buffer-oriented variables {{{3
+ call s:SetBufWinVars()
+ call s:NetrwOptionRestore("w:")
+
+ " set display to netrw display settings
+" call Decho("set display to netrw display settings (noma nomod etc)")
+ setlocal noma nomod nonu nobl nowrap ro
+ if exists("s:treecurpos")
+
+ call netrw#NetrwRestorePosn(s:treecurpos)
+ unlet s:treecurpos
+ endif
+
+" call Dret("s:PerformListing : curpos<".string(getpos(".")).">")
endfun
" ---------------------------------------------------------------------
-" NetBookmarkDir: {{{2
-" 0: (user: <b>) bookmark current directory
-" 1: (user: <B>) change to the bookmarked directory
-" 2: (user: <q>) list bookmarks
-" 3: (browsing) record current directory history
-" 4: (user: <u>) go up (previous) bookmark
-" 5: (user: <U>) go down (next) bookmark
-fun! s:NetBookmarkDir(chg,curdir)
-" call Dfunc("NetBookmarkDir(chg=".a:chg." curdir<".a:curdir.">) cnt=".v:count." bookmarkcnt=".g:NETRW_BOOKMARKMAX." histcnt=".g:NETRW_DIRHIST_CNT." bookmax=".g:NETRW_BOOKMARKMAX." histmax=".g:netrw_dirhistmax)
+" s:SetupNetrwStatusLine: {{{2
+fun! s:SetupNetrwStatusLine(statline)
+" call Dfunc("SetupNetrwStatusLine(statline<".a:statline.">)")
- if a:chg == 0
- " bookmark the current directory
-" call Decho("(user: <b>) bookmark the current directory")
- if v:count > 0
- " handle bookmark# specified via the count
- let g:NETRW_BOOKMARKDIR_{v:count}= a:curdir
- if !exists("g:NETRW_BOOKMARKMAX")
- let g:NETRW_BOOKMARKMAX= v:count
- elseif v:count > g:NETRW_BOOKMARKMAX
- let g:NETRW_BOOKMARKMAX= v:count
- endif
- else
- " handle no count specified
- let g:NETRW_BOOKMARKMAX = g:NETRW_BOOKMARKMAX + 1
- let g:NETRW_BOOKMARKDIR_{g:NETRW_BOOKMARKMAX} = a:curdir
- endif
- echo "bookmarked the current directory"
+ if !exists("s:netrw_setup_statline")
+ let s:netrw_setup_statline= 1
+" call Decho("do first-time status line setup")
- elseif a:chg == 1
- " change to the bookmarked directory
-" call Decho("(user: <B>) change to the bookmarked directory")
- if exists("g:NETRW_BOOKMARKDIR_{v:count}")
- exe "e ".g:NETRW_BOOKMARKDIR_{v:count}
- else
- echomsg "Sorry, bookmark#".v:count." doesn't exist!"
+ if !exists("s:netrw_users_stl")
+ let s:netrw_users_stl= &stl
endif
-
- elseif a:chg == 2
- redraw!
- let didwork= 0
- " list user's bookmarks
-" call Decho("(user: <q>) list user's bookmarks")
- if exists("g:NETRW_BOOKMARKMAX")
-" call Decho("list bookmarks [0,".g:NETRW_BOOKMARKMAX."]")
- let cnt= 0
- while cnt <= g:NETRW_BOOKMARKMAX
- if exists("g:NETRW_BOOKMARKDIR_{cnt}")
-" call Decho("Netrw Bookmark#".cnt.": ".g:NETRW_BOOKMARKDIR_{cnt})
- echo "Netrw Bookmark#".cnt.": ".g:NETRW_BOOKMARKDIR_{cnt}
- let didwork= 1
- endif
- let cnt= cnt + 1
- endwhile
+ if !exists("s:netrw_users_ls")
+ let s:netrw_users_ls= &laststatus
endif
- " list directory history
- let cnt = g:NETRW_DIRHIST_CNT
- let first = 1
- let histcnt = 0
- while ( first || cnt != g:NETRW_DIRHIST_CNT )
-" call Decho("first=".first." cnt=".cnt." dirhist_cnt=".g:NETRW_DIRHIST_CNT)
- let histcnt= histcnt + 1
- if exists("g:NETRW_DIRHIST_{cnt}")
-" call Decho("Netrw History#".histcnt.": ".g:NETRW_DIRHIST_{cnt})
- echo "Netrw History#".histcnt.": ".g:NETRW_DIRHIST_{cnt}
- let didwork= 1
+ " set up User9 highlighting as needed
+ let keepa= @a
+ redir @a
+ try
+ hi User9
+ catch /^Vim\%((\a\+)\)\=:E411/
+ if &bg == "dark"
+ hi User9 ctermfg=yellow ctermbg=blue guifg=yellow guibg=blue
+ else
+ hi User9 ctermbg=yellow ctermfg=blue guibg=yellow guifg=blue
endif
- let first = 0
- let cnt = ( cnt - 1 ) % g:netrw_dirhistmax
- if cnt < 0
- let cnt= cnt + g:netrw_dirhistmax
+ endtry
+ redir END
+ let @a= keepa
+ endif
+
+ " set up status line (may use User9 highlighting)
+ " insure that windows have a statusline
+ " make sure statusline is displayed
+ let &stl=a:statline
+ setlocal laststatus=2
+" call Decho("stl=".&stl)
+ redraw
+
+" call Dret("SetupNetrwStatusLine : stl=".&stl)
+endfun
+
+" ---------------------------------------------------------------------
+" Remote Directory Browsing Support: {{{1
+" ===========================================
+
+" ---------------------------------------------------------------------
+" s:NetrwRemoteListing: {{{2
+fun! s:NetrwRemoteListing()
+" call Dfunc("s:NetrwRemoteListing() b:netrw_curdir<".b:netrw_curdir.">)")
+
+ call s:RemotePathAnalysis(b:netrw_curdir)
+
+ " sanity check:
+ if exists("b:netrw_method") && b:netrw_method =~ '[235]'
+" call Decho("b:netrw_method=".b:netrw_method)
+ if !executable("ftp")
+ if !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ftp",18)
endif
- endwhile
- if didwork
- call inputsave()|call input("Press <cr> to continue")|call inputrestore()
+ call s:NetrwOptionRestore("w:")
+" call Dret("s:NetrwRemoteListing")
+ return
endif
- elseif a:chg == 3
- " saves most recently visited directories (when they differ)
-" call Decho("(browsing) record curdir history")
- if !exists("g:NETRW_DIRHIST_0") || g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT} != a:curdir
- let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
-" let g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}= substitute(a:curdir,'[/\\]$','','e')
- let g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}= a:curdir
-" call Decho("save dirhist#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
+ elseif !exists("g:netrw_list_cmd") || g:netrw_list_cmd == ''
+ if !exists("g:netrw_quiet")
+ if g:netrw_list_cmd == ""
+ call netrw#ErrorMsg(s:ERROR,g:netrw_ssh_cmd." is not executable on your system",47)
+ else
+ call netrw#ErrorMsg(s:ERROR,"this system doesn't support remote directory listing via ".g:netrw_list_cmd,19)
+ endif
endif
- elseif a:chg == 4
- " u: change to the previous directory stored on the history list
-" call Decho("(user: <u>) chg to prev dir from history")
- let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT - 1 ) % g:netrw_dirhistmax
- if g:NETRW_DIRHIST_CNT < 0
- let g:NETRW_DIRHIST_CNT= g:NETRW_DIRHIST_CNT + g:netrw_dirhistmax
+ call s:NetrwOptionRestore("w:")
+" call Dret("s:NetrwRemoteListing")
+ return
+ endif " (remote handling sanity check)
+
+ if exists("b:netrw_method")
+" call Decho("setting w:netrw_method<".b:netrw_method.">")
+ let w:netrw_method= b:netrw_method
+ endif
+
+ if s:method == "ftp"
+ " use ftp to get remote file listing
+" call Decho("use ftp to get remote file listing")
+ let s:method = "ftp"
+ let listcmd = g:netrw_ftp_list_cmd
+ if g:netrw_sort_by =~ '^t'
+ let listcmd= g:netrw_ftp_timelist_cmd
+ elseif g:netrw_sort_by =~ '^s'
+ let listcmd= g:netrw_ftp_sizelist_cmd
endif
- if exists("g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}")
-" call Decho("changedir u#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
- if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
- setlocal ma noro
- %d
- setlocal nomod
+" call Decho("listcmd<".listcmd."> (using g:netrw_ftp_list_cmd)")
+ call s:NetrwRemoteFtpCmd(s:path,listcmd)
+" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("raw listing: ".getline("."))'
+
+ if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
+ " shorten the listing
+" call Decho("generate short listing")
+ exe "keepjumps ".w:netrw_bannercnt
+
+ " cleanup
+ if g:netrw_ftp_browse_reject != ""
+ exe "silent! g/".g:netrw_ftp_browse_reject."/keepjumps d"
+ endif
+ silent! keepjumps %s/\r$//e
+
+ " if there's no ../ listed, then put ./ and ../ in
+ let line1= line(".")
+ exe "keepjumps ".w:netrw_bannercnt
+ let line2= search('^\.\.\/\%(\s\|$\)','cnW')
+ if line2 == 0
+" call Decho("netrw is putting ./ and ../ into listing")
+ keepjumps put='../'
+ keepjumps put='./'
+ endif
+ exe "keepjumps ".line1
+ keepjumps norm! 0
+
+" call Decho("line1=".line1." line2=".line2." line(.)=".line("."))
+ if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup
+" call Decho("M$ ftp cleanup")
+ exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+//'
+ else " normal ftp cleanup
+" call Decho("normal ftp cleanup")
+ exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2/e'
+ exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*/$#/#e'
+ exe "silent! keepjumps ".w:netrw_bannercnt.',$g/ -> /s# -> .*$#/#e'
endif
-" call Decho("exe e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT})
- exe "e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}
- else
- let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
- echo "Sorry, no predecessor directory exists yet"
endif
- elseif a:chg == 5
- " U: change to the subsequent directory stored on the history list
-" call Decho("(user: <U>) chg to next dir from history")
- let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT + 1 ) % g:netrw_dirhistmax
- if exists("g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}")
-" call Decho("changedir U#".g:NETRW_DIRHIST_CNT."<".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}.">")
- if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")
- setlocal ma noro
- %d
- setlocal nomod
+ else
+ " use ssh to get remote file listing {{{3
+" call Decho("use ssh to get remote file listing: s:path<".s:path.">")
+ let listcmd= s:MakeSshCmd(g:netrw_list_cmd)
+" call Decho("listcmd<".listcmd."> (using g:netrw_list_cmd)")
+ if g:netrw_scp_cmd =~ '^pscp'
+" call Decho("1: exe silent r! ".listcmd.shellescape(s:path))
+ exe "silent r! ".listcmd.shellescape(s:path)
+ " remove rubbish and adjust listing format of 'pscp' to 'ssh ls -FLa' like
+ g/^Listing directory/d
+ g/^d[-rwx][-rwx][-rwx]/s+$+/+e
+ silent g/^l[-rwx][-rwx][-rwx]/s+$+@+e
+ if g:netrw_liststyle != s:LONGLIST
+ g/^[dlsp-][-rwx][-rwx][-rwx]/s/^.*\s\(\S\+\)$/\1/e
endif
-" call Decho("exe e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT})
- exe "e! ".g:NETRW_DIRHIST_{g:NETRW_DIRHIST_CNT}
else
- let g:NETRW_DIRHIST_CNT= ( g:NETRW_DIRHIST_CNT - 1 ) % g:netrw_dirhistmax
- if g:NETRW_DIRHIST_CNT < 0
- let g:NETRW_DIRHIST_CNT= g:NETRW_DIRHIST_CNT + g:netrw_dirhistmax
+ if s:path == ""
+" call Decho("2: exe silent r! ".listcmd)
+ exe "silent r! ".listcmd
+ else
+" call Decho("3: exe silent r! ".listcmd.' "'.shellescape(s:path).'"')
+ exe "silent r! ".listcmd.' "'.shellescape(s:path).'"'
+" call Decho("listcmd<".listcmd."> path<".s:path.">")
endif
- echo "Sorry, no successor directory exists yet"
+ endif
+
+ " cleanup
+ if g:netrw_ftp_browse_reject != ""
+" call Decho("(cleanup) exe silent! g/".g:netrw_ssh_browse_reject."/keepjumps d")
+ exe "silent! g/".g:netrw_ssh_browse_reject."/keepjumps d"
endif
endif
- call s:NetBookmarkMenu()
-" call Dret("NetBookmarkDir")
+
+ if w:netrw_liststyle == s:LONGLIST
+ " do a long listing; these substitutions need to be done prior to sorting {{{3
+" call Decho("fix long listing:")
+
+ if s:method == "ftp"
+ " cleanup
+ exe "keepjumps ".w:netrw_bannercnt
+ while getline('.') =~ g:netrw_ftp_browse_reject
+ keepjumps d
+ endwhile
+ " if there's no ../ listed, then put ./ and ../ in
+ let line1= line(".")
+ keepjumps 1
+ silent keepjumps call search('^\.\.\/\%(\s\|$\)','W')
+ let line2= line(".")
+ if line2 == 0
+ exe 'keepjumps '.w:netrw_bannercnt."put='./'"
+ if b:netrw_curdir != '/'
+ exe 'keepjumps '.w:netrw_bannercnt."put='../'"
+ endif
+ endif
+ exe "keepjumps ".line1
+ keepjumps norm! 0
+ endif
+
+ if search('^\d\{2}-\d\{2}-\d\{2}\s','n') " M$ ftp site cleanup
+" call Decho("M$ ftp site listing cleanup")
+ exe 'silent! keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{2}-\d\{2}-\d\{2}\s\+\d\+:\d\+[AaPp][Mm]\s\+\%(<DIR>\|\d\+\)\s\+\)\(\w.*\)$/\2\t\1/'
+ elseif exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$")
+" call Decho("normal ftp site listing cleanup: bannercnt=".w:netrw_bannercnt." line($)=".line("$"))
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$s/ -> .*$//e'
+ exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\%(\S\+\s\+\)\{7}\S\+\)\s\+\(\S.*\)$/\2\t\1/e'
+ exe 'silent keepjumps '.w:netrw_bannercnt
+ endif
+ endif
+
+" if exists("w:netrw_bannercnt") && w:netrw_bannercnt <= line("$") " Decho
+" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("listing: ".getline("."))'
+" endif " Decho
+" call Dret("s:NetrwRemoteListing")
endfun
" ---------------------------------------------------------------------
-" NetBookmarkMenu: {{{2
-fun! s:NetBookmarkMenu()
- if !exists("s:netrw_menucnt")
- return
- endif
-" call Dfunc("NetBookmarkMenu() bookmarkcnt=".g:NETRW_BOOKMARKMAX." histcnt=".g:NETRW_DIRHIST_CNT." menucnt=".s:netrw_menucnt)
- if has("menu") && has("gui_running") && &go =~ 'm'
- if exists("g:NetrwTopLvlMenu")
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Bookmark'
- endif
+" s:NetrwRemoteRm: remove/delete a remote file or directory {{{2
+fun! s:NetrwRemoteRm(usrhost,path) range
+" call Dfunc("s:NetrwRemoteRm(usrhost<".a:usrhost."> path<".a:path.">) virtcol=".virtcol("."))
+" call Decho("firstline=".a:firstline." lastline=".a:lastline)
+ let svpos= netrw#NetrwSavePosn()
- " show bookmarked places
- let cnt = 0
- while cnt <= g:NETRW_BOOKMARKMAX
- if exists("g:NETRW_BOOKMARKDIR_{cnt}")
- let bmdir= escape(g:NETRW_BOOKMARKDIR_{cnt},'.')
-" call Decho('silent! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmark.'.bmdir.' :e '.g:NETRW_BOOKMARKDIR_{cnt})
- exe 'silent! menu '.g:NetrwMenuPriority.".2.".cnt." ".g:NetrwTopLvlMenu.'Bookmarks.'.bmdir.' :e '.g:NETRW_BOOKMARKDIR_{cnt}."\<cr>"
+ let all= 0
+ if exists("s:netrwmarkfilelist_{bufnr('%')}")
+ " remove all marked files
+ for fname in s:netrwmarkfilelist_{bufnr("%")}
+ let ok= s:NetrwRemoteRmFile(a:path,fname,all)
+ if ok =~ 'q\%[uit]'
+ break
+ elseif ok =~ 'a\%[ll]'
+ let all= 1
endif
- let cnt= cnt + 1
- endwhile
+ endfor
+ unlet s:netrwmarkfilelist_{bufnr("%")}
+ unlet s:netrwmarkfilemtch_{bufnr("%")}
+ 2match none
- " show directory browsing history
- let cnt = g:NETRW_DIRHIST_CNT
- let first = 1
- let histcnt = 0
- while ( first || cnt != g:NETRW_DIRHIST_CNT )
- let histcnt = histcnt + 1
- let priority = g:NETRW_DIRHIST_CNT + histcnt
- if exists("g:NETRW_DIRHIST_{cnt}")
- let bmdir= escape(g:NETRW_DIRHIST_{cnt},'.')
-" call Decho('silent! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.bmdir.' :e '.g:NETRW_DIRHIST_{cnt})
- exe 'silent! menu '.g:NetrwMenuPriority.".3.".priority." ".g:NetrwTopLvlMenu.'History.'.bmdir.' :e '.g:NETRW_DIRHIST_{cnt}."\<cr>"
- endif
- let first = 0
- let cnt = ( cnt - 1 ) % g:netrw_dirhistmax
- if cnt < 0
- let cnt= cnt + g:netrw_dirhistmax
+ else
+ " remove files specified by range
+
+ " preparation for removing multiple files/directories
+ let ctr= a:firstline
+
+ " remove multiple files and directories
+ while ctr <= a:lastline
+ exe ctr
+ let ok= s:NetrwRemoteRmFile(a:path,s:NetrwGetWord(),all)
+ if ok =~ 'q\%[uit]'
+ break
+ elseif ok =~ 'a\%[ll]'
+ let all= 1
endif
+ let ctr= ctr + 1
endwhile
endif
-" call Dret("NetBookmarkMenu")
+
+ " refresh the (remote) directory listing
+" call Decho("refresh remote directory listing")
+ call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+
+" call Dret("s:NetrwRemoteRm")
endfun
" ---------------------------------------------------------------------
-" NetObtain: obtain file under cursor (for remote browsing support) {{{2
-fun! netrw#NetObtain(vismode,...) range
-" call Dfunc("NetObtain(vismode=".a:vismode.") a:0=".a:0)
-
- if a:vismode == 0
- " normal mode
- let fname= expand("<cWORD>")
-" call Decho("no arguments, use <".fname.">")
- elseif a:vismode == 1
- " visual mode
- let keeprega = @a
- norm! gv"ay
- if g:netrw_liststyle == s:THINLIST
- " thin listing
- let filelist= split(@a,'\n')
- elseif g:netrw_liststyle == s:LONGLIST
- " long listing
- let filelist= split(substitute(@a,'\t.\{-}\n','\n','g'),'\n')
- else
- " wide listing
- let filelist = split(substitute(@a,'\s\{2,}','\n','g'),'\n')
- let filelist = map(filelist,'substitute(v:val,"^\\s\\+","","")')
- let filelist = map(filelist,'substitute(v:val,"\\s\\+$","","")')
- endif
-" call Decho("filelist<".string(filelist).">")
- let @a= keeprega
- for f in filelist
- if f != ""
- call netrw#NetObtain(2,f)
+" s:NetrwRemoteRmFile: {{{2
+fun! s:NetrwRemoteRmFile(path,rmfile,all)
+" call Dfunc("s:NetrwRemoteRmFile(path<".a:path."> rmfile<".a:rmfile.">) all=".a:all)
+
+ let all= a:all
+ let ok = ""
+
+ if a:rmfile !~ '^"' && (a:rmfile =~ '@$' || a:rmfile !~ '[\/]$')
+ " attempt to remove file
+" call Decho("attempt to remove file (all=".all.")")
+ if !all
+ echohl Statement
+" call Decho("case all=0:")
+ call inputsave()
+ let ok= input("Confirm deletion of file<".a:rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
+ call inputrestore()
+ echohl NONE
+ if ok == ""
+ let ok="no"
endif
- endfor
-" call Dret("NetObtain : visual mode handler")
- return
- elseif a:vismode == 2
- " multiple file mode
- let fname= a:1
-" call Decho("visual mode handling: <".fname.">")
- endif
+ let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
+ if ok =~ 'a\%[ll]'
+ let all= 1
+ endif
+ endif
- " NetrwStatusLine support - for obtaining support
- call s:SetupNetrwStatusLine('%f %h%m%r%=%9*Obtaining '.fname)
-
- if exists("w:netrw_method") && w:netrw_method =~ '[235]'
-" call Decho("method=".w:netrw_method)
- if executable("ftp")
-" call Decho("ftp is executable, method=".w:netrw_method)
- let curdir = b:netrw_curdir
- let path = substitute(curdir,'ftp://[^/]\+/','','e')
- let curline= line(".")
- let endline= line("$")+1
- setlocal ma noro
- keepjumps $
-" call Decho("getcwd<".getcwd().">")
-" call Decho("curdir<".curdir.">")
-" call Decho("path<".path.">")
-" call Decho("curline=".curline)
-" call Decho("endline=".endline)
-
- ".........................................
- if w:netrw_method == 2
- " ftp + <.netrc>: Method #2
- setlocal ff=unix
- if path != ""
- put ='cd '.path
-" call Decho("ftp: cd ".path)
+ if all || ok =~ 'y\%[es]' || ok == ""
+" call Decho("case all=".all." or ok<".ok.">".(exists("w:netrw_method")? ': netrw_method='.w:netrw_method : ""))
+ if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
+" call Decho("case ftp:")
+ let path= a:path
+ if path =~ '^\a\+://'
+ let path= substitute(path,'^\a\+://[^/]\+/','','')
endif
- put ='get '.fname
-" call Decho("ftp: get ".fname)
- put ='quit'
-" call Decho("ftp: quit")
- if exists("g:netrw_port") && g:netrw_port != ""
-" call Decho("exe ".g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
- exe g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
+ silent! keepjumps .,$d
+ call s:NetrwRemoteFtpCmd(path,"delete ".'"'.a:rmfile.'"')
+ else
+" call Decho("case ssh: g:netrw_rm_cmd<".g:netrw_rm_cmd.">")
+ let netrw_rm_cmd= s:MakeSshCmd(g:netrw_rm_cmd)
+" call Decho("netrw_rm_cmd<".netrw_rm_cmd.">")
+ if !exists("b:netrw_curdir")
+ call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
+ let ok="q"
else
-" call Decho("exe ".g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
- exe g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine
+ let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','')
+" call Decho("netrw_rm_cmd<".netrw_rm_cmd.">")
+" call Decho("remotedir<".remotedir.">")
+" call Decho("rmfile<".a:rmfile.">")
+ if remotedir != ""
+ let netrw_rm_cmd= netrw_rm_cmd." ".shellescape(fnameescape(remotedir.a:rmfile))
+ else
+ let netrw_rm_cmd= netrw_rm_cmd." ".shellescape(fnameescape(a:rmfile))
+ endif
+" call Decho("call system(".netrw_rm_cmd.")")
+ let ret= system(netrw_rm_cmd)
+ if ret != 0
+ call netrw#ErrorMsg(s:WARNING,"cmd<".netrw_rm_cmd."> failed",60)
+ endif
+" call Decho("returned=".ret." errcode=".v:shell_error)
+ endif
+ endif
+ elseif ok =~ 'q\%[uit]'
+" call Decho("ok==".ok)
+ break
+ endif
+
+ else
+ " attempt to remove directory
+" call Decho("attempt to remove directory")
+ if !all
+ call inputsave()
+ let ok= input("Confirm deletion of directory<".a:rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
+ call inputrestore()
+ if ok == ""
+ let ok="no"
+ endif
+ let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
+ if ok =~ 'a\%[ll]'
+ let all= 1
+ endif
+ endif
+
+ if all || ok =~ 'y\%[es]' || ok == ""
+ if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
+ call s:NetrwRemoteFtpCmd(a:path,"rmdir ".a:rmfile)
+ else
+ let rmfile = substitute(a:path.a:rmfile,'/$','','')
+ let netrw_rmdir_cmd = s:MakeSshCmd(g:netrw_rmdir_cmd).' '.rmfile
+" call Decho("attempt to remove dir: system(".netrw_rmdir_cmd.")")
+ let ret= s:System("system",netrw_rmdir_cmd)
+" call Decho("returned=".ret." errcode=".v:shell_error)
+
+ if v:shell_error != 0
+" call Decho("v:shell_error not 0")
+ let netrw_rmf_cmd= s:MakeSshCmd(g:netrw_rmf_cmd).' '.substitute(rmfile,'[\/]$','','e')
+" call Decho("2nd attempt to remove dir: system(".netrw_rmf_cmd.")")
+ let ret= s:System("system",netrw_rmf_cmd)
+" call Decho("returned=".ret." errcode=".v:shell_error)
+
+ if v:shell_error != 0 && !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",22)
+ endif
endif
+ endif
+
+ elseif ok =~ 'q\%[uit]'
+ break
+ endif
+ endif
+
+" call Dret("s:NetrwRemoteRmFile ".ok)
+ return ok
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwRemoteFtpCmd: unfortunately, not all ftp servers honor options for ls {{{2
+" This function assumes that a long listing will be received. Size, time,
+" and reverse sorts will be requested of the server but not otherwise
+" enforced here.
+fun! s:NetrwRemoteFtpCmd(path,listcmd)
+" call Dfunc("NetrwRemoteFtpCmd(path<".a:path."> listcmd<".a:listcmd.">) netrw_method=".w:netrw_method)
+" call Decho("line($)=".line("$")." bannercnt=".w:netrw_bannercnt)
+
+ " because WinXX ftp uses unix style input
+ let ffkeep= &ff
+ setlocal ma ff=unix noro
+" call Decho("setlocal ma ff=unix noro")
+
+ " clear off any older non-banner lines
+ " note that w:netrw_bannercnt indexes the line after the banner
+" call Decho('exe silent! keepjumps '.w:netrw_bannercnt.",$d (clear off old non-banner lines)")
+ exe "silent! keepjumps ".w:netrw_bannercnt.",$d"
+
+ ".........................................
+ if w:netrw_method == 2 || w:netrw_method == 5
+ " ftp + <.netrc>: Method #2
+ if a:path != ""
+ put ='cd \"'.a:path.'\"'
+ endif
+ if exists("g:netrw_ftpextracmd")
+ exe "put ='".g:netrw_ftpextracmd."'"
+" call Decho("filter input: ".getline('.'))
+ endif
+ call setline(line("$")+1,a:listcmd)
+" exe "keepjumps ".w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
+ if exists("g:netrw_port") && g:netrw_port != ""
+" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
+ exe s:netrw_silentxfer." keepjumps ".w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
+ else
+" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
+ exe s:netrw_silentxfer." keepjumps ".w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i ".g:netrw_machine
+ endif
".........................................
elseif w:netrw_method == 3
- " ftp + machine,id,passwd,filename: Method #3
+ " ftp + machine,id,passwd,filename: Method #3
setlocal ff=unix
if exists("g:netrw_port") && g:netrw_port != ""
put ='open '.g:netrw_machine.' '.g:netrw_port
-" call Decho('ftp: open '.g:netrw_machine.' '.g:netrw_port)
else
put ='open '.g:netrw_machine
-" call Decho('ftp: open '.g:netrw_machine)
endif
if exists("g:netrw_ftp") && g:netrw_ftp == 1
put =g:netrw_uid
- put ='\"'.g:netrw_passwd.'\"'
-" call Decho('ftp: g:netrw_uid')
-" call Decho('ftp: g:netrw_passwd')
+ put ='\"'.s:netrw_passwd.'\"'
else
- put ='user \"'.g:netrw_uid.'\" \"'.g:netrw_passwd.'\"'
-" call Decho('user '.g:netrw_uid.' '.g:netrw_passwd)
+ put ='user \"'.g:netrw_uid.'\" \"'.s:netrw_passwd.'\"'
endif
- if path != ""
- put ='cd '.path
-" call Decho('cd '.a:path)
+ if a:path != ""
+ put ='cd \"'.a:path.'\"'
endif
- put ='get '.fname
-" call Decho("ftp: get ".fname)
- put ='quit'
-" call Decho("ftp: quit")
+ if exists("g:netrw_ftpextracmd")
+ exe "put ='".g:netrw_ftpextracmd."'"
+" call Decho("filter input: ".getline('.'))
+ endif
+ call setline(line("$")+1,a:listcmd)
" perform ftp:
" -i : turns off interactive prompting from ftp
" -n unix : DON'T use <.netrc>, even though it exists
" -n win32: quit being obnoxious about password
-" call Decho("exe ".g:netrw_silentxfer.curline.",$!".g:netrw_ftp_cmd." -i -n")
- exe g:netrw_silentxfer.endline.",$!".g:netrw_ftp_cmd." -i -n"
-
- ".........................................
- else
- call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . choice . ">",28)
- endif
- " restore
- exe "silent! ".endline.",$d"
- exe "keepjumps ".curline
- setlocal noma nomod ro
- else
-" call Decho("ftp not executable")
- if !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:ERROR,"this system doesn't support ftp",29)
- endif
- " restore status line
- let &stl = s:netrw_users_stl
- let &laststatus = s:netrw_users_ls
- " restore NetMethod
- if exists("keep_netrw_method")
- call s:NetMethod(keep_netrw_choice)
- let w:netrw_method = keep_netrw_wmethod
- endif
-" call Dret("NetObtain")
- return
- endif
+" exe w:netrw_bannercnt.',$g/^./call Decho("ftp#".line(".").": ".getline("."))'
+" call Decho("exe ".s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i -n")
+ exe s:netrw_silentxfer.w:netrw_bannercnt.",$!".g:netrw_ftp_cmd." -i -n"
- ".........................................
+ ".........................................
else
- " scp: Method#4
-" call Decho("using scp")
- let curdir = b:netrw_curdir
- let path = substitute(curdir,'scp://[^/]\+/','','e')
-" call Decho("path<".path.">")
- if exists("g:netrw_port") && g:netrw_port != ""
- let useport= " ".g:netrw_scpport." ".g:netrw_port
- else
- let useport= ""
- endif
-" call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".path.escape(fname,' ?&')." .")
- exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".path.escape(fname,' ?&')." ."
- endif
+ call netrw#ErrorMsg(s:WARNING,"unable to comply with your request<" . choice . ">",23)
endif
- " restore status line
- let &stl = s:netrw_users_stl
- let &laststatus = s:netrw_users_ls
- redraw!
+ " cleanup for Windows
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ silent! keepjumps %s/\r$//e
+ endif
+ if a:listcmd == "dir"
+ " infer directory/link based on the file permission string
+ silent! keepjumps g/d\%([-r][-w][-x]\)\{3}/s@$@/@
+ silent! keepjumps g/l\%([-r][-w][-x]\)\{3}/s/$/@/
+ if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:WIDELIST || w:netrw_liststyle == s:TREELIST
+ exe "silent! keepjumps ".w:netrw_bannercnt.',$s/^\%(\S\+\s\+\)\{8}//e'
+ endif
+ endif
- " restore NetMethod
- if exists("keep_netrw_method")
- call s:NetMethod(keep_netrw_choice)
- let w:netrw_method = keep_netrw_wmethod
+ " ftp's listing doesn't seem to include ./ or ../
+ if !search('^\.\/$\|\s\.\/$','wn')
+ exe 'keepjumps '.w:netrw_bannercnt
+ put ='./'
+ endif
+ if !search('^\.\.\/$\|\s\.\.\/$','wn')
+ exe 'keepjumps '.w:netrw_bannercnt
+ put ='../'
endif
-" call Dret("NetObtain")
+ " restore settings
+ let &ff= ffkeep
+" call Dret("NetrwRemoteFtpCmd")
endfun
" ---------------------------------------------------------------------
-" NetPrevWinOpen: open file/directory in previous window. {{{2
-" If there's only one window, then the window will first be split.
-fun! s:NetPrevWinOpen(islocal)
-" call Dfunc("NetPrevWinOpen(islocal=".a:islocal.")")
-
- " get last window number and the word currently under the cursor
- let lastwinnr = winnr("$")
- let curword = s:NetGetWord()
-" call Decho("lastwinnr=".lastwinnr." curword<".curword.">")
-
- let didsplit = 0
- if lastwinnr == 1
- " if only one window, open a new one first
-" call Decho("only one window, so open a new one (g:netrw_alto=".g:netrw_alto.")")
- exe (g:netrw_alto? "bel " : "abo ").g:netrw_winsize."wincmd s"
- let didsplit = 1
-
- else
- wincmd p
- " if the previous window's buffer has been changed (is modified),
- " and it doesn't appear in any other extant window, then ask the
- " user if s/he wants to abandon modifications therein.
- let bnr = winbufnr(0)
- let bnrcnt = 0
- if &mod
- windo if winbufnr(0) == bnr | let bnrcnt=bnrcnt+1 | endif
-" call Decho("bnr=".bnr." bnrcnt=".bnrcnt)
- if bnrcnt == 1
- let bufname= bufname(winbufnr(winnr()))
- let choice= confirm("Save modified file<".bufname.">?","&Yes\n&No\n&Cancel")
+" s:NetrwRemoteRename: rename a remote file or directory {{{2
+fun! s:NetrwRemoteRename(usrhost,path) range
+" call Dfunc("NetrwRemoteRename(usrhost<".a:usrhost."> path<".a:path.">)")
- if choice == 1
- " Yes -- write file & then browse
- let v:errmsg= ""
- silent w
- if v:errmsg != ""
- call netrw#ErrorMsg(s:ERROR,"unable to write <".bufname.">!",30)
- if didsplit
- q
- else
- wincmd p
- endif
-" call Dret("NetPrevWinOpen : unable to write <".bufname.">")
- return
- endif
-
- elseif choice == 2
- " No -- don't worry about changed file, just browse anyway
- setlocal nomod
- call netrw#ErrorMsg(s:WARNING,bufname." changes abandoned",31)
+ " preparation for removing multiple files/directories
+ let svpos = netrw#NetrwSavePosn()
+ let ctr = a:firstline
+ let rename_cmd = s:MakeSshCmd(g:netrw_rename_cmd)
- else
- " Cancel -- don't do this
- if didsplit
- q
- else
- wincmd p
- endif
-" call Dret("NetPrevWinOpen : cancelled")
- return
+ " rename files given by the markfilelist
+ if exists("s:netrwmarkfilelist_{bufnr('%')}")
+ for oldname in s:netrwmarkfilelist_{bufnr("%")}
+" call Decho("oldname<".oldname.">")
+ if exists("subfrom")
+ let newname= substitute(oldname,subfrom,subto,'')
+" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">")
+ else
+ call inputsave()
+ let newname= input("Moving ".oldname." to : ",oldname)
+ call inputrestore()
+ if newname =~ '^s/'
+ let subfrom = substitute(newname,'^s/\([^/]*\)/.*/$','\1','')
+ let subto = substitute(newname,'^s/[^/]*/\(.*\)/$','\1','')
+ let newname = substitute(oldname,subfrom,subto,'')
+" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">")
endif
endif
- endif
- endif
+
+ if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
+ call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname)
+ else
+ let oldname= a:path.oldname
+ let newname= a:path.newname
+" call Decho("system(rename_cmd".' "'.fnameescape(oldname," ").'" "'.escape(newname).'"')
+ let ret= s:System("system",rename_cmd.' "'.fnameescape(oldname).'" "'.fnameescape(newname).'"')
+ endif
- if a:islocal
- call netrw#LocalBrowseCheck(s:NetBrowseChgDir(a:islocal,curword))
- else
- call s:NetBrowse(a:islocal,s:NetBrowseChgDir(a:islocal,curword))
- endif
-" call Dret("NetPrevWinOpen")
-endfun
+ endfor
+ call s:NetrwUnMarkFile(1)
-" ---------------------------------------------------------------------
-" NetMenu: generates the menu for gvim and netrw {{{2
-fun! s:NetMenu(domenu)
+ else
- if !exists("g:NetrwMenuPriority")
- let g:NetrwMenuPriority= 80
- endif
+ " attempt to rename files/directories
+ while ctr <= a:lastline
+ exe "keepjumps ".ctr
- if has("menu") && has("gui_running") && &go =~ 'm' && g:netrw_menu
-" call Dfunc("NetMenu(domenu=".a:domenu.")")
+ let oldname= s:NetrwGetWord()
+" call Decho("oldname<".oldname.">")
- if !exists("s:netrw_menu_enabled") && a:domenu
-" call Decho("initialize menu")
- let s:netrw_menu_enabled= 1
- exe 'silent! menu '.g:NetrwMenuPriority.'.1 '.g:NetrwTopLvlMenu.'Help<tab><F1> <F1>'
- call s:NetBookmarkMenu() " provide some history!
- exe 'silent! menu '.g:NetrwMenuPriority.'.4 '.g:NetrwTopLvlMenu.'Go\ Up\ Directory<tab>- -'
- exe 'silent! menu '.g:NetrwMenuPriority.'.5 '.g:NetrwTopLvlMenu.'Apply\ Special\ Viewer<tab>x x'
- exe 'silent! menu '.g:NetrwMenuPriority.'.6 '.g:NetrwTopLvlMenu.'Bookmark\ Current\ Directory<tab>mb mb'
- exe 'silent! menu '.g:NetrwMenuPriority.'.7 '.g:NetrwTopLvlMenu.'Goto\ Bookmarked\ Directory<tab>gb gb'
- exe 'silent! menu '.g:NetrwMenuPriority.'.8 '.g:NetrwTopLvlMenu.'Change\ To\ Recently\ Used\ Directory<tab>u u'
- exe 'silent! menu '.g:NetrwMenuPriority.'.9 '.g:NetrwTopLvlMenu.'Change\ To\ Subsequently\ Used\ Directory<tab>U U'
- exe 'silent! menu '.g:NetrwMenuPriority.'.10 '.g:NetrwTopLvlMenu.'Delete\ File/Directory<tab>D D'
- exe 'silent! menu '.g:NetrwMenuPriority.'.11 '.g:NetrwTopLvlMenu.'Edit\ File\ Hiding\ List<tab>'."<ctrl-h> \<c-h>"
- exe 'silent! menu '.g:NetrwMenuPriority.'.12 '.g:NetrwTopLvlMenu.'Edit\ File/Directory<tab><cr> '."\<cr>"
- exe 'silent! menu '.g:NetrwMenuPriority.'.13 '.g:NetrwTopLvlMenu.'Edit\ File/Directory,\ New\ Window<tab>o o'
- exe 'silent! menu '.g:NetrwMenuPriority.'.14 '.g:NetrwTopLvlMenu.'Edit\ File/Directory,\ New\ Vertical\ Window<tab>v v'
- exe 'silent! menu '.g:NetrwMenuPriority.'.15 '.g:NetrwTopLvlMenu.'List\ Bookmarks\ and\ History<tab>q q'
- exe 'silent! menu '.g:NetrwMenuPriority.'.16 '.g:NetrwTopLvlMenu.'Listing\ Style\ (thin-long-wide)<tab>i i'
- exe 'silent! menu '.g:NetrwMenuPriority.'.17 '.g:NetrwTopLvlMenu.'Make\ Subdirectory<tab>d d'
- exe 'silent! menu '.g:NetrwMenuPriority.'.18 '.g:NetrwTopLvlMenu.'Normal-Hide-Show<tab>a a'
- exe 'silent! menu '.g:NetrwMenuPriority.'.19 '.g:NetrwTopLvlMenu.'Obtain\ File<tab>O O'
- exe 'silent! menu '.g:NetrwMenuPriority.'.20 '.g:NetrwTopLvlMenu.'Preview\ File/Directory<tab>p p'
- exe 'silent! menu '.g:NetrwMenuPriority.'.21 '.g:NetrwTopLvlMenu.'Previous\ Window\ Browser<tab>P P'
- exe 'silent! menu '.g:NetrwMenuPriority.'.22 '.g:NetrwTopLvlMenu.'Refresh\ Listing<tab>'."<ctrl-l> \<c-l>"
- exe 'silent! menu '.g:NetrwMenuPriority.'.23 '.g:NetrwTopLvlMenu.'Rename\ File/Directory<tab>R R'
- exe 'silent! menu '.g:NetrwMenuPriority.'.24 '.g:NetrwTopLvlMenu.'Reverse\ Sorting\ Order<tab>'."r r"
- exe 'silent! menu '.g:NetrwMenuPriority.'.25 '.g:NetrwTopLvlMenu.'Select\ Sorting\ Style<tab>s s'
- exe 'silent! menu '.g:NetrwMenuPriority.'.26 '.g:NetrwTopLvlMenu.'Sorting\ Sequence\ Edit<tab>S S'
- exe 'silent! menu '.g:NetrwMenuPriority.'.27 '.g:NetrwTopLvlMenu.'Set\ Current\ Directory<tab>c c'
- exe 'silent! menu '.g:NetrwMenuPriority.'.28 '.g:NetrwTopLvlMenu.'Settings/Options<tab>:NetrwSettings '.":NetrwSettings\<cr>"
- let s:netrw_menucnt= 28
+ call inputsave()
+ let newname= input("Moving ".oldname." to : ",oldname)
+ call inputrestore()
- elseif !a:domenu
- let s:netrwcnt = 0
- let curwin = winnr()
- windo if getline(2) =~ "Netrw" | let s:netrwcnt= s:netrwcnt + 1 | endif
- exe curwin."wincmd w"
-
- if s:netrwcnt <= 1
-" call Decho("clear menus")
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Help'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Apply\ Special\ Viewer'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Bookmark\ Current\ Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Go\ Up\ Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Goto\ Bookmarked\ Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Change\ To\ Recently\ Used\ Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Change\ To\ Subsequently\ Used\ Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Delete\ File/Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Edit\ File/Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Edit\ File/Directory,\ New\ Window'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Edit\ File/Directory,\ New\ Vertical\ Window'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Edit\ File\ Hiding\ List'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Edit\ File'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Enter\ File/Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Enter\ File/Directory\ (vertical\ split)'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'List\ Bookmarks\ and\ History'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Listing\ Style\ (thin-long-wide)'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Make\ Subdirectory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Normal-Hide-Show'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Obtain\ File'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Preview\ File/Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Previous\ Window\ Browser'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Refresh\ Listing'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Rename\ File/Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Reverse\ Sorting\ Order'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Select\ Sorting\ Style'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Sorting\ Sequence\ Edit'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Set\ Current\ Directory'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Settings/Options'
- exe 'silent! unmenu '.g:NetrwTopLvlMenu.'Bookmarks'
- silent! unlet s:netrw_menu_enabled
+ if exists("w:netrw_method") && (w:netrw_method == 2 || w:netrw_method == 3)
+ call s:NetrwRemoteFtpCmd(a:path,"rename ".oldname." ".newname)
+ else
+ let oldname= a:path.oldname
+ let newname= a:path.newname
+" call Decho("system(rename_cmd".' "'.fnameescape(oldname," ").'" "'.escape(newname).'"')
+ let ret= s:System("system",rename_cmd.' "'.fnameescape(oldname).'" "'.fnameescape(newname).'"')
endif
- endif
-" call Dret("NetMenu")
+
+ let ctr= ctr + 1
+ endwhile
endif
+ " refresh the directory
+ call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+
+" call Dret("NetrwRemoteRename")
endfun
-" ==========================================
+" ---------------------------------------------------------------------
" Local Directory Browsing Support: {{{1
" ==========================================
" ---------------------------------------------------------------------
-" LocalBrowseCheck: {{{2
+" netrw#LocalBrowseCheck: {{{2
fun! netrw#LocalBrowseCheck(dirname)
" unfortunate interaction -- split window debugging can't be
-" " used here, must use DechoRemOn or DechoTabOn -- the BufEnter
+ " used here, must use D-echoRemOn or D-echoTabOn -- the BufEnter
" event triggers another call to LocalBrowseCheck() when attempts
" to write to the DBG buffer are made.
-" call Dfunc("LocalBrowseCheck(dirname<".a:dirname.">")
+ " The &ft == "netrw" test was installed because the BufEnter event
+ " would hit when re-entering netrw windows, creating unexpected
+ " refreshes (and would do so in the middle of NetrwSaveOptions(), too)
+" call Decho("netrw#LocalBrowseCheck: isdir<".a:dirname.">=".isdirectory(a:dirname))
if isdirectory(a:dirname)
- silent! call s:NetBrowse(1,a:dirname)
+" call Decho(" ft<".&ft."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : " doesn't exist")."> dirname<".a:dirname.">"." line($)=".line("$"))
+ if &ft != "netrw" || (exists("b:netrw_curdir") && b:netrw_curdir != a:dirname)
+ silent! call s:NetrwBrowse(1,a:dirname)
+ elseif &ft == "netrw" && line("$") == 1
+ silent! call s:NetrwBrowse(1,a:dirname)
+ endif
endif
-" call Dret("LocalBrowseCheck")
" not a directory, ignore it
endfun
" ---------------------------------------------------------------------
-" LocalListing: does the job of "ls" for local directories {{{2
+" s:LocalListing: does the job of "ls" for local directories {{{2
fun! s:LocalListing()
-" call Dfunc("LocalListing() &ma=".&ma." &mod=".&mod." &ro=".&ro." buf(%)=".buf("%"))
+" call Dfunc("s:LocalListing()")
+" call Decho("&ma=".&ma)
+" call Decho("&mod=".&mod)
+" call Decho("&ro=".&ro)
+" call Decho("bufname(%)<".bufname("%").">")
+
" if exists("b:netrw_curdir") |call Decho('b:netrw_curdir<'.b:netrw_curdir.">") |else|call Decho("b:netrw_curdir doesn't exist") |endif
" if exists("g:netrw_sort_by")|call Decho('g:netrw_sort_by<'.g:netrw_sort_by.">")|else|call Decho("g:netrw_sort_by doesn't exist")|endif
" get the list of files contained in the current directory
- let dirname = escape(b:netrw_curdir,s:netrw_glob_escape)
+ let dirname = escape(b:netrw_curdir,g:netrw_glob_escape)
let dirnamelen = strlen(b:netrw_curdir)
let filelist = glob(s:ComposePath(dirname,"*"))
" call Decho("glob(dirname<".dirname."/*>)=".filelist)
@@ -4086,39 +6457,46 @@ fun! s:LocalListing()
let filelist= filelist."\n"
endif
let filelist= filelist.glob(s:ComposePath(dirname,".*"))
-" call Decho("glob(dirname<".dirname."/.*>)=".glob(dirname.".*"))
-
- " if the directory name includes a "$", and possibly other characters,
- " the glob() doesn't include "." and ".." entries.
- if filelist !~ '[\\/]\.[\\/]\=\(\n\|$\)'
-" call Decho("forcibly tacking on .")
- if filelist == ""
- let filelist= s:ComposePath(dirname,"./")
- else
- let filelist= filelist."\n".s:ComposePath(b:netrw_curdir,"./")
- endif
-" call Decho("filelist<".filelist.">")
+" call Decho("glob(dirname<".dirname."/.*>)=".filelist)
+
+ " Coding choice: either elide ./ if present
+ " or include ./ if not present
+ if filelist =~ '[\\/]\.[\\/]\=\(\n\|$\)'
+ " elide /path/. from glob() entries if present
+" call Decho("elide /path/. from glob entries if present")
+ let filelist = substitute(filelist,'\n','\t','g')
+ let filelist = substitute(filelist,'^[^\t]\+[/\\]\.\t','','')
+ let filelist = substitute(filelist,'[^\t]\+[/\\]\.$','','')
+ let filelist = substitute(filelist,'\t\zs[^\t]\+[/\\]\.\t','','')
+ let filelist = substitute(filelist,'\t','\n','g')
endif
+" call Decho("filelist<".filelist.">")
if filelist !~ '[\\/]\.\.[\\/]\=\(\n\|$\)'
+ " include ../ in the glob() entry if its missing
" call Decho("forcibly tacking on ..")
let filelist= filelist."\n".s:ComposePath(b:netrw_curdir,"../")
" call Decho("filelist<".filelist.">")
endif
if b:netrw_curdir == '/'
" remove .. from filelist when current directory is root directory
- let filelist= substitute(filelist,'/\.\.\n','','')
" call Decho("remove .. from filelist")
+ let filelist= substitute(filelist,'/\.\.\n','','')
endif
+ " remove multiple contiguous newlines
let filelist= substitute(filelist,'\n\{2,}','\n','ge')
- if (has("win32") || has("win95") || has("win64") || has("win16"))
- let filelist= substitute(filelist,'\','/','ge')
+ if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
+ " change all \s to /s
+" call Decho('change all \s to /s')
+ let filelist= substitute(filelist,'\','/','g')
else
- let filelist= substitute(filelist,'\','\\','ge')
+ " escape all \s to \\
+" call Decho('escape all \s to \\')
+ let filelist= substitute(filelist,'\','\\','g')
endif
-" call Decho("dirname<".dirname.">")
-" call Decho("dirnamelen<".dirnamelen.">")
-" call Decho("filelist<".filelist.">")
+" call Decho("(before while) dirname<".dirname.">")
+" call Decho("(before while) dirnamelen<".dirnamelen.">")
+" call Decho("(before while) filelist<".filelist.">")
while filelist != ""
if filelist =~ '\n'
@@ -4128,22 +6506,67 @@ fun! s:LocalListing()
let filename = filelist
let filelist = ""
endif
- let pfile= filename
- if isdirectory(filename)
+" call Decho(" ")
+" call Decho("(while) filelist<".filelist.">")
+" call Decho("(while) filename<".filename.">")
+
+ if getftype(filename) == "link"
+ " indicate a symbolic link
+" call Decho("indicate <".filename."> is a symbolic link with trailing @")
+ let pfile= filename."@"
+
+ elseif getftype(filename) == "socket"
+ " indicate a socket
+" call Decho("indicate <".filename."> is a socket with trailing =")
+ let pfile= filename."="
+
+ elseif getftype(filename) == "fifo"
+ " indicate a fifo
+" call Decho("indicate <".filename."> is a fifo with trailing |")
+ let pfile= filename."|"
+
+ elseif isdirectory(filename)
+ " indicate a directory
+" call Decho("indicate <".filename."> is a directory with trailing /")
let pfile= filename."/"
+
+ elseif exists("b:netrw_curdir") && b:netrw_curdir !~ '^.*://' && !isdirectory(filename)
+ if (has("win32") || has("win95") || has("win64") || has("win16"))
+ if filename =~ '\.[eE][xX][eE]$' || filename =~ '\.[cC][oO][mM]$' || filename =~ '\.[bB][aA][tT]$'
+ " indicate an executable
+" call Decho("indicate <".filename."> is executable with trailing *")
+ let pfile= filename."*"
+ else
+ " normal file
+ let pfile= filename
+ endif
+ elseif executable(filename)
+ " indicate an executable
+" call Decho("indicate <".filename."> is executable with trailing *")
+ let pfile= filename."*"
+ else
+ " normal file
+ let pfile= filename
+ endif
+
+ else
+ " normal file
+ let pfile= filename
endif
+" call Decho("pfile<".pfile."> (after *@/ appending)")
+
if pfile =~ '//$'
let pfile= substitute(pfile,'//$','/','e')
+" call Decho("change // to /: pfile<".pfile.">")
endif
let pfile= strpart(pfile,dirnamelen)
let pfile= substitute(pfile,'^[/\\]','','e')
-" call Decho(" ")
" call Decho("filename<".filename.">")
" call Decho("pfile <".pfile.">")
if w:netrw_liststyle == s:LONGLIST
let sz = getfsize(filename)
- let fsz = strpart(" ",1,15-strlen(sz)).sz
+ let fsz = strpart(" ",1,15-s:Strlen(sz)).sz
let pfile= pfile."\t".fsz." ".strftime(g:netrw_timefmt,getftime(filename))
" call Decho("sz=".sz." fsz=".fsz)
endif
@@ -4152,7 +6575,7 @@ fun! s:LocalListing()
" sort by time (handles time up to 1 quintillion seconds, US)
" call Decho("getftime(".filename.")=".getftime(filename))
let t = getftime(filename)
- let ft = strpart("000000000000000000",1,18-strlen(t)).t
+ let ft = strpart("000000000000000000",1,18-s:Strlen(t)).t
" call Decho("exe keepjumps put ='".ft.'/'.filename."'")
let ftpfile= ft.'/'.pfile
keepjumps silent! put=ftpfile
@@ -4161,12 +6584,12 @@ fun! s:LocalListing()
" sort by size (handles file sizes up to 1 quintillion bytes, US)
" call Decho("getfsize(".filename.")=".getfsize(filename))
let sz = getfsize(filename)
- let fsz = strpart("000000000000000000",1,18-strlen(sz)).sz
+ let fsz = strpart("000000000000000000",1,18-s:Strlen(sz)).sz
" call Decho("exe keepjumps put ='".fsz.'/'.filename."'")
let fszpfile= fsz.'/'.pfile
keepjumps silent! put =fszpfile
- else
+ else
" sort by name
" call Decho("exe keepjumps put ='".pfile."'")
keepjumps silent! put=pfile
@@ -4175,28 +6598,37 @@ fun! s:LocalListing()
" cleanup any windows mess at end-of-line
silent! keepjumps %s/\r$//e
- setlocal ts=32
-" call Decho("setlocal ts=32")
+ exe "setlocal ts=".g:netrw_maxfilenamelen
+" call Decho("setlocal ts=".g:netrw_maxfilenamelen)
-" call Dret("LocalListing")
+" call Dret("s:LocalListing")
endfun
" ---------------------------------------------------------------------
-" LocalBrowseShellCmdRefresh: this function is called after a user has {{{2
+" s:LocalBrowseShellCmdRefresh: this function is called after a user has {{{2
" performed any shell command. The idea is to cause all local-browsing
" buffers to be refreshed after a user has executed some shell command,
" on the chance that s/he removed/created a file/directory with it.
fun! s:LocalBrowseShellCmdRefresh()
-" call Dfunc("LocalBrowseShellCmdRefresh() browselist=".string(s:netrw_browselist))
+" call Dfunc("LocalBrowseShellCmdRefresh() browselist=".(exists("s:netrw_browselist")? string(s:netrw_browselist) : "empty")." ".tabpagenr("$")." tabs")
" determine which buffers currently reside in a tab
+ if !exists("s:netrw_browselist")
+" call Dret("LocalBrowseShellCmdRefresh : browselist is empty")
+ return
+ endif
+ if !exists("w:netrw_bannercnt")
+" call Dret("LocalBrowseShellCmdRefresh : don't refresh when focus not on netrw windwo")
+ return
+ endif
let itab = 1
let buftablist = []
while itab <= tabpagenr("$")
- let buftablist= buftablist + tabpagebuflist()
- let itab= itab + 1
+ let buftablist = buftablist + tabpagebuflist()
+ let itab = itab + 1
tabn
endwhile
" call Decho("buftablist".string(buftablist))
+" call Decho("s:netrw_browselist<".(exists("s:netrw_browselist")? string(s:netrw_browselist) : "").">")
" GO through all buffers on netrw_browselist (ie. just local-netrw buffers):
" | refresh any netrw window
" | wipe out any non-displaying netrw buffer
@@ -4205,15 +6637,17 @@ fun! s:LocalBrowseShellCmdRefresh()
for ibuf in s:netrw_browselist
" call Decho("bufwinnr(".ibuf.") index(buftablist,".ibuf.")=".index(buftablist,ibuf))
if bufwinnr(ibuf) == -1 && index(buftablist,ibuf) == -1
+ " wipe out any non-displaying netrw buffer
" call Decho("wiping buf#".ibuf,"<".bufname(ibuf).">")
- exe "silent! bw ".ibuf
+ exe "silent! bd ".ibuf
call remove(s:netrw_browselist,ibl)
" call Decho("browselist=".string(s:netrw_browselist))
continue
elseif index(tabpagebuflist(),ibuf) != -1
+ " refresh any netrw buffer
" call Decho("refresh buf#".ibuf.'-> win#'.bufwinnr(ibuf))
exe bufwinnr(ibuf)."wincmd w"
- call s:NetRefresh(1,s:NetBrowseChgDir(1,'./'))
+ call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
endif
let ibl= ibl + 1
endfor
@@ -4223,169 +6657,237 @@ fun! s:LocalBrowseShellCmdRefresh()
endfun
" ---------------------------------------------------------------------
-" LocalBrowseRm: {{{2
-fun! s:LocalBrowseRm(path) range
-" call Dfunc("LocalBrowseRm(path<".a:path.">)")
+" s:NetrwLocalRm: {{{2
+fun! s:NetrwLocalRm(path) range
+" call Dfunc("s:NetrwLocalRm(path<".a:path.">)")
" call Decho("firstline=".a:firstline." lastline=".a:lastline)
" preparation for removing multiple files/directories
- let ctr = a:firstline
- let ret = 0
- let all= 0
+ let ret = 0
+ let all = 0
+ let svpos = netrw#NetrwSavePosn()
+
+ if exists("s:netrwmarkfilelist_{bufnr('%')}")
+ " remove all marked files
+" call Decho("remove all marked files")
+ for fname in s:netrwmarkfilelist_{bufnr("%")}
+ let ok= s:NetrwLocalRmFile(a:path,fname,all)
+ if ok =~ 'q\%[uit]' || ok == "no"
+ break
+ elseif ok =~ 'a\%[ll]'
+ let all= 1
+ endif
+ endfor
+ call s:NetrwUnMarkFile(1)
- " remove multiple files and directories
- while ctr <= a:lastline
- exe "keepjumps ".ctr
+ else
+ " remove (multiple) files and directories
+" call Decho("remove files in range [".a:firstline.",".a:lastline."]")
- " sanity checks
- if line(".") < w:netrw_bannercnt
- let ctr= ctr + 1
- continue
- endif
- let curword= s:NetGetWord()
- if curword == "./" || curword == "../"
+ let ctr = a:firstline
+ while ctr <= a:lastline
+ exe "keepjumps ".ctr
+
+ " sanity checks
+ if line(".") < w:netrw_bannercnt
+ let ctr= ctr + 1
+ continue
+ endif
+ let curword= s:NetrwGetWord()
+ if curword == "./" || curword == "../"
+ let ctr= ctr + 1
+ continue
+ endif
+ let ok= s:NetrwLocalRmFile(a:path,curword,all)
+ if ok =~ 'q\%[uit]' || ok == "no"
+ break
+ elseif ok =~ 'a\%[ll]'
+ let all= 1
+ endif
let ctr= ctr + 1
- continue
- endif
+ endwhile
+ endif
- norm! 0
- let rmfile= s:ComposePath(a:path,curword)
-" call Decho("rmfile<".rmfile.">")
+ " refresh the directory
+" call Decho("bufname<".bufname("%").">")
+ if bufname("%") != "NetrwMessage"
+ call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+ endif
- if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '[\/]$')
- " attempt to remove file
- if !all
- echohl Statement
- call inputsave()
- let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
- call inputrestore()
- echohl NONE
- if ok == ""
- let ok="no"
- endif
-" call Decho("response: ok<".ok.">")
- let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
-" call Decho("response: ok<".ok."> (after sub)")
- if ok =~ 'a\%[ll]'
- let all= 1
- endif
- endif
+" call Dret("s:NetrwLocalRm")
+endfun
- if all || ok =~ 'y\%[es]' || ok == ""
- let ret= s:System("delete",rmfile)
-" call Decho("errcode=".v:shell_error." ret=".ret)
- elseif ok =~ 'q\%[uit]'
- break
+" ---------------------------------------------------------------------
+" s:NetrwLocalRmFile: remove file fname given the path {{{2
+" Give confirmation prompt unless all==1
+fun! s:NetrwLocalRmFile(path,fname,all)
+" call Dfunc("s:NetrwLocalRmFile(path<".a:path."> fname<".a:fname."> all=".a:all)
+
+ let all= a:all
+ let ok = ""
+ norm! 0
+ let rmfile= s:ComposePath(a:path,a:fname)
+" call Decho("rmfile<".rmfile.">")
+
+ if rmfile !~ '^"' && (rmfile =~ '@$' || rmfile !~ '[\/]$')
+ " attempt to remove file
+" call Decho("attempt to remove file<".rmfile.">")
+ if !all
+ echohl Statement
+ call inputsave()
+ let ok= input("Confirm deletion of file<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
+ call inputrestore()
+ echohl NONE
+ if ok == ""
+ let ok="no"
+ endif
+" call Decho("response: ok<".ok.">")
+ let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
+" call Decho("response: ok<".ok."> (after sub)")
+ if ok =~ 'a\%[ll]'
+ let all= 1
endif
+ endif
- else
- " attempt to remove directory
- if !all
- echohl Statement
- call inputsave()
- let ok= input("Confirm deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
- call inputrestore()
- let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
- if ok == ""
- let ok="no"
- endif
- if ok =~ 'a\%[ll]'
- let all= 1
- endif
+ if all || ok =~ 'y\%[es]' || ok == ""
+ let ret= s:System("delete",rmfile)
+" call Decho("errcode=".v:shell_error." ret=".ret)
+ endif
+
+ else
+ " attempt to remove directory
+ if !all
+ echohl Statement
+ call inputsave()
+ let ok= input("Confirm deletion of directory<".rmfile."> ","[{y(es)},n(o),a(ll),q(uit)] ")
+ call inputrestore()
+ let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e')
+ if ok == ""
+ let ok="no"
endif
- let rmfile= substitute(rmfile,'[\/]$','','e')
+ if ok =~ 'a\%[ll]'
+ let all= 1
+ endif
+ endif
+ let rmfile= substitute(rmfile,'[\/]$','','e')
- if all || ok =~ 'y\%[es]' || ok == ""
-" call Decho("1st attempt: system(".g:netrw_local_rmdir.' "'.rmfile.'")')
- call s:System("system",g:netrw_local_rmdir.' "'.rmfile.'"')
-" call Decho("v:shell_error=".v:shell_error)
+ if all || ok =~ 'y\%[es]' || ok == ""
+" call Decho("1st attempt: system(".g:netrw_local_rmdir.' '.shellescape(rmfile).')')
+ call s:System("system",g:netrw_local_rmdir.' '.shellescape(rmfile))
+" call Decho("v:shell_error=".v:shell_error)
- if v:shell_error != 0
-" call Decho("2nd attempt to remove directory<".rmfile.">")
- let errcode= s:System("delete",rmfile)
-" call Decho("errcode=".errcode)
-
- if errcode != 0
- if has("unix")
-" call Decho("3rd attempt to remove directory<".rmfile.">")
- call s:System("system","rm ".rmfile)
- if v:shell_error != 0 && !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",34)
-endif
- elseif !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",35)
+ if v:shell_error != 0
+" call Decho("2nd attempt to remove directory<".rmfile.">")
+ let errcode= s:System("delete",rmfile)
+" call Decho("errcode=".errcode)
+
+ if errcode != 0
+ if has("unix")
+" call Decho("3rd attempt to remove directory<".rmfile.">")
+ call s:System("system","rm ".shellescape(rmfile))
+ if v:shell_error != 0 && !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",34)
+ let ok="no"
endif
+ elseif !exists("g:netrw_quiet")
+ call netrw#ErrorMsg(s:ERROR,"unable to remove directory<".rmfile."> -- is it empty?",35)
+ let ok="no"
endif
endif
-
- elseif ok =~ 'q\%[uit]'
- break
endif
endif
+ endif
- let ctr= ctr + 1
- endwhile
-
- " refresh the directory
- let curline= line(".")
-" call Decho("refresh the directory")
- call s:NetRefresh(1,s:NetBrowseChgDir(1,'./'))
- exe curline
-
-" call Dret("LocalBrowseRm")
+" call Dret("s:NetrwLocalRmFile ".ok)
+ return ok
endfun
" ---------------------------------------------------------------------
-" LocalBrowseRename: rename a remote file or directory {{{2
-fun! s:LocalBrowseRename(path) range
-" call Dfunc("LocalBrowseRename(path<".a:path.">)")
+" s:NetrwLocalRename: rename a remote file or directory {{{2
+fun! s:NetrwLocalRename(path) range
+" call Dfunc("NetrwLocalRename(path<".a:path.">)")
" preparation for removing multiple files/directories
- let ctr= a:firstline
+ let ctr = a:firstline
+ let svpos= netrw#NetrwSavePosn()
+
+ " rename files given by the markfilelist
+ if exists("s:netrwmarkfilelist_{bufnr('%')}")
+ for oldname in s:netrwmarkfilelist_{bufnr("%")}
+" call Decho("oldname<".oldname.">")
+ if exists("subfrom")
+ let newname= substitute(oldname,subfrom,subto,'')
+" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">")
+ else
+ call inputsave()
+ let newname= input("Moving ".oldname." to : ",oldname)
+ call inputrestore()
+ if newname =~ '^s/'
+ let subfrom = substitute(newname,'^s/\([^/]*\)/.*/$','\1','')
+ let subto = substitute(newname,'^s/[^/]*/\(.*\)/$','\1','')
+" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">")
+ let newname = substitute(oldname,subfrom,subto,'')
+ endif
+ endif
+ let ret= rename(oldname,newname)
+ endfor
+ 2match none
+ unlet s:netrwmarkfilelist_{bufnr("%")}
+ unlet s:netrwmarkfilemtch_{bufnr("%")}
+
+ else
- " attempt to rename files/directories
- while ctr <= a:lastline
- exe "keepjumps ".ctr
+ " attempt to rename files/directories
+ while ctr <= a:lastline
+ exe "keepjumps ".ctr
- " sanity checks
- if line(".") < w:netrw_bannercnt
- let ctr= ctr + 1
- continue
- endif
- let curword= s:NetGetWord()
- if curword == "./" || curword == "../"
- let ctr= ctr + 1
- continue
- endif
+ " sanity checks
+ if line(".") < w:netrw_bannercnt
+ let ctr= ctr + 1
+ continue
+ endif
+ let curword= s:NetrwGetWord()
+ if curword == "./" || curword == "../"
+ let ctr= ctr + 1
+ continue
+ endif
- norm! 0
- let oldname= s:ComposePath(a:path,curword)
+ norm! 0
+ let oldname= s:ComposePath(a:path,curword)
" call Decho("oldname<".oldname.">")
- call inputsave()
- let newname= input("Moving ".oldname." to : ",substitute(oldname,'/*$','','e'))
- call inputrestore()
+ call inputsave()
+ let newname= input("Moving ".oldname." to : ",substitute(oldname,'/*$','','e'))
+ call inputrestore()
- let ret= rename(oldname,newname)
+ let ret= rename(oldname,newname)
" call Decho("renaming <".oldname."> to <".newname.">")
- let ctr= ctr + 1
- endwhile
+ let ctr= ctr + 1
+ endwhile
+ endif
" refresh the directory
" call Decho("refresh the directory listing")
- call netrw#NetSavePosn()
- call s:NetRefresh(1,s:NetBrowseChgDir(1,'./'))
-" call Dret("LocalBrowseRename")
+ call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./'))
+ call netrw#NetrwRestorePosn(svpos)
+
+" call Dret("NetrwLocalRename")
endfun
" ---------------------------------------------------------------------
-" LocalFastBrowser: handles setting up/taking down fast browsing for the {{{2
-" local browser
-" fastbrowse Local Remote Hiding a buffer implies it may be re-used (fast)
-" slow 0 D D Deleting a buffer implies it will not be re-used (slow)
-" med 1 D H
-" fast 2 H H
+" s:LocalFastBrowser: handles setting up/taking down fast browsing for the local browser {{{2
+"
+" g:netrw_ Directory Is
+" fastbrowse Local Remote
+" slow 0 D D D=Deleting a buffer implies it will not be re-used (slow)
+" med 1 D H H=Hiding a buffer implies it may be re-used (fast)
+" fast 2 H H
+"
+" Deleting a buffer means that it will be re-loaded when examined, hence "slow".
+" Hiding a buffer means that it will be re-used when examined, hence "fast".
+" (re-using a buffer may not be as accurate)
fun! s:LocalFastBrowser()
" call Dfunc("LocalFastBrowser() g:netrw_fastbrowse=".g:netrw_fastbrowse)
@@ -4396,7 +6898,7 @@ fun! s:LocalFastBrowser()
endif
" append current buffer to fastbrowse list
- if g:netrw_fastbrowse <= 1 && (empty(s:netrw_browselist) || bufnr("%") > s:netrw_browselist[-1])
+ if empty(s:netrw_browselist) || bufnr("%") > s:netrw_browselist[-1]
" call Decho("appendng current buffer to browselist")
call add(s:netrw_browselist,bufnr("%"))
" call Decho("browselist=".string(s:netrw_browselist))
@@ -4411,9 +6913,9 @@ fun! s:LocalFastBrowser()
augroup AuNetrwShellCmd
au!
if (has("win32") || has("win95") || has("win64") || has("win16"))
- au ShellCmdPost * call s:LocalBrowseShellCmdRefresh()
+ au ShellCmdPost * call s:LocalBrowseShellCmdRefresh()
else
- au ShellCmdPost,FocusGained * call s:LocalBrowseShellCmdRefresh()
+ au ShellCmdPost,FocusGained * call s:LocalBrowseShellCmdRefresh()
endif
augroup END
endif
@@ -4429,507 +6931,96 @@ fun! s:LocalFastBrowser()
augroup! AuNetrwShellCmd
endif
-" call Dret("LocalFastBrowser")
-endfun
-
-" ---------------------------------------------------------------------
-" LocalObtain: copy selected file to current working directory {{{2
-fun! s:LocalObtain()
-" call Dfunc("LocalObtain()")
- if exists("b:netrw_curdir") && getcwd() != b:netrw_curdir
- let fname= expand("<cWORD>")
- let fcopy= readfile(b:netrw_curdir."/".fname,"b")
- call writefile(fcopy,getcwd()."/".fname,"b")
- elseif !exists("b:netrw_curdir")
- call netrw#ErrorMsg(s:ERROR,"local browsing directory doesn't exist!",36)
- else
- call netrw#ErrorMsg(s:ERROR,"local browsing directory and current directory are identical",37)
- endif
-" call Dret("LocalObtain")
+" call Dret("LocalFastBrowser : browselist<".string(s:netrw_browselist).">")
endfun
" ---------------------------------------------------------------------
-" netrw#Explore: launch the local browser in the directory of the current file {{{2
-" dosplit==0: the window will be split iff the current file has
-" been modified
-" dosplit==1: the window will be split before running the local
-" browser
-fun! netrw#Explore(indx,dosplit,style,...)
-" call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified." a:0=".a:0)
- if !exists("b:netrw_curdir")
- let b:netrw_curdir= getcwd()
-" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)")
- endif
- let curfile= b:netrw_curdir
-" call Decho("curfile<".curfile.">")
-
- " save registers
- silent! let keepregstar = @*
- silent! let keepregplus = @+
- silent! let keepregslash= @/
-
- " if dosplit or file has been modified
- if a:dosplit || &modified || a:style == 6
-" call Decho("case: dosplit=".a:dosplit." modified=".&modified." a:style=".a:style)
- call s:SaveWinVars()
-
- if a:style == 0 " Explore, Sexplore
-" call Decho("style=0: Explore or Sexplore")
- exe g:netrw_winsize."wincmd s"
-
- elseif a:style == 1 "Explore!, Sexplore!
-" call Decho("style=1: Explore! or Sexplore!")
- exe g:netrw_winsize."wincmd v"
-
- elseif a:style == 2 " Hexplore
-" call Decho("style=2: Hexplore")
- exe "bel ".g:netrw_winsize."wincmd s"
-
- elseif a:style == 3 " Hexplore!
-" call Decho("style=3: Hexplore!")
- exe "abo ".g:netrw_winsize."wincmd s"
-
- elseif a:style == 4 " Vexplore
-" call Decho("style=4: Vexplore")
- exe "lefta ".g:netrw_winsize."wincmd v"
-
- elseif a:style == 5 " Vexplore!
-" call Decho("style=5: Vexplore!")
- exe "rightb ".g:netrw_winsize."wincmd v"
-
- elseif a:style == 6 " Texplore
- call s:SaveBufVars()
-" call Decho("style = 6: Texplore")
- tabnew
- call s:RestoreBufVars()
- endif
- call s:RestoreWinVars()
- endif
- norm! 0
-
- if a:0 > 0
-" call Decho("a:1<".a:1.">")
- if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin))
- let dirname= substitute(a:1,'\~',expand("$HOME"),'')
-" call Decho("using dirname<".dirname."> (case: ~ && unix||cygwin)")
- elseif a:1 == '.'
- let dirname= exists("b:netrw_curdir")? b:netrw_curdir : getcwd()
- if dirname !~ '/$'
- let dirname= dirname."/"
- endif
-" call Decho("using dirname<".dirname."> (case: ".(exists("b:netrw_curdir")? "b:netrw_curdir" : "getcwd()").")")
- elseif a:1 =~ '\$'
- let dirname= expand(a:1)
- else
- let dirname= a:1
-" call Decho("using dirname<".dirname.">")
- endif
- endif
-
- if dirname =~ '^\*/'
- " Explore */pattern
-" call Decho("case Explore */pattern")
- let pattern= substitute(dirname,'^\*/\(.*\)$','\1','')
-" call Decho("Explore */pat: dirname<".dirname."> -> pattern<".pattern.">")
- if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
- elseif dirname =~ '^\*\*//'
- " Explore **//pattern
-" call Decho("case Explore **//pattern")
- let pattern = substitute(dirname,'^\*\*//','','')
- let starstarpat = 1
-" call Decho("Explore **//pat: dirname<".dirname."> -> pattern<".pattern.">")
- endif
-
- if dirname == "" && a:indx >= 0
- " Explore Hexplore Vexplore Sexplore
-" call Decho("case Explore Hexplore Vexplore Sexplore")
- let newdir= substitute(expand("%:p"),'^\(.*[/\\]\)[^/\\]*$','\1','e')
- if newdir =~ '^scp:' || newdir =~ '^ftp:'
-" call Decho("calling NetBrowse(0,newdir<".newdir.">)")
- call s:NetBrowse(0,newdir)
- else
- if newdir == ""|let newdir= getcwd()|endif
-" call Decho("calling LocalBrowseCheck(newdir<".newdir.">)")
- call netrw#LocalBrowseCheck(newdir)
- endif
- call search('\<'.substitute(curfile,'^.*/','','e').'\>','cW')
-
- elseif dirname =~ '^\*\*/' || a:indx < 0 || dirname =~ '^\*/'
- " Nexplore, Pexplore, Explore **/... , or Explore */pattern
-" call Decho("case Nexplore, Pexplore, <s-down>, <s-up>, Explore dirname<".dirname.">")
- if !mapcheck("<s-up>","n") && !mapcheck("<s-down>","n") && exists("b:netrw_curdir")
-" call Decho("set up <s-up> and <s-down> maps")
- let s:didstarstar= 1
- nnoremap <buffer> <silent> <s-up> :Pexplore<cr>
- nnoremap <buffer> <silent> <s-down> :Nexplore<cr>
- endif
-
- if has("path_extra")
-" call Decho("has path_extra")
- if !exists("w:netrw_explore_indx")
- let w:netrw_explore_indx= 0
- endif
- let indx = a:indx
-" call Decho("set indx= [a:indx=".indx."]")
-"
- if indx == -1
- "Nexplore
-" call Decho("case Nexplore: (indx=".indx.")")
- if !exists("w:netrw_explore_list") " sanity check
- call netrw#ErrorMsg(s:WARNING,"using Nexplore or <s-down> improperly; see help for netrw-starstar",40)
- silent! let @* = keepregstar
- silent! let @+ = keepregstar
- silent! let @/ = keepregslash
-" call Dret("netrw#Explore")
- return
- endif
- let indx= w:netrw_explore_indx
- if indx < 0 | let indx= 0 | endif
- if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif
- let curfile= w:netrw_explore_list[indx]
-" call Decho("indx=".indx." curfile<".curfile.">")
- while indx < w:netrw_explore_listlen && curfile == w:netrw_explore_list[indx]
- let indx= indx + 1
-" call Decho("indx=".indx." (Nexplore while loop)")
- endwhile
- if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif
-" call Decho("Nexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx)
-
- elseif indx == -2
- "Pexplore
-" call Decho("case Pexplore: (indx=".indx.")")
- if !exists("w:netrw_explore_list") " sanity check
- call netrw#ErrorMsg(s:WARNING,"using Pexplore or <s-up> improperly; see help for netrw-starstar",41)
- silent! let @* = keepregstar
- silent! let @+ = keepregstar
- silent! let @/ = keepregslash
-" call Dret("netrw#Explore")
- return
- endif
- let indx= w:netrw_explore_indx
- if indx < 0 | let indx= 0 | endif
- if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif
- let curfile= w:netrw_explore_list[indx]
-" call Decho("indx=".indx." curfile<".curfile.">")
- while indx >= 0 && curfile == w:netrw_explore_list[indx]
- let indx= indx - 1
-" call Decho("indx=".indx." (Pexplore while loop)")
- endwhile
- if indx < 0 | let indx= 0 | endif
-" call Decho("Pexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx)
-
- else
- " Explore -- initialize
- " build list of files to Explore with Nexplore/Pexplore
-" call Decho("case Explore: initialize (indx=".indx.")")
- let w:netrw_explore_indx= 0
- if !exists("b:netrw_curdir")
- let b:netrw_curdir= getcwd()
- endif
-" call Decho("b:netrw_curdir<".b:netrw_curdir.">")
-
- if exists("pattern")
-" call Decho("pattern exists: building list pattern<".pattern."> cwd<".getcwd().">")
- if exists("starstarpat")
-" call Decho("starstarpat<".starstarpat.">")
- try
- exe "silent vimgrep /".pattern."/gj "."**/*"
- catch /^Vim\%((\a\+)\)\=:E480/
- call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45)
- if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
- silent! let @* = keepregstar
- silent! let @+ = keepregstar
- silent! let @/ = keepregslash
-" call Dret("netrw#Explore : no files matched pattern")
- return
- endtry
- let s:netrw_curdir = b:netrw_curdir
- let w:netrw_explore_list = getqflist()
- let w:netrw_explore_list = map(w:netrw_explore_list,'s:netrw_curdir."/".bufname(v:val.bufnr)')
- else
-" call Decho("no starstarpat")
- exe "vimgrep /".pattern."/gj ".b:netrw_curdir."/*"
- let w:netrw_explore_list = map(getqflist(),'bufname(v:val.bufnr)')
- if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
- endif
- else
-" call Decho("no pattern: building list based on ".b:netrw_curdir."/".dirname)
- let w:netrw_explore_list= split(expand(b:netrw_curdir."/".dirname),'\n')
- if &hls | let keepregslash= s:ExplorePatHls(dirname) | endif
- 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 == 0 || (w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/')
- call netrw#ErrorMsg(s:WARNING,"no files matched",42)
- silent! let @* = keepregstar
- silent! let @+ = keepregstar
- silent! let @/ = keepregslash
-" call Dret("netrw#Explore : no files matched")
- return
- endif
- endif
-
- " NetrwStatusLine support - for exploring support
- let w:netrw_explore_indx= indx
-" call Decho("explorelist<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen)
-
- " wrap the indx around, but issue a note
- if indx >= w:netrw_explore_listlen || indx < 0
-" call Decho("wrap indx (indx=".indx." listlen=".w:netrw_explore_listlen.")")
- let indx = (indx < 0)? ( w:netrw_explore_listlen - 1 ) : 0
- let w:netrw_explore_indx= indx
- call netrw#ErrorMsg(s:NOTE,"no more files match Explore pattern",43)
- sleep 1
- endif
-
- exe "let dirfile= w:netrw_explore_list[".indx."]"
-" call Decho("dirfile=w:netrw_explore_list[indx=".indx."]= <".dirfile.">")
- let newdir= substitute(dirfile,'/[^/]*$','','e')
-" call Decho("newdir<".newdir.">")
-
-" call Decho("calling LocalBrowseCheck(newdir<".newdir.">)")
- call netrw#LocalBrowseCheck(newdir)
- if !exists("w:netrw_liststyle")
- let w:netrw_liststyle= g:netrw_liststyle
- endif
- if w:netrw_liststyle == s:THINLIST || w:netrw_liststyle == s:LONGLIST
- call search('^'.substitute(dirfile,"^.*/","","").'\>',"W")
- else
- call search('\<'.substitute(dirfile,"^.*/","","").'\>',"w")
- endif
- let w:netrw_explore_mtchcnt = indx + 1
- let w:netrw_explore_bufnr = bufnr("%")
- let w:netrw_explore_line = line(".")
- call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}')
-" call Decho("explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line)
-
- else
-" call Decho("vim does not have path_extra")
- if !exists("g:netrw_quiet")
- call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44)
- endif
- silent! let @* = keepregstar
- silent! let @+ = keepregstar
- silent! let @/ = keepregslash
-" call Dret("netrw#Explore : missing +path_extra")
- return
- endif
-
- else
-" call Decho("case Explore newdir<".dirname.">")
- if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && dirname =~ '/'
- silent! unlet w:netrw_treedict
- silent! unlet w:netrw_treetop
- endif
- let newdir= dirname
- if !exists("b:netrw_curdir")
- call netrw#LocalBrowseCheck(getcwd())
- else
- call netrw#LocalBrowseCheck(s:NetBrowseChgDir(1,newdir))
- endif
- endif
-
- silent! let @* = keepregstar
- silent! let @+ = keepregstar
- silent! let @/ = keepregslash
-" call Dret("netrw#Explore : @/<".@/.">")
-endfun
-
-" ---------------------------------------------------------------------
-" s:ExplorePatHls: converts an Explore pattern into a regular expression search pattern {{{2
-fun! s:ExplorePatHls(pattern)
-" call Dfunc("s:ExplorePatHls(pattern<".a:pattern.">)")
- let repat= substitute(a:pattern,'^**/\{1,2}','','')
-" call Decho("repat<".repat.">")
- let repat= escape(repat,'][.\')
-" call Decho("repat<".repat.">")
- let repat= '\<'.substitute(repat,'\*','\\(\\S\\+ \\)*\\S\\+','g').'\>'
-" call Dret("s:ExplorePatHls repat<".repat.">")
- return repat
-endfun
+" Support Functions: {{{1
" ---------------------------------------------------------------------
-" SetupNetrwStatusLine: {{{2
-fun! s:SetupNetrwStatusLine(statline)
-" call Dfunc("SetupNetrwStatusLine(statline<".a:statline.">)")
-
- if !exists("s:netrw_setup_statline")
- let s:netrw_setup_statline= 1
-" call Decho("do first-time status line setup")
-
- if !exists("s:netrw_users_stl")
- let s:netrw_users_stl= &stl
- endif
- if !exists("s:netrw_users_ls")
- let s:netrw_users_ls= &laststatus
- endif
-
- " set up User9 highlighting as needed
- let keepa= @a
- redir @a
+" s:UpdateBuffersMenu: does emenu Buffers.Refresh (but due to locale, the menu item may not be called that) {{{2
+" The Buffers.Refresh menu calls s:BMShow(); unfortunately, that means that that function
+" can't be called except via emenu. But due to locale, that menu line may not be called
+" Buffers.Refresh; hence, s:NetrwBMShow() utilizes a "cheat" to call that function anyway.
+fun! s:UpdateBuffersMenu()
+" call Dfunc("s:UpdateBuffersMenu()")
+ if has("gui") && has("menu") && has("gui_running") && &go =~ 'm'
try
- hi User9
- catch /^Vim\%((\a\+)\)\=:E411/
- if &bg == "dark"
- hi User9 ctermfg=yellow ctermbg=blue guifg=yellow guibg=blue
- else
- hi User9 ctermbg=yellow ctermfg=blue guibg=yellow guifg=blue
- endif
+ silent emenu Buffers.Refresh\ menu
+ catch /^Vim\%((\a\+)\)\=:E/
+ let v:errmsg= ""
+ silent call s:NetrwBMShow()
endtry
- redir END
- let @a= keepa
endif
-
- " set up status line (may use User9 highlighting)
- " insure that windows have a statusline
- " make sure statusline is displayed
- let &stl=a:statline
- setlocal laststatus=2
-" call Decho("stl=".&stl)
- redraw!
-
-" call Dret("SetupNetrwStatusLine : stl=".&stl)
+" call Dret("s:UpdateBuffersMenu")
endfun
" ---------------------------------------------------------------------
-" NetrwStatusLine: {{{2
-fun! NetrwStatusLine()
-
-" vvv NetrwStatusLine() debugging vvv
-" let g:stlmsg=""
-" if !exists("w:netrw_explore_bufnr")
-" let g:stlmsg="!X<explore_bufnr>"
-" elseif w:netrw_explore_bufnr != bufnr("%")
-" let g:stlmsg="explore_bufnr!=".bufnr("%")
-" endif
-" if !exists("w:netrw_explore_line")
-" let g:stlmsg=" !X<explore_line>"
-" elseif w:netrw_explore_line != line(".")
-" let g:stlmsg=" explore_line!={line(.)<".line(".").">"
-" endif
-" if !exists("w:netrw_explore_list")
-" let g:stlmsg=" !X<explore_list>"
-" endif
-" ^^^ NetrwStatusLine() debugging ^^^
-
- if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
- " restore user's status line
- let &stl = s:netrw_users_stl
- let &laststatus = s:netrw_users_ls
- if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
- if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif
- return ""
- else
- return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen
- endif
-endfun
-
-" ---------------------------------------------------------------------
-" NetGetcwd: get the current directory. {{{2
-" Change backslashes to forward slashes, if any.
-" If doesc is true, escape certain troublesome characters
-fun! s:NetGetcwd(doesc)
-" call Dfunc("NetGetcwd(doesc=".a:doesc.")")
- let curdir= substitute(getcwd(),'\\','/','ge')
- if curdir !~ '[\/]$'
- let curdir= curdir.'/'
- endif
- if a:doesc
- let curdir= escape(curdir,s:netrw_cd_escape)
- endif
-" call Dret("NetGetcwd <".curdir.">")
- return curdir
-endfun
-
-" ---------------------------------------------------------------------
-" SetSort: sets up the sort based on the g:netrw_sort_sequence {{{2
-" What this function does is to compute a priority for the patterns
-" in the g:netrw_sort_sequence. It applies a substitute to any
-" "files" that satisfy each pattern, putting the priority / in
-" front. An "*" pattern handles the default priority.
-fun! s:SetSort()
-" call Dfunc("SetSort() bannercnt=".w:netrw_bannercnt)
- if w:netrw_liststyle == s:LONGLIST
- let seqlist = substitute(g:netrw_sort_sequence,'\$','\\%(\t\\|\$\\)','ge')
- else
- let seqlist = g:netrw_sort_sequence
- endif
- " sanity check -- insure that * appears somewhere
- if seqlist == ""
- let seqlist= '*'
- elseif seqlist !~ '\*'
- let seqlist= seqlist.',*'
- endif
- let priority = 1
- while seqlist != ""
- if seqlist =~ ','
- let seq = substitute(seqlist,',.*$','','e')
- let seqlist = substitute(seqlist,'^.\{-},\(.*\)$','\1','e')
- else
- let seq = seqlist
- let seqlist = ""
- endif
- let eseq= escape(seq,'/')
- if priority < 10
- let spriority= "00".priority.'\/'
- elseif priority < 100
- let spriority= "0".priority.'\/'
- else
- let spriority= priority.'\/'
- endif
-" call Decho("priority=".priority." spriority<".spriority."> seq<".seq."> seqlist<".seqlist.">")
-
- " sanity check
- if w:netrw_bannercnt > line("$")
- " apparently no files were left after a Hiding pattern was used
-" call Dret("SetSort : no files left after hiding")
- return
- endif
- if seq == '*'
- exe 'silent keepjumps '.w:netrw_bannercnt.',$v/^\d\{3}\//s/^/'.spriority.'/'
- else
- exe 'silent keepjumps '.w:netrw_bannercnt.',$g/'.eseq.'/s/^/'.spriority.'/'
+" s:NetrwBMShow: {{{2
+fun! s:NetrwBMShow()
+" call Dfunc("s:NetrwBMShow()")
+ redir => bmshowraw
+ menu
+ redir END
+ let bmshowlist = split(bmshowraw,'\n')
+ if bmshowlist != []
+ let bmshowfuncs= filter(bmshowlist,'v:val =~ "<SNR>\\d\\+_BMShow()"')
+ if bmshowfuncs != []
+ let bmshowfunc = substitute(bmshowfuncs[0],'^.*:\(call.*BMShow()\).*$','\1','')
+ if bmshowfunc =~ '^call.*BMShow()'
+ exe "silent! ".bmshowfunc
+ endif
endif
- let priority = priority + 1
- endwhile
-
- " Following line associated with priority -- items that satisfy a priority
- " pattern get prefixed by ###/ which permits easy sorting by priority.
- " Sometimes files can satisfy multiple priority patterns -- only the latest
- " priority pattern needs to be retained. So, at this point, these excess
- " priority prefixes need to be removed, but not directories that happen to
- " be just digits themselves.
- exe 'silent keepjumps '.w:netrw_bannercnt.',$s/^\(\d\{3}\/\)\%(\d\{3}\/\)\+\ze./\1/e'
-
-" call Dret("SetSort")
+ endif
+" call Dret("s:NetrwBMShow : bmshowfunc<".(exists("bmshowfunc")? bmshowfunc : 'n/a').">")
endfun
-" =====================================================================
-" Support Functions: {{{1
-
" ---------------------------------------------------------------------
-" ComposePath: Appends a new part to a path taking different systems into consideration {{{2
+" s:ComposePath: Appends a new part to a path taking different systems into consideration {{{2
fun! s:ComposePath(base,subdir)
" call Dfunc("s:ComposePath(base<".a:base."> subdir<".a:subdir.">)")
+
if(has("amiga"))
+" call Decho("amiga")
let ec = a:base[strlen(a:base)-1]
if ec != '/' && ec != ':'
let ret = a:base . "/" . a:subdir
else
let ret = a:base . a:subdir
endif
+
+ elseif a:subdir =~ '^\a:[/\\][^/\\]' && (has("win32") || has("win95") || has("win64") || has("win16"))
+" call Decho("windows")
+ let ret= a:subdir
+
elseif a:base =~ '^\a\+://'
+" call Decho("remote linux/macos")
let urlbase = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\1','')
let curpath = substitute(a:base,'^\(\a\+://.\{-}/\)\(.*\)$','\2','')
- let ret = urlbase.curpath.a:subdir
+ if a:subdir == '../'
+ if curpath =~ '[^/]/[^/]\+/$'
+ let curpath= substitute(curpath,'[^/]\+/$','','')
+ else
+ let curpath=""
+ endif
+ let ret= urlbase.curpath
+ else
+ let ret= urlbase.curpath.a:subdir
+ endif
" call Decho("urlbase<".urlbase.">")
" call Decho("curpath<".curpath.">")
" call Decho("ret<".ret.">")
+
else
+" call Decho("local linux/macos")
let ret = substitute(a:base."/".a:subdir,"//","/","g")
+ if a:base =~ '^//'
+ " keeping initial '//' for the benefit of network share listing support
+ let ret= '/'.ret
+ endif
+ let ret= simplify(ret)
endif
+
" call Dret("s:ComposePath ".ret)
return ret
endfun
@@ -4939,7 +7030,7 @@ endfun
" 0=note = s:NOTE
" 1=warning = s:WARNING
" 2=error = s:ERROR
-" Mar 19, 2007 : max errnum currently is 49
+" Jun 11, 2008 : max errnum currently is 70
fun! netrw#ErrorMsg(level,msg,errnum)
" call Dfunc("netrw#ErrorMsg(level=".a:level." msg<".a:msg."> errnum=".a:errnum.") g:netrw_use_errorwindow=".g:netrw_use_errorwindow)
@@ -4950,28 +7041,36 @@ fun! netrw#ErrorMsg(level,msg,errnum)
else
let level= "**note** (netrw) "
endif
+" call Decho("level=".level)
if g:netrw_use_errorwindow
" (default) netrw creates a one-line window to show error/warning
" messages (reliably displayed)
- " record current window number for NetRestorePosn()'s benefit
+ " record current window number for NetrwRestorePosn()'s benefit
let s:winBeforeErr= winnr()
-
+" call Decho("s:winBeforeErr=".s:winBeforeErr)
+
" getting messages out reliably is just plain difficult!
" This attempt splits the current window, creating a one line window.
if bufexists("NetrwMessage") && bufwinnr("NetrwMessage") > 0
+" call Decho("write to NetrwMessage buffer")
exe bufwinnr("NetrwMessage")."wincmd w"
- set ma noro
+" call Decho("setlocal ma noro")
+ setlocal ma noro
call setline(line("$")+1,level.a:msg)
$
else
+" call Decho("create a NetrwMessage buffer window")
bo 1split
enew
setlocal bt=nofile
file NetrwMessage
+" call Decho("setlocal ma noro")
+ setlocal ma noro
call setline(line("$"),level.a:msg)
endif
+" call Decho("wrote msg<".level.a:msg."> to NetrwMessage win#".winnr())
if &fo !~ '[ta]'
syn clear
syn match netrwMesgNote "^\*\*note\*\*"
@@ -4985,7 +7084,7 @@ fun! netrw#ErrorMsg(level,msg,errnum)
else
" (optional) netrw will show messages using echomsg. Even if the
" message doesn't appear, at least it'll be recallable via :messages
- redraw!
+" redraw!
if a:level == s:WARNING
echohl WarningMsg
elseif a:level == s:ERROR
@@ -5034,28 +7133,31 @@ fun! s:GetTempfile(fname)
" get a brand new temporary filename
let tmpfile= tempname()
" call Decho("tmpfile<".tmpfile."> : from tempname()")
-
+
let tmpfile= escape(substitute(tmpfile,'\','/','ge'),g:netrw_tmpfile_escape)
" call Decho("tmpfile<".tmpfile."> : chgd any \\ -> /")
-
+
" sanity check -- does the temporary file's directory exist?
if !isdirectory(substitute(tmpfile,'[^/]\+$','','e'))
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
call netrw#ErrorMsg(s:ERROR,"your <".substitute(tmpfile,'[^/]\+$','','e')."> directory is missing!",2)
" call Dret("s:GetTempfile getcwd<".getcwd().">")
return ""
endif
-
+
" let netrw#NetSource() know about the tmpfile
let s:netrw_tmpfile= tmpfile " used by netrw#NetSource()
" call Decho("tmpfile<".tmpfile."> s:netrw_tmpfile<".s:netrw_tmpfile.">")
-
+
" o/s dependencies
- if g:netrw_cygwin == 1
+ if g:netrw_cygwin != 0
let tmpfile = substitute(tmpfile,'^\(\a\):','/cygdrive/\1','e')
elseif has("win32") || has("win95") || has("win64") || has("win16")
- let tmpfile = substitute(tmpfile,'/','\\','g')
+ if !exists("+shellslash") || !&ssl
+ let tmpfile = substitute(tmpfile,'/','\','g')
+ endif
else
- let tmpfile = tmpfile
+ let tmpfile = tmpfile
endif
let b:netrw_tmpfile= tmpfile
" call Decho("o/s dependent fixed tempname<".tmpfile.">")
@@ -5084,15 +7186,16 @@ fun! s:GetTempfile(fname)
endif
endif
+" call Decho("ro=".&ro." ma=".&ma." mod=".&mod." wrap=".&wrap)
" call Dret("s:GetTempfile <".tmpfile.">")
return tmpfile
-endfun
+endfun
" ---------------------------------------------------------------------
" s:MakeSshCmd: transforms input command using USEPORT HOSTNAME into {{{2
" a correct command
fun! s:MakeSshCmd(sshcmd)
-" call Dfunc("s:MakeSshCmd(sshcmd<".a:sshcmd.">)")
+" call Dfunc("s:MakeSshCmd(sshcmd<".a:sshcmd.">) user<".s:user."> machine<".s:machine.">")
let sshcmd = substitute(a:sshcmd,'\<HOSTNAME\>',s:user.s:machine,'')
if exists("g:netrw_port") && g:netrw_port != ""
let sshcmd= substitute(sshcmd,"USEPORT",g:netrw_sshport.' '.g:netrw_port,'')
@@ -5106,11 +7209,36 @@ fun! s:MakeSshCmd(sshcmd)
endfun
" ---------------------------------------------------------------------
+" s:RemoteSystem: runs a command on a remote host using ssh {{{2
+" Returns status
+fun! s:RemoteSystem(cmd)
+" call Dfunc("s:RemoteSystem(cmd<".a:cmd.">)")
+ if !executable(g:netrw_ssh_cmd)
+ call netrw#ErrorMsg(s:ERROR,"g:netrw_ssh_cmd<".g:netrw_ssh_cmd."> is not executable!",52)
+ elseif !exists("b:netrw_curdir")
+ call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53)
+ else
+ let cmd = s:MakeSshCmd(g:netrw_ssh_cmd." USEPORT HOSTNAME")
+ let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','')
+ if remotedir != ""
+ let cmd= cmd.' "cd '.shellescape(remotedir).";"
+ else
+ let cmd= cmd.' "'
+ endif
+ let cmd= cmd.a:cmd.'"'
+" call Decho("call system(".cmd.")")
+ let ret= system(cmd)
+ endif
+" call Dret("s:RemoteSystem ".ret)
+ return ret
+endfun
+
+" ---------------------------------------------------------------------
" s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2
fun! s:NetrwEnew(curdir)
" call Dfunc("s:NetrwEnew(curdir<".a:curdir.">) buf#".bufnr("%")."<".bufname("%").">")
- " grab a function-local copy of buffer variables
+ " grab a function-local-variable copy of buffer variables
if exists("b:netrw_bannercnt") |let netrw_bannercnt = b:netrw_bannercnt |endif
if exists("b:netrw_browser_active") |let netrw_browser_active = b:netrw_browser_active |endif
if exists("b:netrw_cpf") |let netrw_cpf = b:netrw_cpf |endif
@@ -5128,15 +7256,12 @@ fun! s:NetrwEnew(curdir)
if exists("b:netrw_option") |let netrw_option = b:netrw_option |endif
if exists("b:netrw_prvdir") |let netrw_prvdir = b:netrw_prvdir |endif
- if getline(2) =~ '^" Netrw Directory Listing'
-" call Decho("generate a buffer with keepjumps keepalt enew! (1)")
- keepjumps keepalt enew!
- else
-" call Decho("generate a buffer with keepjumps enew! (2)")
- keepjumps enew!
- endif
+ call s:NetrwOptionRestore("w:")
+" call Decho("generate a buffer with keepjumps keepalt enew!")
+ keepjumps keepalt enew!
+ call s:NetrwOptionSave("w:")
- " copy function-local variables to buffer variable equivalents
+ " copy function-local-variables to buffer variable equivalents
if exists("netrw_bannercnt") |let b:netrw_bannercnt = netrw_bannercnt |endif
if exists("netrw_browser_active") |let b:netrw_browser_active = netrw_browser_active |endif
if exists("netrw_cpf") |let b:netrw_cpf = netrw_cpf |endif
@@ -5158,15 +7283,97 @@ fun! s:NetrwEnew(curdir)
if b:netrw_curdir =~ '/$'
if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
file NetrwTreeListing
+ nno <silent> <buffer> [ :silent call <SID>TreeListMove('[')<cr>
+ nno <silent> <buffer> ] :silent call <SID>TreeListMove(']')<cr>
else
- exe "silent! file ".b:netrw_curdir
+ exe "silent! keepalt file ".b:netrw_curdir
endif
endif
-" call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%").">")
+" call Dret("s:NetrwEnew : buf#".bufnr("%")."<".bufname("%")."> expand(%)<".expand("%")."> expand(#)<".expand("#").">")
endfun
" ------------------------------------------------------------------------
+" netrw#NetrwSavePosn: saves position of cursor on screen {{{2
+fun! netrw#NetrwSavePosn()
+" call Dfunc("netrw#NetrwSavePosn()")
+ " Save current line and column
+ let w:netrw_winnr= winnr()
+ let w:netrw_line = line(".")
+ let w:netrw_col = virtcol(".")
+
+ " Save top-of-screen line
+ norm! H0
+ let w:netrw_hline= line(".")
+
+ " set up string holding position parameters
+ let ret = "let w:netrw_winnr=".w:netrw_winnr."|let w:netrw_line=".w:netrw_line."|let w:netrw_col=".w:netrw_col."|let w:netrw_hline=".w:netrw_hline
+
+ call netrw#NetrwRestorePosn()
+" call Dret("netrw#NetrwSavePosn : winnr=".w:netrw_winnr." line=".w:netrw_line." col=".w:netrw_col." hline=".w:netrw_hline)
+ return ret
+endfun
+
+" ------------------------------------------------------------------------
+" netrw#NetrwRestorePosn: restores the cursor and file position as saved by NetrwSavePosn() {{{2
+fun! netrw#NetrwRestorePosn(...)
+" call Dfunc("netrw#NetrwRestorePosn() a:0=".a:0." winnr=".(exists("w:netrw_winnr")? w:netrw_winnr : -1)." line=".(exists("w:netrw_line")? w:netrw_line : -1)." col=".(exists("w:netrw_col")? w:netrw_col : -1)." hline=".(exists("w:netrw_hline")? w:netrw_hline : -1))
+ let eikeep= &ei
+ set ei=all
+ if expand("%") == "NetrwMessage"
+ exe s:winBeforeErr."wincmd w"
+ endif
+
+ if a:0 > 0
+ exe a:1
+ endif
+
+ " restore window
+ if exists("w:netrw_winnr")
+" call Decho("restore window: exe silent! ".w:netrw_winnr."wincmd w")
+ exe "silent! ".w:netrw_winnr."wincmd w"
+ endif
+ if v:shell_error == 0
+ " as suggested by Bram M: redraw on no error
+ " allows protocol error messages to remain visible
+" redraw!
+ endif
+
+ " restore top-of-screen line
+ if exists("w:netrw_hline")
+" call Decho("restore topofscreen: exe norm! ".w:netrw_hline."G0z")
+ exe "norm! ".w:netrw_hline."G0z\<CR>"
+ endif
+
+ " restore position
+ if exists("w:netrw_line") && exists("w:netrw_col")
+" call Decho("restore posn: exe norm! ".w:netrw_line."G0".w:netrw_col."|")
+ exe "norm! ".w:netrw_line."G0".w:netrw_col."\<bar>"
+ endif
+
+ let &ei= eikeep
+" call Dret("netrw#NetrwRestorePosn")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwSaveWordPosn: used to keep cursor on same word after refresh, {{{2
+" changed sorting, etc. Also see s:NetrwRestoreWordPosn().
+fun! s:NetrwSaveWordPosn()
+" call Dfunc("NetrwSaveWordPosn()")
+ let s:netrw_saveword= '^'.fnameescape(getline('.')).'$'
+" call Dret("NetrwSaveWordPosn : saveword<".s:netrw_saveword.">")
+endfun
+
+" ---------------------------------------------------------------------
+" s:NetrwRestoreWordPosn: used to keep cursor on same word after refresh, {{{2
+" changed sorting, etc. Also see s:NetrwSaveWordPosn().
+fun! s:NetrwRestoreWordPosn()
+" call Dfunc("NetrwRestoreWordPosn()")
+ silent! call search(s:netrw_saveword,'w')
+" call Dret("NetrwRestoreWordPosn")
+endfun
+
+" ---------------------------------------------------------------------
" s:RemotePathAnalysis: {{{2
fun! s:RemotePathAnalysis(dirname)
" call Dfunc("s:RemotePathAnalysis()")
@@ -5205,7 +7412,7 @@ fun! s:RestoreBufVars()
endfun
" ---------------------------------------------------------------------
-" s:RestoreWinVars: (used by Explore() and NetSplit()) {{{2
+" s:RestoreWinVars: (used by Explore() and NetrwSplit()) {{{2
fun! s:RestoreWinVars()
" call Dfunc("s:RestoreWinVars()")
if exists("s:bannercnt") |let w:netrw_bannercnt = s:bannercnt |unlet s:bannercnt |endif
@@ -5230,6 +7437,27 @@ fun! s:RestoreWinVars()
endfun
" ---------------------------------------------------------------------
+" s:Rexplore: implements returning from a buffer to a netrw directory {{{2
+"
+" s:SetRexDir() sets up <2-leftmouse> maps (if g:netrw_retmap
+" is true) and a command, :Rexplore, which call this function.
+"
+" s:nbcd_curpos_{bufnr('%')} is set up by s:NetrwBrowseChgDir()
+fun! s:NetrwRexplore(islocal,dirname)
+" call Dfunc("s:NetrwRexplore(islocal=".a:islocal." dirname<".a:dirname.">)")
+ if a:islocal
+ call netrw#LocalBrowseCheck(a:dirname)
+ else
+ call s:NetrwBrowse(0,a:dirname)
+ endif
+ if exists("s:nbcd_curpos_{bufnr('%')}")
+ call netrw#NetrwRestorePosn(s:nbcd_curpos_{bufnr('%')})
+ unlet s:nbcd_curpos_{bufnr('%')}
+ endif
+" call Dret("s:NetrwRexplore")
+endfun
+
+" ---------------------------------------------------------------------
" s:SaveBufVars: {{{2
fun! s:SaveBufVars()
" call Dfunc("s:SaveBufVars()")
@@ -5245,7 +7473,7 @@ fun! s:SaveBufVars()
endfun
" ---------------------------------------------------------------------
-" s:SaveWinVars: (used by Explore() and NetSplit()) {{{2
+" s:SaveWinVars: (used by Explore() and NetrwSplit()) {{{2
fun! s:SaveWinVars()
" call Dfunc("s:SaveWinVars()")
if exists("w:netrw_bannercnt") |let s:bannercnt = w:netrw_bannercnt |endif
@@ -5270,7 +7498,7 @@ fun! s:SaveWinVars()
endfun
" ---------------------------------------------------------------------
-" s:SetBufWinVars: (used by NetBrowse() and LocalBrowseCheck()) {{{2
+" s:SetBufWinVars: (used by NetrwBrowse() and LocalBrowseCheck()) {{{2
" To allow separate windows to have their own activities, such as
" Explore **/pattern, several variables have been made window-oriented.
" However, when the user splits a browser window (ex: ctrl-w s), these
@@ -5292,15 +7520,84 @@ fun! s:SetBufWinVars()
endfun
" ---------------------------------------------------------------------
+" s:SetRexDir: set directory for :Rexplore {{{2
+fun! s:SetRexDir(islocal,dirname)
+" call Dfunc("s:SetRexDir(islocal=".a:islocal." dirname<".a:dirname.">)")
+ " set up Rex and leftmouse-double-click
+ if a:islocal
+ exe 'com! Rexplore call s:NetrwRexplore(1,"'.a:dirname.'")'
+ if g:netrw_retmap
+ silent! unmap <2-leftmouse>
+ if !hasmapto("<Plug>NetrwReturn")
+ nmap <unique> <silent> <2-leftmouse> <Plug>NetrwReturn
+ endif
+ exe 'nnoremap <silent> <Plug>NetrwReturn :call <SID>NetrwRexplore(1,"'.a:dirname.'")<cr>'
+ endif
+ else
+ exe 'com! Rexplore call s:NetrwRexplore(0,"'.a:dirname.'")'
+ if g:netrw_retmap
+ silent! unmap <2-leftmouse>
+ if !hasmapto("<Plug>NetrwReturn")
+ nmap <unique> <silent> <2-leftmouse> <Plug>NetrwReturn
+ endif
+ exe 'nnoremap <silent> <Plug>NetrwReturn :call <SID>NetrwRexplore(0,"'.a:dirname.'")<cr>'
+ endif
+ endif
+" call Dret("s:SetRexDir")
+endfun
+
+" ---------------------------------------------------------------------
+" s:Strlen: this function returns the length of a string, even if its {{{2
+" using two-byte etc characters.
+" Currently, its only used if g:Align_xstrlen is set to a
+" nonzero value. Solution from Nicolai Weibull, vim docs
+" (:help strlen()), Tony Mechelynck, and my own invention.
+fun! s:Strlen(x)
+" call Dfunc("s:Strlen(x<".a:x.">")
+ if g:netrw_xstrlen == 1
+ " number of codepoints (Latin a + combining circumflex is two codepoints)
+ " (comment from TM, solution from NW)
+ let ret= strlen(substitute(a:x,'.','c','g'))
+
+ elseif g:netrw_xstrlen == 2
+ " number of spacing codepoints (Latin a + combining circumflex is one spacing
+ " codepoint; a hard tab is one; wide and narrow CJK are one each; etc.)
+ " (comment from TM, solution from TM)
+ let ret=strlen(substitute(a:x, '.\Z', 'x', 'g'))
+
+ elseif g:netrw_xstrlen == 3
+ " virtual length (counting, for instance, tabs as anything between 1 and
+ " 'tabstop', wide CJK as 2 rather than 1, Arabic alif as zero when immediately
+ " preceded by lam, one otherwise, etc.)
+ " (comment from TM, solution from me)
+ let modkeep= &mod
+ exe "norm! o\<esc>"
+ call setline(line("."),a:x)
+ let ret= virtcol("$") - 1
+ d
+ let &mod= modkeep
+
+ else
+ " at least give a decent default
+ ret= strlen(a:x)
+ endif
+" call Dret("s:Strlen ".ret)
+ return ret
+endfun
+
+" ---------------------------------------------------------------------
" s:System: using Steve Hall's idea to insure that Windows paths stay {{{2
" acceptable. No effect on Unix paths.
-" Examples of use: let result= s:System("system",path)
+" Examples of use: let result= s:System("rm",path)
" let result= s:System("delete",path)
+fun! netrw#System(cmd,path)
+ echomsg s:System(a:cmd,a:path)
+endfun
fun! s:System(cmd,path)
" call Dfunc("s:System(cmd<".a:cmd."> path<".a:path.">)")
let path = a:path
- if (has("win32") || has("win95") || has("win64") || has("win16"))
+ if !g:netrw_cygwin && (has("win32") || has("win95") || has("win64") || has("win16"))
" system call prep
" remove trailing slash (Win95)
let path = substitute(path, '\(\\\|/\)$', '', 'g')
@@ -5314,19 +7611,76 @@ fun! s:System(cmd,path)
exe "let result= ".a:cmd."('".path."')"
let &shellslash = sskeep
else
- exe "let result= ".a:cmd."(".g:netrw_shq.path.g:netrw_shq.")"
+" call Decho("exe let result= ".a:cmd."('".path."')")
+ exe "let result= ".a:cmd."('".path."')"
endif
else
+" call Decho("exe let result= ".a:cmd."('".path."')")
exe "let result= ".a:cmd."('".path."')"
endif
-" call Decho("result<".result.">")
-" call Dret("s:System")
+" call Dret("s:System result<".result.">")
return result
endfun
" ---------------------------------------------------------------------
-" s:UseBufWinVars: (used by NetBrowse() and LocalBrowseCheck() {{{2
+" s:TreeListMove: {{{2
+fun! s:TreeListMove(dir)
+" call Dfunc("s:TreeListMove(dir<".a:dir.">)")
+ let curline = getline('.')
+ let prvline = (line(".") > 1)? getline(line(".")-1) : ''
+ let nxtline = (line(".") < line("$"))? getline(line(".")+1) : ''
+ let curindent= substitute(curline,'^\([| ]*\).\{-}$','\1','')
+ let indentm1 = substitute(curindent,'^| ','','')
+" call Decho("prvline <".prvline."> #".line(".")-1)
+" call Decho("curline <".curline."> #".line("."))
+" call Decho("nxtline <".nxtline."> #".line(".")+1)
+" call Decho("curindent<".curindent.">")
+" call Decho("indentm1 <".indentm1.">")
+
+ if curline !~ '/$'
+" call Decho('regfile')
+ if a:dir == '[' && prvline != ''
+ norm! 0
+ let nl = search('^'.indentm1.'[^|]','bWe') " search backwards from regular file
+" call Decho("regfile srch back: ".nl)
+ elseif a:dir == ']' && nxtline != ''
+ norm! $
+ let nl = search('^'.indentm1.'[^|]','We') " search forwards from regular file
+" call Decho("regfile srch fwd: ".nl)
+ endif
+
+ elseif a:dir == '[' && prvline != ''
+ norm! 0
+ let curline= line(".")
+ let nl = search('^'.curindent.'[^|]','bWe') " search backwards From directory, same indentation
+" call Decho("dir srch back ind: ".nl)
+ if nl != 0
+ if line(".") == curline-1
+ let nl= search('^'.indentm1.'[^|]','bWe') " search backwards from directory, indentation - 1
+" call Decho("dir srch back ind-1: ".nl)
+ endif
+ endif
+
+ elseif a:dir == ']' && nxtline != ''
+ norm! $
+ let curline = line(".")
+ let nl = search('^'.curindent.'[^|]','We') " search forwards from directory, same indentation
+" call Decho("dir srch fwd ind: ".nl)
+ if nl != 0
+ if line(".") == curline+1
+ let nl= search('^'.indentm1.'[^|]','We') " search forwards from directory, indentation - 1
+" call Decho("dir srch fwd ind-1: ".nl)
+ endif
+ endif
+
+ endif
+
+" call Dret("s:TreeListMove")
+endfun
+
+" ---------------------------------------------------------------------
+" s:UseBufWinVars: (used by NetrwBrowse() and LocalBrowseCheck() {{{2
" Matching function to BufferWinVars()
fun! s:UseBufWinVars()
" call Dfunc("s:UseBufWinVars()")
diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim
index 5f4445fb..d6a93624 100644
--- a/runtime/autoload/netrwSettings.vim
+++ b/runtime/autoload/netrwSettings.vim
@@ -1,7 +1,7 @@
" netrwSettings.vim: makes netrw settings simpler
-" Date: Mar 26, 2007
+" Date: Mar 11, 2008
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
-" Version: 9
+" Version: 11
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
@@ -19,13 +19,13 @@
if exists("g:loaded_netrwSettings") || &cp
finish
endif
-let g:loaded_netrwSettings = "v9"
+let g:loaded_netrwSettings = "v11"
" ---------------------------------------------------------------------
" NetrwSettings: {{{1
fun! netrwSettings#NetrwSettings()
" this call is here largely just to insure that netrw has been loaded
- call netrw#NetSavePosn()
+ call netrw#NetrwSavePosn()
if !exists("g:loaded_netrw")
echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None
return
@@ -101,23 +101,36 @@ fun! netrwSettings#NetrwSettings()
else
put = 'let g:netrw_browsex_viewer = (not defined)'
endif
+ let cdescline= line("$")
+ put ='let g:netrw_cd_escape...'
+ put = 'let g:netrw_compress = '.g:netrw_compress
+ let decompressline= line("$")
+ put ='let g:netrw_decompress...'
put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse
+ let fnameescline= line("$")
+ put = 'let g:netrw_fname_escape...'
put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject
put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd
put = 'let g:netrw_ftp_sizelist_cmd = '.g:netrw_ftp_sizelist_cmd
put = 'let g:netrw_ftp_timelist_cmd = '.g:netrw_ftp_timelist_cmd
+ let globescline= line("$")
+ put ='let g:netrw_glob_escape...'
put = 'let g:netrw_hide = '.g:netrw_hide
put = 'let g:netrw_keepdir = '.g:netrw_keepdir
put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd
put = 'let g:netrw_list_hide = '.g:netrw_list_hide
+ put = 'let g:netrw_liststyle = '.g:netrw_liststyle
+ put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd
put = 'let g:netrw_local_mkdir = '.g:netrw_local_mkdir
+ put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd
put = 'let g:netrw_local_rmdir = '.g:netrw_local_rmdir
- put = 'let g:netrw_liststyle = '.g:netrw_liststyle
put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen
put = 'let g:netrw_menu = '.g:netrw_menu
put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd
+ put = 'let g:netrw_preview = '.g:netrw_preview
put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd
+ put = 'let g:netrw_retmap = '.g:netrw_retmap
put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd
put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd
put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd
@@ -125,11 +138,15 @@ fun! netrwSettings#NetrwSettings()
put = 'let g:netrw_sort_by = '.g:netrw_sort_by
put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction
put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence
+ put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax
put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
put = 'let g:netrw_scpport = '.g:netrw_scpport
put = 'let g:netrw_sshport = '.g:netrw_sshport
put = 'let g:netrw_timefmt = '.g:netrw_timefmt
+ let tmpfileescline= line("$")
+ put ='let g:netrw_tmpfile_escape...'
put = 'let g:netrw_use_noswf = '.g:netrw_use_noswf
+ put = 'let g:netrw_xstrlen = '.g:netrw_xstrlen
put = 'let g:netrw_winsize = '.g:netrw_winsize
put =''
@@ -142,13 +159,18 @@ fun! netrwSettings#NetrwSettings()
silent %s/= $/= ''/e
1
- " Put in shq setting.
+ " Put in g:netrw_shq setting and g:netrw_cd_escape
" (deferred so as to avoid the quote manipulation just preceding)
if g:netrw_shq == "'"
- call setline(shqline,'let g:netrw_shq = "'.g:netrw_shq.'"')
+ call setline(shqline, 'let g:netrw_shq = "'.g:netrw_shq.'"')
else
- call setline(shqline,"let g:netrw_shq = '".g:netrw_shq."'")
+ call setline(shqline, "let g:netrw_shq = '".g:netrw_shq."'")
endif
+ call setline(cdescline, "let g:netrw_cd_escape = ".'"'.escape(g:netrw_cd_escape,'\"').'"')
+ call setline(decompressline,"let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1',''))
+ call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'")
+ call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'")
+ call setline(tmpfileescline,"let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'")
set nomod
diff --git a/runtime/autoload/xml/html40s.vim b/runtime/autoload/xml/html40s.vim
index 7db45ecf..bb3a45b5 100644
--- a/runtime/autoload/xml/html40s.vim
+++ b/runtime/autoload/xml/html40s.vim
@@ -408,4 +408,3 @@ let g:xmldata_html40s = {
\ 'param': ['/>', ''],
\ }
\ }
-" vim:ft=vim:ff=unix
diff --git a/runtime/autoload/xml/html40t.vim b/runtime/autoload/xml/html40t.vim
index f53aa22d..2d732465 100644
--- a/runtime/autoload/xml/html40t.vim
+++ b/runtime/autoload/xml/html40t.vim
@@ -458,4 +458,3 @@ let g:xmldata_html40t = {
\ 'param': ['/>', ''],
\ }
\ }
-" vim:ft=vim:ff=unix
diff --git a/runtime/autoload/xml/xhtml11.vim b/runtime/autoload/xml/xhtml11.vim
index db631e2b..ef79fd77 100644
--- a/runtime/autoload/xml/xhtml11.vim
+++ b/runtime/autoload/xml/xhtml11.vim
@@ -432,4 +432,3 @@ let g:xmldata_xhtml11 = {
\ 'param': ['/>', ''],
\ }
\ }
-" vim:ft=vim:ff=unix
diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim
index 5875be0d..5842741b 100644
--- a/runtime/autoload/zip.vim
+++ b/runtime/autoload/zip.vim
@@ -1,16 +1,16 @@
" zip.vim: Handles browsing zipfiles
" AUTOLOAD PORTION
-" Date: May 08, 2007
-" Version: 14
+" Date: Jun 12, 2008
+" Version: 18
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
" License: Vim License (see vim's :help license)
-" Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1
+" Copyright: Copyright (C) 2005-2008 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
-" zipPlugin.vim is provided *as is* and comes with no warranty
-" of any kind, either expressed or implied. By using this
-" plugin, you agree that in no event will the copyright
+" zip.vim and zipPlugin.vim are provided *as is* and comes with
+" no warranty of any kind, either expressed or implied. By using
+" this plugin, you agree that in no event will the copyright
" holder be liable for any damages resulting from the use
" of this software.
@@ -22,7 +22,7 @@ if &cp || exists("g:loaded_zip") || v:version < 700
finish
endif
-let g:loaded_zip = "v14"
+let g:loaded_zip = "v18"
let s:zipfile_escape = ' ?&;\'
let s:ERROR = 2
let s:WARNING = 1
@@ -31,7 +31,9 @@ let s:NOTE = 0
" ---------------------------------------------------------------------
" Global Values: {{{1
if !exists("g:zip_shq")
- if has("unix")
+ if &shq != ""
+ let g:zip_shq= &shq
+ elseif has("unix")
let g:zip_shq= "'"
else
let g:zip_shq= '"'
@@ -160,7 +162,9 @@ fun! s:ZipBrowseSelect()
" call Decho("curfile<".curfile.">")
new
- wincmd _
+ if !exists("g:zip_nomax") || g:zip_nomax == 0
+ wincmd _
+ endif
let s:zipfile_{winnr()}= curfile
" call Decho("exe e zipfile:".escape(zipfile,s:zipfile_escape).'::'.escape(fname,s:zipfile_escape))
exe "e zipfile:".escape(zipfile,s:zipfile_escape).'::'.escape(fname,s:zipfile_escape)
@@ -319,8 +323,13 @@ 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
+ if has("*shellescape")
+ let qnameq= shellescape(a:fname)
+ else
+ let qnameq= g:zip_shq.escape(a:fname,g:zip_shq).g:zip_shq
+ endif
+" call Dret("QuoteFileDir <".qnameq.">")
+ return qnameq
endfun
" ---------------------------------------------------------------------
diff --git a/runtime/compiler/eruby.vim b/runtime/compiler/eruby.vim
index b73ab61f..f30fcc3b 100644
--- a/runtime/compiler/eruby.vim
+++ b/runtime/compiler/eruby.vim
@@ -38,4 +38,4 @@ CompilerSet errorformat=
let &cpo = s:cpo_save
unlet s:cpo_save
-" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
+" vim: nowrap sw=2 sts=2:
diff --git a/runtime/compiler/gcc.vim b/runtime/compiler/gcc.vim
index d6667080..a62415f6 100644
--- a/runtime/compiler/gcc.vim
+++ b/runtime/compiler/gcc.vim
@@ -11,7 +11,7 @@ let current_compiler = "gcc"
let s:cpo_save = &cpo
set cpo-=C
-setlocal errorformat=
+CompilerSet errorformat=
\%*[^\"]\"%f\"%*\\D%l:\ %m,
\\"%f\"%*\\D%l:\ %m,
\%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\ only\ once,
@@ -25,7 +25,7 @@ setlocal errorformat=
\%DMaking\ %*\\a\ in\ %f
if exists('g:compiler_gcc_ignore_unmatched_lines')
- let &errorformat .= ',%-G%.%#'
+ CompilerSet errorformat+=%-G%.%#
endif
let &cpo = s:cpo_save
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 978686a3..80032e03 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
-*autocmd.txt* For Vim version 7.1. Last change: 2007 Mar 27
+*autocmd.txt* For Vim version 7.2a. Last change: 2008 Jun 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -104,7 +104,7 @@ local to the script and use mappings local to the script. When the event is
triggered and the command executed, it will run in the context of the script
it was defined in. This matters if |<SID>| is used in a command.
-When executing the commands, the messages from one command overwrites a
+When executing the commands, the message from one command overwrites a
previous message. This is different from when executing the commands
manually. Mostly the screen will not scroll up, thus there is no hit-enter
prompt. When one command outputs two messages this can happen anyway.
@@ -334,7 +334,7 @@ BufDelete Before deleting a buffer from the buffer list.
list is renamed.
NOTE: When this autocommand is executed, the
current buffer "%" may be different from the
- buffer being deleted "<afile>".
+ buffer being deleted "<afile>" and "<abuf>".
*BufEnter*
BufEnter After entering a buffer. Useful for setting
options for a file type. Also executed when
@@ -400,10 +400,15 @@ BufUnload Before unloading a buffer. This is when the
*BufWinEnter*
BufWinEnter After a buffer is displayed in a window. This
can be when the buffer is loaded (after
- processing the modelines), when a hidden
+ processing the modelines) or when a hidden
buffer is displayed in a window (and is no
- longer hidden) or a buffer already visible in
- a window is also displayed in another window.
+ longer hidden).
+ Does not happen for |:split| without
+ arguments, since you keep editing the same
+ buffer, or ":split" with a file that's already
+ open in a window. But it does happen for
+ a ":split" with the name of the current
+ buffer, since it reloads that buffer.
*BufWinLeave*
BufWinLeave Before a buffer is removed from a window.
Not when it's still visible in another window.
@@ -677,7 +682,7 @@ QuickFixCmdPre Before a quickfix command is run (|:make|,
*QuickFixCmdPost*
QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
command is run, before jumping to the first
- location.
+ location. See |QuickFixCmdPost-example|.
*RemoteReply*
RemoteReply When a reply from a Vim that functions as
server was received |server2client()|. The
@@ -848,7 +853,7 @@ This autocommand will for example be executed for "/tmp/doc/xx.txt" and
The file name that the pattern is matched against is after expanding
-wildcards. Thus is you issue this command: >
+wildcards. Thus if you issue this command: >
:e $ROOTDIR/main.$EXT
The argument is first expanded to: >
/usr/root/main.py
@@ -927,7 +932,7 @@ simply use the special string instead of the pattern. Examples: >
" current buffer
:au! * <buffer=33> " remove buffer-local autocommands for
" buffer #33
- :dobuf :au! CursorHold <buffer> " remove autocmd for given event for all
+ :bufdo :au! CursorHold <buffer> " remove autocmd for given event for all
" buffers
:au * <buffer> " list buffer-local autocommands for
" current buffer
@@ -1031,8 +1036,9 @@ option will not cause any commands to be executed.
undefined group name, Vim gives you an error message.
After applying the autocommands the modelines are
- processed, so that their overrule the settings from
- autocommands, like what happens when editing a file.
+ processed, so that their settings overrule the
+ settings from autocommands, like what happens when
+ editing a file.
*:doautoa* *:doautoall*
:doautoa[ll] [group] {event} [fname]
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index c1eed2c0..24cf3fe9 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt* For Vim version 7.1. Last change: 2007 Jan 07
+*change.txt* For Vim version 7.2a. Last change: 2008 Jun 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -229,16 +229,18 @@ key restores the original text (if there was any). (See section "Insert and
Replace mode" |mode-ins-repl|).
*cw* *cW*
-Special case: "cw" and "cW" work the same as "ce" and "cE" if the cursor is
-on a non-blank. This is because Vim interprets "cw" as change-word, and a
-word does not include the following white space. {Vi: "cw" when on a blank
-followed by other blanks changes only the first blank; this is probably a
-bug, because "dw" deletes all the blanks; use the 'w' flag in 'cpoptions' to
-make it work like Vi anyway}
+Special case: When the cursor is in a word, "cw" and "cW" do not include the
+white space after a word, they only change up to the end of the word. This is
+because Vim interprets "cw" as change-word, and a word does not include the
+following white space.
+{Vi: "cw" when on a blank followed by other blanks changes only the first
+blank; this is probably a bug, because "dw" deletes all the blanks; use the
+'w' flag in 'cpoptions' to make it work like Vi anyway}
If you prefer "cw" to include the space after a word, use this mapping: >
:map cw dwi
-<
+Or use "caw" (see |aw|).
+
*:c* *:ch* *:change*
:{range}c[hange][!] Replace lines of text with some different text.
Type a line containing only "." to stop replacing.
@@ -345,6 +347,10 @@ g?{motion} Rot13 encode {motion} text. {not in Vi}
g?g? *g?g?* *g??*
g?? Rot13 encode current line. {not in Vi}.
+To turn one line into title caps, make every first letter of a word
+uppercase: >
+ :s/\v<(.)(\w*)/\u\1\L\2/g
+
Adding and subtracting ~
*CTRL-A*
@@ -474,7 +480,7 @@ For example: >
A filter is a program that accepts text at standard input, changes it in some
way, and sends it to standard output. You can use the commands below to send
-some text through a filter, so that it is replace by the filter output.
+some text through a filter, so that it is replaced by the filter output.
Examples of filters are "sort", which sorts lines alphabetically, and
"indent", which formats C program files (you need a version of indent that
works like a filter; not all versions do). The 'shell' option specifies the
@@ -661,9 +667,9 @@ The flags that you can use for the substitute commands:
{not in Vi}
Note that there is no flag to change the "magicness" of the pattern. A
-different command is used instead. The reason is that the flags can only be
-found by skipping the pattern, and in order to skip the pattern the
-"magicness" must be known. Catch 22!
+different command is used instead, or you can use |/\v| and friends. The
+reason is that the flags can only be found by skipping the pattern, and in
+order to skip the pattern the "magicness" must be known. Catch 22!
If the {pattern} for the substitute command is empty, the command uses the
pattern from the last substitute or ":global" command. With the [r] flag, the
@@ -686,7 +692,9 @@ can use any other single-byte character, but not an alphanumeric character,
pattern or replacement string. Example: >
:s+/+//+
-For the definition of a pattern, see |pattern|.
+For the definition of a pattern, see |pattern|. In Visual block mode, use
+|/\%V| in the pattern to have the substitute work in the block only.
+Otherwise it works on whole lines anyway.
*sub-replace-special* *:s\=*
When the {string} starts with "\=" it is evaluated as an expression, see
@@ -1128,7 +1136,10 @@ nothing is returned. {not in Vi}
Contains the most recent search-pattern. This is used for "n" and 'hlsearch'.
It is writable with ":let", you can change it to have 'hlsearch' highlight
other matches without actually searching. You can't yank or delete into this
-register. {not in Vi}
+register. The search direction is available in |v:searchforward|.
+Note that the valued is restored when returning from a function
+|function-search-undo|.
+{not in Vi}
*@/*
You can write to a register with a ":let" command |:let-@|. Example: >
@@ -1253,9 +1264,11 @@ an external command, like "par" (e.g.: "!}par" to format until the end of the
paragraph) or set 'formatprg' to "par".
*format-comments*
-Vim can format comments in a special way. Vim recognizes a comment by a
-specific string at the start of the line (ignoring white space). Three types
-of comments can be used:
+An overview of comment formatting is in section |30.6| of the user manual.
+
+Vim can automatically insert and format comments in a special way. Vim
+recognizes a comment by a specific string at the start of the line (ignoring
+white space). Three types of comments can be used:
- A comment string that repeats at the start of each line. An example is the
type of comment used in shell scripts, starting with "#".
@@ -1263,7 +1276,7 @@ of comments can be used:
lines. An example is this list with dashes.
- Three-piece comments that have a start string, an end string, and optional
lines in between. The strings for the start, middle and end are different.
- An example is the C-style comment:
+ An example is the C style comment:
/*
* this is a C comment
*/
@@ -1289,23 +1302,24 @@ type of comment string. A part consists of:
e End of a three-piece comment
- l Left adjust middle with start or end (default). Only recognized when
- used together with 's' or 'e'.
+ l Left align. Used together with 's' or 'e', the leftmost character of
+ start or end will line up with the leftmost character from the middle.
+ This is the default and can be omitted. See below for more details.
- r Right adjust middle with start or end. Only recognized when used
- together with 's' or 'e'.
+ r Right align. Same as above but rightmost instead of leftmost. See
+ below for more details.
- O Don't use this one for the "O" command.
+ O Don't consider this comment for the "O" command.
x Allows three-piece comments to be ended by just typing the last
- character of the end-comment string as the first character on a new
- line, when the middle-comment string has already been inserted
- automatically. See below for more details.
+ character of the end-comment string as the first action on a new
+ line when the middle-comment string has been inserted automatically.
+ See below for more details.
{digits}
- When together with 's' or 'e': add extra indent for the middle part.
- This can be used to left-align the middle part with the start or end
- and then add an offset.
+ When together with 's' or 'e': add {digit} amount of offset to an
+ automatically inserted middle or end comment leader. The offset begins
+ from a left alignment. See below for more details.
-{digits}
Like {digits} but reduce the indent. This only works when there is
@@ -1334,12 +1348,42 @@ have a middle string because otherwise Vim can't recognize the middle lines.
Notice the use of the "x" flag in the above three-piece comment definition.
When you hit Return in a C-comment, Vim will insert the middle comment leader
-for the new line, e.g. " * ". To close this comment you just have to type "/"
+for the new line: " * ". To close this comment you just have to type "/"
before typing anything else on the new line. This will replace the
-middle-comment leader with the end-comment leader, leaving just " */". There
-is no need to hit BackSpace first.
-
-Examples: >
+middle-comment leader with the end-comment leader and apply any specified
+alignment, leaving just " */". There is no need to hit BackSpace first.
+
+
+Here is an example of alignment flags at work to make a comment stand out
+(kind of looks like a 1 too). Consider comment string >
+ sr:/***,m:**,ex2:******/
+
+ /***
+ **<--right aligned from "r" flag
+ **
+offset 2 spaces from the "2" flag--->**
+ ******/
+In this case, the first comment was typed, then return was pressed 4 times,
+then "/" was pressed to end the comment.
+
+Here are some finer points of three part comments. There are three times when
+alignment and offset flags are taken into consideration: opening a new line
+after a start-comment, opening a new line before an end-comment, and
+automatically ending a three-piece comment. The end alignment flag has a
+backwards perspective; the result is that the same alignment flag used with
+"s" and "e" will result in the same indent for the starting and ending pieces.
+Only one alignment per comment part is meant to be used, but an offset number
+will override the "r" and "l" flag.
+
+Enabling 'cindent' will override the alignment flags in many cases.
+Reindenting using a different method like |gq| or |=| will not consult
+alignment flags either. The same behaviour can be defined in those other
+formatting options. One consideration is that 'cindent' has additional options
+for context based indenting of comments but cannot replicate many three piece
+indent alignments. However, 'indentexpr' is has the ability to work better
+with three piece comments.
+
+Other examples: >
"b:*" Includes lines starting with "*", but not if the "*" is
followed by a non-blank. This avoids a pointer dereference
like "*str" to be recognized as a comment.
@@ -1350,17 +1394,6 @@ By default, "b:#" is included. This means that a line that starts with
"#include" is not recognized as a comment line. But a line that starts with
"# define" is recognized. This is a compromise.
-Often the alignment can be changed from right alignment to a left alignment
-with an additional space. For example, for Javadoc comments, this can be
-used (insert a backslash before the space when using ":set"): >
- s1:/*,mb:*,ex:*/
-Note that an offset is included with start, so that the middle part is left
-aligned with the start and then an offset of one character added. This makes
-it possible to left align the start and middle for this construction: >
- /**
- * comment
- */
-
{not available when compiled without the |+comments| feature}
*fo-table*
@@ -1391,7 +1424,7 @@ a Automatic formatting of paragraphs. Every time text is inserted or
n When formatting text, recognize numbered lists. This actually uses
the 'formatlistpat' option, thus any kind of list can be used. The
indent of the text after the number is used for the next line. The
- default is to find a number, optionally be followed by '.', ':', ')',
+ default is to find a number, optionally followed by '.', ':', ')',
']' or '}'. Note that 'autoindent' must be set too. Doesn't work
well together with "2".
Example: >
@@ -1555,9 +1588,10 @@ found here: |sort()|.
:sort /.*\%10v/
< To sort on the first number in the line, no matter
what is in front of it: >
- :sort /.*\ze\d/
-
-< With [r] sorting is done on the matching {pattern}
+ :sort /.\{-}\ze\d/
+< (Explanation: ".\{-}" matches any text, "\ze" sets the
+ end of the match and \d matches a digit.)
+ With [r] sorting is done on the matching {pattern}
instead of skipping past it as described above.
For example, to sort on only the first three letters
of each line: >
diff --git a/runtime/doc/debug.txt b/runtime/doc/debug.txt
index ffc178dc..0e83ec71 100644
--- a/runtime/doc/debug.txt
+++ b/runtime/doc/debug.txt
@@ -1,4 +1,4 @@
-*debug.txt* For Vim version 7.1. Last change: 2006 May 01
+*debug.txt* For Vim version 7.2a. Last change: 2006 May 01
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index 10870f76..1adef600 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -1,4 +1,4 @@
-*diff.txt* For Vim version 7.1. Last change: 2006 Oct 02
+*diff.txt* For Vim version 7.2a. Last change: 2006 Oct 02
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 126b98b9..349df2f2 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,7 +1,7 @@
-*eval.txt* For Vim version 7.1. Last change: 2008 May 28
+*eval.txt* For Vim version 7.2a. Last change: 2008 Jun 24
- VIM REFERENCE MANUAL by Bram Moolenaar
+ VIM REFERENCE MANUAL by Bram Moolenaar
Expression evaluation *expression* *expr* *E15* *eval*
@@ -9,7 +9,7 @@ Expression evaluation *expression* *expr* *E15* *eval*
Using expressions is introduced in chapter 41 of the user manual |usr_41.txt|.
Note: Expression evaluation can be disabled at compile time. If this has been
-done, the features in this document are not available. See |+eval| and
+done, the features in this document are not available. See |+eval| and
|no-eval-feature|.
1. Variables |variables|
@@ -37,13 +37,17 @@ done, the features in this document are not available. See |+eval| and
1.1 Variable types ~
*E712*
-There are five types of variables:
+There are six types of variables:
-Number A 32 bit signed number.
+Number A 32 bit signed number. |expr-number| *Number*
Examples: -123 0x10 0177
+Float A floating point number. |floating-point-format| *Float*
+ {only when compiled with the |+float| feature}
+ Examples: 123.456 1.15e-6 -1.1e3
+
String A NUL terminated string of 8-bit unsigned characters (bytes).
- Examples: "ab\txx\"--" 'x-z''a,c'
+ |expr-string| Examples: "ab\txx\"--" 'x-z''a,c'
Funcref A reference to a function |Funcref|.
Example: function("strlen")
@@ -92,18 +96,26 @@ use strlen(): >
< *E745* *E728* *E703* *E729* *E730* *E731*
List, Dictionary and Funcref types are not automatically converted.
- *E706*
+ *E805* *E806* *E808*
+When mixing Number and Float the Number is converted to Float. Otherwise
+there is no automatic conversion of Float. You can use str2float() for String
+to Float, printf() for Float to String and float2nr() for Float to Number.
+
+ *E706* *sticky-type-checking*
You will get an error if you try to change the type of a variable. You need
to |:unlet| it first to avoid this error. String and Number are considered
-equivalent though. Consider this sequence of commands: >
+equivalent though, as well are Float and Number. Consider this sequence of
+commands: >
:let l = "string"
:let l = 44 " changes type from String to Number
- :let l = [1, 2, 3] " error!
+ :let l = [1, 2, 3] " error! l is still a Number
+ :let l = 4.4 " changes type from Number to Float
+ :let l = "string" " error!
1.2 Function references ~
*Funcref* *E695* *E718*
-A Funcref variable is obtained with the |function()| function. It can be used
+A Funcref variable is obtained with the |function()| function. It can be used
in an expression in the place of a function name, before the parenthesis
around the arguments, to invoke the function it refers to. Example: >
@@ -137,7 +149,7 @@ arguments: >
1.3 Lists ~
*List* *Lists* *E686*
A List is an ordered sequence of items. An item can be of any type. Items
-can be accessed by their index number. Items can be added and removed at any
+can be accessed by their index number. Items can be added and removed at any
position in the sequence.
@@ -148,7 +160,7 @@ Examples: >
:let mylist = [1, two, 3, "four"]
:let emptylist = []
-An item can be any expression. Using a List for an item creates a
+An item can be any expression. Using a List for an item creates a
List of Lists: >
:let nestlist = [[11, 12], [21, 22], [31, 32]]
@@ -207,7 +219,7 @@ length minus one is used: >
:echo mylist[2:8] " result: [2, 3]
NOTE: mylist[s:e] means using the variable "s:e" as index. Watch out for
-using a single letter variable before the ":". Insert a space when needed:
+using a single letter variable before the ":". Insert a space when needed:
mylist[s : e].
@@ -258,13 +270,13 @@ variables. Example: >
< 0
Thus comparing Lists is more strict than comparing numbers and strings. You
-can compare simple values this way too by putting them in a string: >
+can compare simple values this way too by putting them in a list: >
:let a = 5
:let b = "5"
- echo a == b
+ :echo a == b
< 1 >
- echo [a] == [b]
+ :echo [a] == [b]
< 0
@@ -339,7 +351,7 @@ the loop.
If all you want to do is modify each item in the list then the |map()|
function will be a simpler method than a for loop.
-Just like the |:let| command, |:for| also accepts a list of variables. This
+Just like the |:let| command, |:for| also accepts a list of variables. This
requires the argument to be a list of lists. >
:for [lnum, col] in [[1, 3], [2, 8], [3, 0]]
: call Doit(lnum, col)
@@ -396,10 +408,10 @@ only appear once. Examples: >
< *E713* *E716* *E717*
A key is always a String. You can use a Number, it will be converted to a
String automatically. Thus the String '4' and the number 4 will find the same
-entry. Note that the String '04' and the Number 04 are different, since the
+entry. Note that the String '04' and the Number 04 are different, since the
Number will be converted to the String '4'.
-A value can be any expression. Using a Dictionary for a value creates a
+A value can be any expression. Using a Dictionary for a value creates a
nested Dictionary: >
:let nestdict = {1: {11: 'a', 12: 'b'}, 2: {21: 'c'}}
@@ -426,7 +438,7 @@ key lookup can be repeated: >
Dictionary to List conversion ~
-You may want to loop over the entries in a dictionary. For this you need to
+You may want to loop over the entries in a dictionary. For this you need to
turn the Dictionary into a List and pass it to |:for|.
Most often you want to loop over the keys, using the |keys()| function: >
@@ -443,7 +455,7 @@ To loop over the values use the |values()| function: >
:endfor
If you want both the key and the value use the |items()| function. It returns
-a List in which each item is a List with two items, the key and the value: >
+a List in which each item is a List with two items, the key and the value: >
:for [key, value] in items(mydict)
: echo key . ': ' . value
:endfor
@@ -493,7 +505,7 @@ This removes all entries from "dict" with a value not matching 'x'.
Dictionary function ~
*Dictionary-function* *self* *E725*
When a function is defined with the "dict" attribute it can be used in a
-special way with a dictionary. Example: >
+special way with a dictionary. Example: >
:function Mylen() dict
: return len(self.data)
:endfunction
@@ -517,7 +529,7 @@ assigned to a Dictionary in this way: >
:echo mydict.len()
The function will then get a number and the value of dict.len is a |Funcref|
-that references this function. The function can only be used through a
+that references this function. The function can only be used through a
|Funcref|. It will automatically be deleted when there is no |Funcref|
remaining that refers to it.
@@ -699,7 +711,7 @@ expr5 {cmp} expr5
Compare two expr5 expressions, resulting in a 0 if it evaluates to false, or 1
if it evaluates to true.
- *expr-==* *expr-!=* *expr->* *expr->=*
+ *expr-==* *expr-!=* *expr->* *expr->=*
*expr-<* *expr-<=* *expr-=~* *expr-!~*
*expr-==#* *expr-!=#* *expr->#* *expr->=#*
*expr-<#* *expr-<=#* *expr-=~#* *expr-!~#*
@@ -738,21 +750,21 @@ A |Funcref| can only be compared with a |Funcref| and only "equal" and "not
equal" can be used. Case is never ignored.
When using "is" or "isnot" with a |List| this checks if the expressions are
-referring to the same |List| instance. A copy of a |List| is different from
+referring to the same |List| instance. A copy of a |List| is different from
the original |List|. When using "is" without a |List| it is equivalent to
using "equal", using "isnot" equivalent to using "not equal". Except that a
-different type means the values are different. "4 == '4'" is true, "4 is '4'"
+different type means the values are different. "4 == '4'" is true, "4 is '4'"
is false.
When comparing a String with a Number, the String is converted to a Number,
-and the comparison is done on Numbers. This means that "0 == 'x'" is TRUE,
+and the comparison is done on Numbers. This means that "0 == 'x'" is TRUE,
because 'x' converted to a Number is zero.
When comparing two Strings, this is done with strcmp() or stricmp(). This
results in the mathematical difference (comparing byte values), not
necessarily the alphabetical difference in the local language.
-When using the operators with a trailing '#", or the short version and
+When using the operators with a trailing '#', or the short version and
'ignorecase' is off, the comparing is done with strcmp(): case matters.
When using the operators with a trailing '?', or the short version and
@@ -792,11 +804,30 @@ Note the difference between "+" and ".":
"123" + "456" = 579
"123" . "456" = "123456"
-When the righthand side of '/' is zero, the result is 0x7fffffff.
+Since '.' has the same precedence as '+' and '-', you need to read: >
+ 1 . 90 + 90.0
+As: >
+ (1 . 90) + 90.0
+That works, since the String "190" is automatically converted to the Number
+190, which can be added to the Float 90.0. However: >
+ 1 . 90 * 90.0
+Should be read as: >
+ 1 . (90 * 90.0)
+Since '.' has lower precedence than '*'. This does NOT work, since this
+attempts to concatenate a Float and a String.
+
+When dividing a Number by zero the result depends on the value:
+ 0 / 0 = -0x80000000 (like NaN for Float)
+ >0 / 0 = 0x7fffffff (like positive infinity)
+ <0 / 0 = -0x7fffffff (like negative infinity)
+ (before Vim 7.2 it was always 0x7fffffff)
+
When the righthand side of '%' is zero, the result is 0.
None of these work for |Funcref|s.
+. and % do not work for Float. *E804*
+
expr7 *expr7*
-----
@@ -810,7 +841,7 @@ For '+' the number is unchanged.
A String will be converted to a Number first.
-These three can be repeated and mixed. Examples:
+These three can be repeated and mixed. Examples:
!-1 == 0
!!8 == 1
--9 == 9
@@ -835,7 +866,7 @@ compatibility). Use [-1:] to get the last byte.
If expr8 is a |List| then it results the item at index expr1. See |list-index|
for possible index values. If the index is out of range this results in an
-error. Example: >
+error. Example: >
:let item = mylist[-1] " get last item
Generally, if a |List| index is equal to or higher than the length of the
@@ -866,7 +897,7 @@ Examples: >
:let s = s[:-3] " remove last two bytes
If expr8 is a |List| this results in a new |List| with the items indicated by
-the indexes expr1a and expr1b. This works like with a String, as explained
+the indexes expr1a and expr1b. This works like with a String, as explained
just above, except that indexes out of range cause an error. Examples: >
:let l = mylist[:3] " first four items
:let l = mylist[4:4] " List with one item
@@ -909,6 +940,53 @@ number number constant *expr-number*
Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0).
+ *floating-point-format*
+Floating point numbers can be written in two forms:
+
+ [-+]{N}.{M}
+ [-+]{N}.{M}e[-+]{exp}
+
+{N} and {M} are numbers. Both {N} and {M} must be present and can only
+contain digits.
+[-+] means there is an optional plus or minus sign.
+{exp} is the exponent, power of 10.
+Only a decimal point is accepted, not a comma. No matter what the current
+locale is.
+{only when compiled with the |+float| feature}
+
+Examples:
+ 123.456
+ +0.0001
+ 55.0
+ -0.123
+ 1.234e03
+ 1.0E-6
+ -3.1416e+88
+
+These are INVALID:
+ 3. empty {M}
+ 1e40 missing .{M}
+
+Rationale:
+Before floating point was introduced, the text "123.456" was interpreted as
+the two numbers "123" and "456", both converted to a string and concatenated,
+resulting in the string "123456". Since this was considered pointless, and we
+could not find it actually being used in Vim scripts, this backwards
+incompatibility was accepted in favor of being able to use the normal notation
+for floating point numbers.
+
+ *floating-point-precision*
+The precision and range of floating points numbers depends on what "double"
+means in the library Vim was compiled with. There is no way to change this at
+runtime.
+
+The default for displaying a |Float| is to use 6 decimal places, like using
+printf("%g", f). You can select something else when using the |printf()|
+function. Example: >
+ :echo printf('%.15e', atan(1))
+< 7.853981633974483e-01
+
+
string *expr-string* *E114*
------
@@ -924,7 +1002,7 @@ A string constant accepts these special characters:
\x. byte specified with one hex number (must be followed by non-hex char)
\X.. same as \x..
\X. same as \x.
-\u.... character specified with up to 4 hex numbers, stored according to the
+\u.... character specified with up to 4 hex numbers, stored according to the
current value of 'encoding' (e.g., "\u02a4")
\U.... same as \u....
\b backspace <BS>
@@ -950,11 +1028,11 @@ literal-string *literal-string* *E115*
Note that single quotes are used.
-This string is taken as it is. No backslashes are removed or have a special
+This string is taken as it is. No backslashes are removed or have a special
meaning. The only exception is that two quotes stand for one quote.
Single quoted strings are useful for patterns, so that backslashes do not need
-to be doubled. These two commands are equivalent: >
+to be doubled. These two commands are equivalent: >
if a =~ "\\s*"
if a =~ '\s*'
@@ -980,7 +1058,7 @@ register *expr-register* *@r*
The result is the contents of the named register, as a single string.
Newlines are inserted where required. To get the contents of the unnamed
-register use @" or @@. See |registers| for an explanation of the available
+register use @" or @@. See |registers| for an explanation of the available
registers.
When using the '=' register you get the expression itself, not what it
@@ -1047,7 +1125,7 @@ specified by what is prepended:
|local-variable| l: Local to a function.
|script-variable| s: Local to a |:source|'ed Vim script.
|function-argument| a: Function argument (only inside a function).
-|vim-variable| v: Global, predefined by Vim.
+|vim-variable| v: Global, predefined by Vim.
The scope name by itself can be used as a |Dictionary|. For example, to
delete all script-local variables: >
@@ -1068,8 +1146,8 @@ b:changedtick The total number of changes to the current buffer. It is
in this case. This can be used to perform an action only when
the buffer has changed. Example: >
:if my_changedtick != b:changedtick
- : let my_changedtick = b:changedtick
- : call My_Update()
+ : let my_changedtick = b:changedtick
+ : call My_Update()
:endif
<
*window-variable* *w:var*
@@ -1083,7 +1161,7 @@ without the +windows feature}
*global-variable* *g:var*
Inside functions global variables are accessed with "g:". Omitting this will
-access a variable local to a function. But "g:" can also be used in any other
+access a variable local to a function. But "g:" can also be used in any other
place if you like.
*local-variable* *l:var*
@@ -1216,7 +1294,7 @@ v:cmdarg This variable is used for two purposes:
set before an autocommand event for a file read/write
command is triggered. There is a leading space to make it
possible to append this variable directly after the
- read/write command. Note: The "+cmd" argument isn't
+ read/write command. Note: The "+cmd" argument isn't
included here, because it will be executed anyway.
2. When printing a PostScript file with ":hardcopy" this is
the argument for the ":hardcopy" command. This can be used
@@ -1230,7 +1308,7 @@ v:cmdbang Set like v:cmdarg for a file read/write command. When a "!"
*v:count* *count-variable*
v:count The count given for the last Normal mode command. Can be used
- to get the count before a mapping. Read-only. Example: >
+ to get the count before a mapping. Read-only. Example: >
:map _x :<C-U>echo "the count is " . v:count<CR>
< Note: The <C-U> is required to remove the line range that you
get when typing ':' after a count.
@@ -1251,7 +1329,7 @@ v:ctype The current locale setting for characters of the runtime
See |multi-lang|.
*v:dying* *dying-variable*
-v:dying Normally zero. When a deadly signal is caught it's set to
+v:dying Normally zero. When a deadly signal is caught it's set to
one. When multiple signals are caught the number increases.
Can be used in an autocommand to check if Vim didn't
terminate normally. {only works on Unix}
@@ -1321,7 +1399,7 @@ v:fname_out The name of the output file. Only valid while
'diffexpr' output of diff
'patchexpr' resulting patched file
(*) When doing conversion for a write command (e.g., ":w
- file") it will be equal to v:fname_in. When doing conversion
+ file") it will be equal to v:fname_in. When doing conversion
for a read command (e.g., ":e file") it will be a temporary
file and different from v:fname_in.
@@ -1423,7 +1501,7 @@ v:prevcount The count given for the last but one Normal mode command.
< Read-only.
*v:profiling* *profiling-variable*
-v:profiling Normally zero. Set to one after using ":profile start".
+v:profiling Normally zero. Set to one after using ":profile start".
See |profiling|.
*v:progname* *progname-variable*
@@ -1448,6 +1526,15 @@ v:scrollstart String describing the script or function that caused the
v:servername The resulting registered |x11-clientserver| name if any.
Read-only.
+
+v:searchforward *v:searchforward* *searchforward-variable*
+ Search direction: 1 after a forward search, 0 after a
+ backward search. It is reset to forward when directly setting
+ the last search pattern, see |quote/|.
+ Note that the value is restored when returning from a
+ function. |function-search-undo|.
+ Read-write.
+
*v:shell_error* *shell_error-variable*
v:shell_error Result of the last shell command. When non-zero, the last
shell command had an error. When zero, there was no problem.
@@ -1477,20 +1564,20 @@ v:swapchoice |SwapExists| autocommands can set this to the selected choice
'd' Delete swapfile
'q' Quit
'a' Abort
- The value should be a single-character string. An empty value
+ The value should be a single-character string. An empty value
results in the user being asked, as would happen when there is
no SwapExists autocommand. The default is empty.
*v:swapcommand* *swapcommand-variable*
v:swapcommand Normal mode command to be executed after a file has been
opened. Can be used for a |SwapExists| autocommand to have
- another Vim open the file and jump to the right place. For
+ another Vim open the file and jump to the right place. For
example, when jumping to a tag the value is ":tag tagname\r".
For ":edit +cmd file" the value is ":cmd\r".
*v:termresponse* *termresponse-variable*
v:termresponse The escape sequence returned by the terminal for the |t_RV|
- termcap entry. It is set when Vim receives an escape sequence
+ termcap entry. It is set when Vim receives an escape sequence
that starts with ESC [ or CSI and ends in a 'c', with only
digits, ';' and '.' in between.
When this option is set, the TermResponse autocommand event is
@@ -1510,7 +1597,7 @@ v:this_session Full filename of the last loaded or saved session file. See
*v:throwpoint* *throwpoint-variable*
v:throwpoint The point where the exception most recently caught and not
- finished was thrown. Not set when commands are typed. See
+ finished was thrown. Not set when commands are typed. See
also |v:exception| and |throw-variables|.
Example: >
:try
@@ -1521,7 +1608,7 @@ v:throwpoint The point where the exception most recently caught and not
< Output: "Exception from test.vim, line 2"
*v:val* *val-variable*
-v:val Value of the current item of a |List| or |Dictionary|. Only
+v:val Value of the current item of a |List| or |Dictionary|. Only
valid while evaluating the expression used with |map()| and
|filter()|. Read-only.
@@ -1548,6 +1635,7 @@ See |function-list| for a list grouped by what the function is used for.
USAGE RESULT DESCRIPTION ~
+abs( {expr}) Float or Number absolute value of {expr}
add( {list}, {item}) List append {item} to |List| {list}
append( {lnum}, {string}) Number append {string} below line {lnum}
append( {lnum}, {list}) Number append lines {list} below line {lnum}
@@ -1555,9 +1643,10 @@ argc() Number number of files in the argument list
argidx() Number current index in the argument list
argv( {nr}) String {nr} entry of the argument list
argv( ) List the argument list
+atan( {expr}) Float arc tangent of {expr}
browse( {save}, {title}, {initdir}, {default})
String put up a file requester
-browsedir( {title}, {initdir}) String put up a directory requester
+browsedir( {title}, {initdir}) String put up a directory requester
bufexists( {expr}) Number TRUE if buffer {expr} exists
buflisted( {expr}) Number TRUE if buffer {expr} is listed
bufloaded( {expr}) Number TRUE if buffer {expr} is loaded
@@ -1568,17 +1657,19 @@ byte2line( {byte}) Number line number at byte count {byte}
byteidx( {expr}, {nr}) Number byte index of {nr}'th char in {expr}
call( {func}, {arglist} [, {dict}])
any call {func} with arguments {arglist}
-changenr() Number current change number
+ceil( {expr}) Float round {expr} up
+changenr() Number current change number
char2nr( {expr}) Number ASCII value of first char in {expr}
cindent( {lnum}) Number C indent for line {lnum}
clearmatches() None clear all matches
col( {expr}) Number column nr of cursor or mark
-complete({startcol}, {matches}) String set Insert mode completion
+complete({startcol}, {matches}) String set Insert mode completion
complete_add( {expr}) Number add completion match
-complete_check() Number check for key typed during completion
+complete_check() Number check for key typed during completion
confirm( {msg} [, {choices} [, {default} [, {type}]]])
Number number of choice picked by user
copy( {expr}) any make a shallow copy of {expr}
+cos( {expr}) Float cosine of {expr}
count( {list}, {expr} [, {start} [, {ic}]])
Number count how many {expr} are in {list}
cscope_connection( [{num} , {dbpath} [, {prepend}]])
@@ -1600,7 +1691,7 @@ exists( {expr}) Number TRUE if {expr} exists
extend({expr1}, {expr2} [, {expr3}])
List/Dict insert items of {expr2} into {expr1}
expand( {expr}) String expand special keywords in {expr}
-feedkeys( {string} [, {mode}]) Number add key sequence to typeahead buffer
+feedkeys( {string} [, {mode}]) Number add key sequence to typeahead buffer
filereadable( {file}) Number TRUE if {file} is a readable file
filewritable( {file}) Number TRUE if {file} is a writable file
filter( {expr}, {string}) List/Dict remove items from {expr} where
@@ -1609,6 +1700,8 @@ finddir( {name}[, {path}[, {count}]])
String find directory {name} in {path}
findfile( {name}[, {path}[, {count}]])
String find file {name} in {path}
+float2nr( {expr}) Number convert Float {expr} to a Number
+floor( {expr}) Float round {expr} down
fnameescape( {fname}) String escape special characters in {fname}
fnamemodify( {fname}, {mods}) String modify file name
foldclosed( {lnum}) Number first line of fold at {lnum} if closed
@@ -1687,6 +1780,7 @@ line( {expr}) Number line nr of cursor, last line or mark
line2byte( {lnum}) Number byte count of line {lnum}
lispindent( {lnum}) Number Lisp indent for line {lnum}
localtime() Number current time
+log10( {expr}) Float logarithm of Float {expr} to base 10
map( {expr}, {string}) List/Dict change each item in {expr} to {expr}
maparg( {name}[, {mode} [, {abbr}]])
String rhs of mapping {name} in mode {mode}
@@ -1708,13 +1802,14 @@ max({list}) Number maximum value of items in {list}
min({list}) Number minimum value of items in {list}
mkdir({name} [, {path} [, {prot}]])
Number create directory {name}
-mode() String current editing mode
+mode( [expr]) String current editing mode
nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
nr2char( {expr}) String single char with ASCII value {expr}
pathshorten( {expr}) String shorten directory names in a path
+pow( {x}, {y}) Float {x} to the power of {y}
prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum}
-printf( {fmt}, {expr1}...) String format text
-pumvisible() Number whether popup menu is visible
+printf( {fmt}, {expr1}...) String format text
+pumvisible() Number whether popup menu is visible
range( {expr} [, {max} [, {stride}]])
List items from {expr} to {max}
readfile({fname} [, {binary} [, {max}]])
@@ -1735,10 +1830,11 @@ rename( {from}, {to}) Number rename (move) file from {from} to {to}
repeat( {expr}, {count}) String repeat {expr} {count} times
resolve( {filename}) String get filename a shortcut points to
reverse( {list}) List reverse {list} in-place
+round( {expr}) Float round off {expr}
search( {pattern} [, {flags} [, {stopline} [, {timeout}]]])
Number search for {pattern}
searchdecl({name} [, {global} [, {thisblock}]])
- Number search for variable declaration
+ Number search for variable declaration
searchpair( {start}, {middle}, {end} [, {flags} [, {skip} [...]]])
Number search for other end of start/end pair
searchpairpos( {start}, {middle}, {end} [, {flags} [, {skip} [...]]])
@@ -1763,6 +1859,7 @@ setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
shellescape( {string}) String escape {string} for use as shell
command argument
simplify( {filename}) String simplify filename as much as possible
+sin( {expr}) Float sine of {expr}
sort( {list} [, {func}]) List sort {list}, using {func} to compare
soundfold( {word}) String sound-fold {word}
spellbadword() String badly spelled word at cursor
@@ -1770,7 +1867,9 @@ spellsuggest( {word} [, {max} [, {capital}]])
List spelling suggestions
split( {expr} [, {pat} [, {keepempty}]])
List make |List| from {pat} separated {expr}
-str2nr( {expr} [, {base}]) Number convert string to number
+sqrt( {expr} Float squar root of {expr}
+str2float( {expr}) Float convert String to Float
+str2nr( {expr} [, {base}]) Number convert String to Number
strftime( {format}[, {time}]) String time in specified format
stridx( {haystack}, {needle}[, {start}])
Number index of {needle} in {haystack}
@@ -1788,19 +1887,20 @@ synID( {lnum}, {col}, {trans}) Number syntax ID at {lnum} and {col}
synIDattr( {synID}, {what} [, {mode}])
String attribute {what} of syntax ID {synID}
synIDtrans( {synID}) Number translated syntax ID of {synID}
-synstack({lnum}, {col}) List stack of syntax IDs at {lnum} and {col}
+synstack({lnum}, {col}) List stack of syntax IDs at {lnum} and {col}
system( {expr} [, {input}]) String output of shell command/filter {expr}
tabpagebuflist( [{arg}]) List list of buffer numbers in tab page
tabpagenr( [{arg}]) Number number of current or last tab page
tabpagewinnr( {tabarg}[, {arg}])
Number number of current window in tab page
taglist( {expr}) List list of tags matching {expr}
-tagfiles() List tags files used
+tagfiles() List tags files used
tempname() String name for a temporary file
tolower( {expr}) String the String {expr} switched to lowercase
toupper( {expr}) String the String {expr} switched to uppercase
tr( {src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
to chars in {tostr}
+trunc( {expr} Float truncate Float {expr}
type( {name}) Number type of variable {name}
values( {dict}) List values in {dict}
virtcol( {expr}) Number screen column of cursor or mark
@@ -1817,6 +1917,20 @@ winwidth( {nr}) Number width of window {nr}
writefile({list}, {fname} [, {binary}])
Number write list of lines to file {fname}
+abs({expr}) *abs()*
+ Return the absolute value of {expr}. When {expr} evaluates to
+ a |Float| abs() returns a |Float|. When {expr} can be
+ converted to a |Number| abs() returns a |Number|. Otherwise
+ abs() gives an error message and returns -1.
+ Examples: >
+ echo abs(1.456)
+< 1.456 >
+ echo abs(-5.456)
+< 5.456 >
+ echo abs(-4)
+< 4
+ {only available when compiled with the |+float| feature}
+
add({list}, {expr}) *add()*
Append the item {expr} to |List| {list}. Returns the
resulting |List|. Examples: >
@@ -1834,7 +1948,7 @@ append({lnum}, {expr}) *append()*
the current buffer.
{lnum} can be zero to insert a line before the first one.
Returns 1 for failure ({lnum} out of range or out of memory),
- 0 for success. Example: >
+ 0 for success. Example: >
:let failed = append(line('$'), "# THE END")
:let failed = append(0, ["Chapter 1", "the beginning"])
<
@@ -1852,13 +1966,24 @@ argv([{nr}]) The result is the {nr}th file in the argument list of the
Example: >
:let i = 0
:while i < argc()
- : let f = escape(argv(i), '. ')
+ : let f = escape(fnameescape(argv(i)), '.')
: exe 'amenu Arg.' . f . ' :e ' . f . '<CR>'
: let i = i + 1
:endwhile
< Without the {nr} argument a |List| with the whole |arglist| is
returned.
+atan({expr}) *atan()*
+ Return the principal value of the arc tangent of {expr}, in
+ the range [-pi/2, +pi/2] radians, as a |Float|.
+ {expr} must evaluate to a |Float| or a |Number|.
+ Examples: >
+ :echo atan(100)
+< 1.560797 >
+ :echo atan(-4.01)
+< -1.326405
+ {only available when compiled with the |+float| feature}
+
*browse()*
browse({save}, {title}, {initdir}, {default})
Put up a file requester. This only works when "has("browse")"
@@ -1892,12 +2017,15 @@ bufexists({expr}) *bufexists()*
exactly. The name can be:
- Relative to the current directory.
- A full path.
- - The name of a buffer with 'filetype' set to "nofile".
+ - The name of a buffer with 'buftype' set to "nofile".
- A URL name.
Unlisted buffers will be found.
Note that help files are listed by their short name in the
output of |:buffers|, but bufexists() requires using their
long name to be able to find them.
+ bufexists() may report a buffer exists, but to use the name
+ with a |:buffer| command you may need to use |expand()|. Esp
+ for MS-Windows 8.3 names in the form "c:\DOCUME~1"
Use "bufexists(0)" to test for the existence of an alternate
file name.
*buffer_exists()*
@@ -1919,7 +2047,7 @@ bufname({expr}) *bufname()*
If {expr} is a Number, that buffer number's name is given.
Number zero is the alternate buffer for the current window.
If {expr} is a String, it is used as a |file-pattern| to match
- with the buffer names. This is always done like 'magic' is
+ with the buffer names. This is always done like 'magic' is
set and 'cpoptions' is empty. When there is more than one
match an empty string is returned.
"" or "%" can be used for the current buffer, "#" for the
@@ -1965,7 +2093,7 @@ bufnr({expr} [, {create}])
bufwinnr({expr}) *bufwinnr()*
The result is a Number, which is the number of the first
window associated with buffer {expr}. For the use of {expr},
- see |bufname()| above. If buffer {expr} doesn't exist or
+ see |bufname()| above. If buffer {expr} doesn't exist or
there is no such window, -1 is returned. Example: >
echo "A window containing buffer 1 is " . (bufwinnr(1))
@@ -2010,6 +2138,19 @@ call({func}, {arglist} [, {dict}]) *call()* *E699*
{dict} is for functions with the "dict" attribute. It will be
used to set the local variable "self". |Dictionary-function|
+ceil({expr}) *ceil()*
+ Return the smallest integral value greater than or equal to
+ {expr} as a |Float| (round up).
+ {expr} must evaluate to a |Float| or a |Number|.
+ Examples: >
+ echo ceil(1.456)
+< 2.0 >
+ echo ceil(-5.456)
+< -5.0 >
+ echo ceil(4.0)
+< 4.0
+ {only available when compiled with the |+float| feature}
+
changenr() *changenr()*
Return the number of the most recent change. This is the same
number as what is displayed with |:undolist| and can be used
@@ -2025,7 +2166,7 @@ char2nr({expr}) *char2nr()*
< The current 'encoding' is used. Example for "utf-8": >
char2nr("") returns 225
char2nr(""[0]) returns 195
-< nr2char() does the opposite.
+< |nr2char()| does the opposite.
cindent({lnum}) *cindent()*
Get the amount of indent for line {lnum} according the C
@@ -2050,7 +2191,7 @@ col({expr}) The result is a Number, which is the byte index of the column
returned)
Additionally {expr} can be [lnum, col]: a |List| with the line
and column number. Most useful when the column is "$", to get
- the las column of a specific line. When "lnum" or "col" is
+ the last column of a specific line. When "lnum" or "col" is
out of range then col() returns zero.
To get the line number use |line()|. To get both use
|getpos()|.
@@ -2061,7 +2202,7 @@ col({expr}) The result is a Number, which is the byte index of the column
col("$") length of cursor line plus one
col("'t") column of mark t
col("'" . markname) column of mark markname
-< The first column is 1. 0 is returned for an error.
+< The first column is 1. 0 is returned for an error.
For an uppercase mark the column may actually be in another
buffer.
For the cursor position, when 'virtualedit' is active, the
@@ -2108,7 +2249,7 @@ complete_add({expr}) *complete_add()*
Returns 0 for failure (empty string or out of memory),
1 when the match was added, 2 when the match was already in
the list.
- See |complete-functions| for an explanation of {expr}. It is
+ See |complete-functions| for an explanation of {expr}. It is
the same as one item in the list that 'omnifunc' would return.
complete_check() *complete_check()*
@@ -2144,7 +2285,7 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
that is made if the user hits <CR>. Use 1 to make the first
choice the default one. Use 0 to not set a default. If
{default} is omitted, 1 is used.
- The optional {type} argument gives the type of dialog. This
+ The optional {type} argument gives the type of dialog. This
is only used for the icon of the Win32 GUI. It can be one of
these values: "Error", "Question", "Info", "Warning" or
"Generic". Only the first character is relevant. When {type}
@@ -2163,20 +2304,31 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
:endif
< In a GUI dialog, buttons are used. The layout of the buttons
depends on the 'v' flag in 'guioptions'. If it is included,
- the buttons are always put vertically. Otherwise, confirm()
+ the buttons are always put vertically. Otherwise, confirm()
tries to put the buttons in one horizontal line. If they
don't fit, a vertical layout is used anyway. For some systems
the horizontal layout is always used.
*copy()*
-copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't
+copy({expr}) Make a copy of {expr}. For Numbers and Strings this isn't
different from using {expr} directly.
When {expr} is a |List| a shallow copy is created. This means
that the original |List| can be changed without changing the
- copy, and vise versa. But the items are identical, thus
- changing an item changes the contents of both |Lists|. Also
+ copy, and vice versa. But the items are identical, thus
+ changing an item changes the contents of both |Lists|. Also
see |deepcopy()|.
+cos({expr}) *cos()*
+ Return the cosine of {expr}, measured in radians, as a |Float|.
+ {expr} must evaluate to a |Float| or a |Number|.
+ Examples: >
+ :echo cos(100)
+< 0.862319 >
+ :echo cos(-4.01)
+< -0.646043
+ {only available when compiled with the |+float| feature}
+
+
count({comp}, {expr} [, {ic} [, {start}]]) *count()*
Return the number of times an item with value {expr} appears
in |List| or |Dictionary| {comp}.
@@ -2247,11 +2399,11 @@ cursor({list})
deepcopy({expr}[, {noref}]) *deepcopy()* *E698*
- Make a copy of {expr}. For Numbers and Strings this isn't
+ Make a copy of {expr}. For Numbers and Strings this isn't
different from using {expr} directly.
When {expr} is a |List| a full copy is created. This means
that the original |List| can be changed without changing the
- copy, and vise versa. When an item is a |List|, a copy for it
+ copy, and vice versa. When an item is a |List|, a copy for it
is made, recursively. Thus changing an item in the copy does
not change the contents of the original |List|.
When {noref} is omitted or zero a contained |List| or
@@ -2305,7 +2457,7 @@ diff_hlID({lnum}, {col}) *diff_hlID()*
empty({expr}) *empty()*
Return the Number 1 if {expr} is empty, zero otherwise.
A |List| or |Dictionary| is empty when it does not have any
- items. A Number is empty when its value is zero.
+ items. A Number is empty when its value is zero.
For a long |List| this is much faster then comparing the
length with zero.
@@ -2315,12 +2467,14 @@ escape({string}, {chars}) *escape()*
:echo escape('c:\program files\vim', ' \')
< results in: >
c:\\program\ files\\vim
+< Also see |shellescape()|.
-< *eval()*
+ *eval()*
eval({string}) Evaluate {string} and return the result. Especially useful to
turn the result of |string()| back into the original value.
- This works for Numbers, Strings and composites of them.
- Also works for |Funcref|s that refer to existing functions.
+ This works for Numbers, Floats, Strings and composites of
+ them. Also works for |Funcref|s that refer to existing
+ functions.
eventhandler() *eventhandler()*
Returns 1 when inside an event handler. That is that Vim got
@@ -2336,10 +2490,10 @@ executable({expr}) *executable()*
searchpath for programs. *PATHEXT*
On MS-DOS and MS-Windows the ".exe", ".bat", etc. can
optionally be included. Then the extensions in $PATHEXT are
- tried. Thus if "foo.exe" does not exist, "foo.exe.bat" can be
- found. If $PATHEXT is not set then ".exe;.com;.bat;.cmd" is
+ tried. Thus if "foo.exe" does not exist, "foo.exe.bat" can be
+ found. If $PATHEXT is not set then ".exe;.com;.bat;.cmd" is
used. A dot by itself can be used in $PATHEXT to try using
- the name without an extension. When 'shell' looks like a
+ the name without an extension. When 'shell' looks like a
Unix shell, then the name is also tried without adding an
extension.
On MS-DOS and MS-Windows it only checks if the file exists and
@@ -2366,7 +2520,7 @@ exists({expr}) The result is a Number, which is non-zero if {expr} is
or user defined function (see
|user-functions|).
varname internal variable (see
- |internal-variables|). Also works
+ |internal-variables|). Also works
for |curly-braces-names|, |Dictionary|
entries, |List| items, etc. Beware
that this may cause functions to be
@@ -2435,7 +2589,7 @@ expand({expr} [, {flag}]) *expand()*
characters. [Note: in version 5.0 a space was used, which
caused problems when a file name contains a space]
- If the expansion fails, the result is an empty string. A name
+ If the expansion fails, the result is an empty string. A name
for a non-existing file is not included.
When {expr} starts with '%', '#' or '<', the expansion is done
@@ -2494,9 +2648,9 @@ expand({expr} [, {flag}]) *expand()*
<
Expand() can also be used to expand variables and environment
variables that are only known in a shell. But this can be
- slow, because a shell must be started. See |expr-env-expand|.
+ slow, because a shell must be started. See |expr-env-expand|.
The expanded variable is still handled like a list of file
- names. When an environment variable cannot be expanded, it is
+ names. When an environment variable cannot be expanded, it is
left unchanged. Thus ":echo expand('$FOOBAR')" results in
"$FOOBAR".
@@ -2515,7 +2669,7 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
Examples: >
:echo sort(extend(mylist, [7, 5]))
:call extend(mylist, [2, 3], 1)
-< Use |add()| to concatenate one item to a list. To concatenate
+< Use |add()| to concatenate one item to a list. To concatenate
two lists into a new list use the + operator: >
:let newlist = [1, 2, 3] + [4, 5]
<
@@ -2536,7 +2690,7 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
feedkeys({string} [, {mode}]) *feedkeys()*
Characters in {string} are queued for processing as if they
- come from a mapping or were typed by the user. They are added
+ come from a mapping or were typed by the user. They are added
to the end of the typeahead buffer, thus if a mapping is still
being executed these characters come after them.
The function does not wait for processing of keys contained in
@@ -2568,7 +2722,7 @@ filereadable({file}) *filereadable()*
filewritable({file}) *filewritable()*
The result is a Number, which is 1 when a file with the
name {file} exists, and can be written. If {file} doesn't
- exist, or is not writable, the result is 0. If (file) is a
+ exist, or is not writable, the result is 0. If {file} is a
directory, and we can write to it, the result is 2.
@@ -2621,13 +2775,47 @@ findfile({name}[, {path}[, {count}]]) *findfile()*
< Searches from the directory of the current file upwards until
it finds the file "tags.vim".
+float2nr({expr}) *float2nr()*
+ Convert {expr} to a Number by omitting the part after the
+ decimal point.
+ {expr} must evaluate to a |Float| or a Number.
+ When the value of {expr} is out of range for a |Number| the
+ result is truncated to 0x7fffffff or -0x7fffffff. NaN results
+ in -0x80000000.
+ Examples: >
+ echo float2nr(3.95)
+< 3 >
+ echo float2nr(-23.45)
+< -23 >
+ echo float2nr(1.0e100)
+< 2147483647 >
+ echo float2nr(-1.0e150)
+< -2147483647 >
+ echo float2nr(1.0e-100)
+< 0
+ {only available when compiled with the |+float| feature}
+
+
+floor({expr}) *floor()*
+ Return the largest integral value less than or equal to
+ {expr} as a |Float| (round down).
+ {expr} must evaluate to a |Float| or a |Number|.
+ Examples: >
+ echo floor(1.856)
+< 1.0 >
+ echo floor(-5.456)
+< -6.0 >
+ echo floor(4.0)
+< 4.0
+ {only available when compiled with the |+float| feature}
+
fnameescape({string}) *fnameescape()*
- Escape {string} for use as file name command argument. All
+ Escape {string} for use as file name command argument. All
characters that have a special meaning, such as '%' and '|'
are escaped with a backslash.
- For most systems the characters escaped are "". For systems
- where a backslash appears in a filename, it depends on the
- value of 'isfname'.
+ For most systems the characters escaped are
+ " \t\n*?[{`$\\%#'\"|!<". For systems where a backslash
+ appears in a filename, it depends on the value of 'isfname'.
Example: >
:let fname = 'some str%nge|name'
:exe "edit " . fnameescape(fname)
@@ -2642,7 +2830,7 @@ fnamemodify({fname}, {mods}) *fnamemodify()*
:echo fnamemodify("main.c", ":p:h")
< results in: >
/home/mool/vim/vim/src
-< Note: Environment variables and "~" don't work in {fname}, use
+< Note: Environment variables don't work in {fname}, use
|expand()| first then.
foldclosed({lnum}) *foldclosed()*
@@ -2657,7 +2845,7 @@ foldclosedend({lnum}) *foldclosedend()*
foldlevel({lnum}) *foldlevel()*
The result is a Number, which is the foldlevel of line {lnum}
- in the current buffer. For nested folds the deepest level is
+ in the current buffer. For nested folds the deepest level is
returned. If there is no fold at line {lnum}, zero is
returned. It doesn't matter if the folds are open or closed.
When used while updating folds (from 'foldexpr') -1 is
@@ -2672,7 +2860,7 @@ foldtext() Returns a String, to be displayed for a closed fold. This is
|v:foldstart|, |v:foldend| and |v:folddashes| variables.
The returned string looks like this: >
+-- 45 lines: abcdef
-< The number of dashes depends on the foldlevel. The "45" is
+< The number of dashes depends on the foldlevel. The "45" is
the number of lines in the fold. "abcdef" is the text in the
first non-blank line of the fold. Leading white space, "//"
or "/*" and the text from the 'foldmarker' and 'commentstring'
@@ -2690,7 +2878,7 @@ foldtextresult({lnum}) *foldtextresult()*
{not available when compiled without the |+folding| feature}
*foreground()*
-foreground() Move the Vim window to the foreground. Useful when sent from
+foreground() Move the Vim window to the foreground. Useful when sent from
a client to a Vim server. |remote_send()|
On Win32 systems this might not work, the OS does not always
allow a window to bring itself to the foreground. Use
@@ -2793,7 +2981,7 @@ getchar([expr]) *getchar()*
|v:mouse_lnum| and |v:mouse_win|. This example positions the
mouse as it would normally happen: >
let c = getchar()
- if c == "\<LeftMouse>" && v:mouse_win > 0
+ if c == "\<LeftMouse>" && v:mouse_win > 0
exe v:mouse_win . "wincmd w"
exe v:mouse_lnum
exe "normal " . v:mouse_col . "|"
@@ -2831,7 +3019,7 @@ getcharmod() *getcharmod()*
64 mouse quadruple click
128 Macintosh only: command
Only the modifiers that have not been included in the
- character itself are obtained. Thus Shift-a results in "A"
+ character itself are obtained. Thus Shift-a results in "A"
with no modifier.
getcmdline() *getcmdline()*
@@ -3058,7 +3246,7 @@ getwinposx() The result is a Number, which is the X coordinate in pixels of
*getwinposy()*
getwinposy() The result is a Number, which is the Y coordinate in pixels of
- the top of the GUI Vim window. The result will be -1 if the
+ the top of the GUI Vim window. The result will be -1 if the
information is not available.
getwinvar({winnr}, {varname}) *getwinvar()*
@@ -3073,6 +3261,8 @@ glob({expr}) Expand the file wildcards in {expr}. See |wildcards| for the
The result is a String.
When there are several matches, they are separated by <NL>
characters.
+ The 'wildignore' option applies: Names matching one of the
+ patterns in 'wildignore' will be skipped.
If the expansion fails, the result is an empty string.
A name for a non-existing file is not included.
@@ -3081,7 +3271,7 @@ glob({expr}) Expand the file wildcards in {expr}. See |wildcards| for the
:let tagfiles = glob("`find . -name tags -print`")
:let &tags = substitute(tagfiles, "\n", ",", "g")
< The result of the program inside the backticks should be one
- item per line. Spaces inside an item are allowed.
+ item per line. Spaces inside an item are allowed.
See |expand()| for expanding special Vim variables. See
|system()| for getting the raw output of an external command.
@@ -3119,7 +3309,7 @@ has_key({dict}, {key}) *has_key()*
haslocaldir() *haslocaldir()*
The result is a Number, which is 1 when the current
- window has set a local path via |:lcd|, and 0 otherwise.
+ window has set a local path via |:lcd|, and 0 otherwise.
hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()*
The result is a Number, which is 1 if there is a mapping that
@@ -3142,7 +3332,7 @@ hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()*
When {mode} is omitted, "nvo" is used.
This function is useful to check if a mapping already exists
- to a function in a Vim script. Example: >
+ to a function in a Vim script. Example: >
:if !hasmapto('\ABCdoit')
: map <Leader>d \ABCdoit
:endif
@@ -3154,7 +3344,7 @@ histadd({history}, {item}) *histadd()*
one of: *hist-names*
"cmd" or ":" command line history
"search" or "/" search pattern history
- "expr" or "=" typed expression history
+ "expr" or "=" typed expression history
"input" or "@" input line history
If {item} does already exist in the history, it will be
shifted to become the newest entry.
@@ -3171,7 +3361,7 @@ histdel({history} [, {item}]) *histdel()*
for the possible values of {history}.
If the parameter {item} is given as String, this is seen
- as regular expression. All entries matching that expression
+ as regular expression. All entries matching that expression
will be removed from the history (if there are any).
Upper/lowercase must match, unless "\c" is used |/\c|.
If {item} is a Number, it will be interpreted as index, see
@@ -3235,7 +3425,7 @@ hlID({name}) The result is a Number, which is the ID of the highlight group
with name {name}. When the highlight group doesn't exist,
zero is returned.
This can be used to retrieve information about the highlight
- group. For example, to get the background color of the
+ group. For example, to get the background color of the
"Comment" group: >
:echo synIDattr(synIDtrans(hlID("Comment")), "bg")
< *highlightID()*
@@ -3292,7 +3482,7 @@ input({prompt} [, {text} [, {completion}]]) *input()*
prompt to start a new line.
The highlighting set with |:echohl| is used for the prompt.
The input is entered just like a command-line, with the same
- editing commands and mappings. There is a separate history
+ editing commands and mappings. There is a separate history
for lines typed for input().
Example: >
:if input("Coffee or beer? ") == "beer"
@@ -3305,9 +3495,9 @@ input({prompt} [, {text} [, {completion}]]) *input()*
< The optional {completion} argument specifies the type of
completion supported for the input. Without it completion is
- not performed. The supported completion types are the same as
+ not performed. The supported completion types are the same as
that can be supplied to a user-defined command using the
- "-complete=" argument. Refer to |:command-completion| for
+ "-complete=" argument. Refer to |:command-completion| for
more information. Example: >
let fname = input("File: ", "", "file")
<
@@ -3348,12 +3538,12 @@ inputlist({textlist}) *inputlist()*
displayed, one string per line. The user will be prompted to
enter a number, which is returned.
The user can also select an item by clicking on it with the
- mouse. For the first string 0 is returned. When clicking
+ mouse. For the first string 0 is returned. When clicking
above the first item a negative number is returned. When
clicking on the prompt one more than the length of {textlist}
is returned.
Make sure {textlist} has less then 'lines' entries, otherwise
- it won't work. It's a good idea to put the entry number at
+ it won't work. It's a good idea to put the entry number at
the start of the string. And put a prompt in the first item.
Example: >
let color = inputlist(['Select color:', '1. red',
@@ -3387,7 +3577,7 @@ inputsecret({prompt} [, {text}]) *inputsecret()*
insert({list}, {item} [, {idx}]) *insert()*
Insert {item} at the start of |List| {list}.
If {idx} is specified insert {item} before the item with index
- {idx}. If {idx} is zero it goes before the first item, just
+ {idx}. If {idx} is zero it goes before the first item, just
like omitting {idx}. A negative {idx} is also possible, see
|list-index|. -1 inserts just before the last item.
Returns the resulting |List|. Examples: >
@@ -3483,7 +3673,7 @@ libcall({libname}, {funcname}, {argument})
it's then freed when the DLL is unloaded.
WARNING: If the function returns a non-valid pointer, Vim may
- crash! This also happens if the function returns a number,
+ crash! This also happens if the function returns a number,
because Vim thinks it's a pointer.
For Win32 systems, {libname} should be the filename of the DLL
without the ".DLL" suffix. A full path is only required if
@@ -3494,7 +3684,6 @@ libcall({libname}, {funcname}, {argument})
feature is present}
Examples: >
:echo libcall("libc.so", "getenv", "HOME")
- :echo libcallnr("/usr/lib/libc.so", "getpid", "")
<
*libcallnr()*
libcallnr({libname}, {funcname}, {argument})
@@ -3502,7 +3691,8 @@ libcallnr({libname}, {funcname}, {argument})
int instead of a string.
{only in Win32 on some Unix versions, when the |+libcall|
feature is present}
- Example (not very useful...): >
+ Examples: >
+ :echo libcallnr("/usr/lib/libc.so", "getpid", "")
:call libcallnr("libc.so", "printf", "Hello World!\n")
:call libcallnr("libc.so", "sleep", 10)
<
@@ -3530,7 +3720,7 @@ line({expr}) The result is a Number, which is the line number of the file
< *last-position-jump*
This autocommand jumps to the last known position in a file
just after opening it, if the '" mark is set: >
- :au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
+ :au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
line2byte({lnum}) *line2byte()*
Return the byte count from the start of the buffer for line
@@ -3558,6 +3748,16 @@ localtime() *localtime()*
1970. See also |strftime()| and |getftime()|.
+log10({expr}) *log10()*
+ Return the logarithm of Float {expr} to base 10 as a |Float|.
+ {expr} must evaluate to a |Float| or a |Number|.
+ Examples: >
+ :echo log10(1000)
+< 3.0 >
+ :echo log10(0.01)
+< -2.0
+ {only available when compiled with the |+float| feature}
+
map({expr}, {string}) *map()*
{expr} must be a |List| or a |Dictionary|.
Replace each item in {expr} with the result of evaluating
@@ -3615,7 +3815,7 @@ mapcheck({name}[, {mode} [, {abbr}]]) *mapcheck()*
A match happens with a mapping that starts with {name} and
with a mapping which is equal to the start of {name}.
- matches mapping "a" "ab" "abc" ~
+ matches mapping "a" "ab" "abc" ~
mapcheck("a") yes yes yes
mapcheck("abc") yes yes yes
mapcheck("ax") yes no no
@@ -3642,7 +3842,7 @@ match({expr}, {pat}[, {start}[, {count}]]) *match()*
When {expr} is a |List| then this returns the index of the
first item where {pat} matches. Each item is used as a
String, |Lists| and |Dictionaries| are used as echoed.
- Otherwise, {expr} is used as a String. The result is a
+ Otherwise, {expr} is used as a String. The result is a
Number, which gives the index (byte offset) in {expr} where
{pat} matches.
A match at the first character or |List| item returns zero.
@@ -3652,7 +3852,7 @@ match({expr}, {pat}[, {start}[, {count}]]) *match()*
:echo match([1, 'x'], '\a') " results in 1
< See |string-match| for how {pat} is used.
*strpbrk()*
- Vim doesn't have a strpbrk() function. But you can do: >
+ Vim doesn't have a strpbrk() function. But you can do: >
:let sepidx = match(line, '[.,;: \t]')
< *strcasestr()*
Vim doesn't have a strcasestr() function. But you can add
@@ -3689,7 +3889,7 @@ match({expr}, {pat}[, {start}[, {count}]]) *match()*
See |pattern| for the patterns that are accepted.
The 'ignorecase' option is used to set the ignore-caseness of
- the pattern. 'smartcase' is NOT used. The matching is always
+ the pattern. 'smartcase' is NOT used. The matching is always
done like 'magic' is set and 'cpoptions' is empty.
*matchadd()* *E798* *E799* *E801*
@@ -3700,7 +3900,7 @@ matchadd({group}, {pattern}[, {priority}[, {id}]])
match using |matchdelete()|.
The optional {priority} argument assigns a priority to the
- match. A match with a high priority will have its
+ match. A match with a high priority will have its
highlighting overrule that of a match with a lower priority.
A priority is specified as an integer (negative numbers are no
exception). If the {priority} argument is not specified, the
@@ -3728,7 +3928,7 @@ matchadd({group}, {pattern}[, {priority}[, {id}]])
:call matchdelete(m)
< A list of matches defined by |matchadd()| and |:match| are
- available from |getmatches()|. All matches can be deleted in
+ available from |getmatches()|. All matches can be deleted in
one operation by |clearmatches()|.
matcharg({nr}) *matcharg()*
@@ -3745,7 +3945,7 @@ matcharg({nr}) *matcharg()*
matchdelete({id}) *matchdelete()* *E802* *E803*
Deletes a match with ID {id} previously defined by |matchadd()|
- or one of the |:match| commands. Returns 0 if succesfull,
+ or one of the |:match| commands. Returns 0 if successful,
otherwise -1. See example for |matchadd()|. All matches can
be deleted in one operation by |clearmatches()|.
@@ -3779,7 +3979,7 @@ matchlist({expr}, {pat}[, {start}[, {count}]]) *matchlist()*
When there is no match an empty list is returned.
matchstr({expr}, {pat}[, {start}[, {count}]]) *matchstr()*
- Same as match(), but return the matched string. Example: >
+ Same as |match()|, but return the matched string. Example: >
:echo matchstr("testing", "ing")
< results in "ing".
When there is no match "" is returned.
@@ -3810,15 +4010,21 @@ mkdir({name} [, {path} [, {prot}]])
necessary. Otherwise it must be "".
If {prot} is given it is used to set the protection bits of
the new directory. The default is 0755 (rwxr-xr-x: r/w for
- the user readable for others). Use 0700 to make it unreadable
+ the user readable for others). Use 0700 to make it unreadable
for others.
This function is not available in the |sandbox|.
Not available on all systems. To check use: >
:if exists("*mkdir")
<
*mode()*
-mode() Return a string that indicates the current mode:
+mode([expr]) Return a string that indicates the current mode.
+ If [expr] is supplied and it evaluates to a non-zero number or
+ a non-empty string, then the full mode is returned, otherwise
+ only the first letter is returned. Note that " " and "0" are
+ also non-empty strings.
+
n Normal
+ no Operator-pending
v Visual by character
V Visual by line
CTRL-V Visual blockwise
@@ -3826,11 +4032,19 @@ mode() Return a string that indicates the current mode:
S Select by line
CTRL-S Select blockwise
i Insert
- R Replace
+ R Replace |R|
+ Rv Virtual Replace |gR|
c Command-line
+ cv Vim Ex mode |gQ|
+ ce Normal Ex mode |Q|
r Hit-enter prompt
- This is useful in the 'statusline' option. In most other
- places it always returns "c" or "n".
+ rm The -- more -- prompt
+ r? A |:confirm| query of some sort
+ ! Shell or external command is executing
+ This is useful in the 'statusline' option or when used
+ with |remote_expr()| In most other places it always returns
+ "c" or "n".
+ Also see |visualmode()|.
nextnonblank({lnum}) *nextnonblank()*
Return the line number of the first line at or below {lnum}
@@ -3854,7 +4068,8 @@ nr2char({expr}) *nr2char()*
*getpid()*
getpid() Return a Number which is the process ID of the Vim process.
- On Unix this is a unique number. On MS-DOS it's always zero.
+ On Unix and MS-Windows this is a unique number, until Vim
+ exits. On MS-DOS it's always zero.
*getpos()*
getpos({expr}) Get the position for {expr}. For possible values of {expr}
@@ -3884,6 +4099,18 @@ pathshorten({expr}) *pathshorten()*
< ~/.v/a/myfile.vim ~
It doesn't matter if the path exists or not.
+pow({x}, {y}) *pow()*
+ Return the power of {x} to the exponent {y} as a |Float|.
+ {x} and {y} must evaluate to a |Float| or a |Number|.
+ Examples: >
+ :echo pow(3, 3)
+< 27.0 >
+ :echo pow(2, 16)
+< 65536.0 >
+ :echo pow(32, 0.20)
+< 2.0
+ {only available when compiled with the |+float| feature}
+
prevnonblank({lnum}) *prevnonblank()*
Return the line number of the first line at or above {lnum}
that is not blank. Example: >
@@ -3903,15 +4130,20 @@ printf({fmt}, {expr1} ...) *printf()*
Often used items are:
%s string
%6s string right-aligned in 6 bytes
- %.9s string truncated to 9 bytes
- %c single byte
- %d decimal number
- %5d decimal number padded with spaces to 5 characters
- %x hex number
- %04x hex number padded with zeros to at least 4 characters
- %X hex number using upper case letters
- %o octal number
- %% the % character itself
+ %.9s string truncated to 9 bytes
+ %c single byte
+ %d decimal number
+ %5d decimal number padded with spaces to 5 characters
+ %x hex number
+ %04x hex number padded with zeros to at least 4 characters
+ %X hex number using upper case letters
+ %o octal number
+ %f floating point number in the form 123.456
+ %e floating point number in the form 1.234e3
+ %E floating point number in the form 1.234E3
+ %g floating point number, as %f or %e depending on value
+ %G floating point number, as %f or %E depending on value
+ %% the % character itself
Conversion specifications start with '%' and end with the
conversion type. All other characters are copied unchanged to
@@ -3952,7 +4184,7 @@ printf({fmt}, {expr1} ...) *printf()*
number produced by a signed conversion (d).
+ A sign must always be placed before a number
- produced by a signed conversion. A + overrides
+ produced by a signed conversion. A + overrides
a space if both are used.
field-width
@@ -3969,6 +4201,8 @@ printf({fmt}, {expr1} ...) *printf()*
This gives the minimum number of digits to appear for
d, o, x, and X conversions, or the maximum number of
bytes to be printed from a string for s conversions.
+ For floating point it is the number of digits after
+ the decimal point.
type
A character that specifies the type of conversion to
@@ -3976,7 +4210,7 @@ printf({fmt}, {expr1} ...) *printf()*
A field width or precision, or both, may be indicated by an
asterisk '*' instead of a digit string. In this case, a
- Number argument supplies the field width or precision. A
+ Number argument supplies the field width or precision. A
negative field width is treated as a left adjustment flag
followed by a positive field width; a negative precision is
treated as though it were missing. Example: >
@@ -3986,7 +4220,8 @@ printf({fmt}, {expr1} ...) *printf()*
The conversion specifiers and their meanings are:
- doxX The Number argument is converted to signed decimal
+ *printf-d* *printf-o* *printf-x* *printf-X*
+ doxX The Number argument is converted to signed decimal
(d), unsigned octal (o), or unsigned hexadecimal (x
and X) notation. The letters "abcdef" are used for
x conversions; the letters "ABCDEF" are used for X
@@ -4000,18 +4235,50 @@ printf({fmt}, {expr1} ...) *printf()*
a conversion is wider than the field width, the field
is expanded to contain the conversion result.
+ *printf-c*
c The Number argument is converted to a byte, and the
resulting character is written.
+ *printf-s*
s The text of the String argument is used. If a
precision is specified, no more bytes than the number
specified are used.
+ *printf-f* *E807*
+ f The Float argument is converted into a string of the
+ form 123.456. The precision specifies the number of
+ digits after the decimal point. When the precision is
+ zero the decimal point is omitted. When the precision
+ is not specified 6 is used. A really big number
+ (out of range or dividing by zero) results in "inf".
+ "0.0 / 0.0" results in "nan".
+ Example: >
+ echo printf("%.2f", 12.115)
+< 12.12
+ Note that roundoff depends on the system libraries.
+ Use |round()| when in doubt.
+
+ *printf-e* *printf-E*
+ e E The Float argument is converted into a string of the
+ form 1.234e+03 or 1.234E+03 when using 'E'. The
+ precision specifies the number of digits after the
+ decimal point, like with 'f'.
+
+ *printf-g* *printf-G*
+ g G The Float argument is converted like with 'f' if the
+ value is between 0.001 (inclusive) and 10000000.0
+ (exclusive). Otherwise 'e' is used for 'g' and 'E'
+ for 'G'. When no precision is specified superfluous
+ zeroes and '+' signs are removed, except for the zero
+ immediately after the decimal point. Thus 10000000.0
+ results in 1.0e7.
+
+ *printf-%*
% A '%' is written. No argument is converted. The
complete conversion specification is "%%".
Each argument can be Number or String and is converted
- automatically to fit the conversion specifier. Any other
+ automatically to fit the conversion specifier. Any other
argument type results in an error message.
*E766* *E767*
@@ -4105,7 +4372,7 @@ reltimestr({time}) *reltimestr()*
*remote_expr()* *E449*
remote_expr({server}, {string} [, {idvar}])
- Send the {string} to {server}. The string is sent as an
+ Send the {string} to {server}. The string is sent as an
expression and the result is returned after evaluation.
The result must be a String or a |List|. A |List| is turned
into a String by joining the items with a line break in
@@ -4140,7 +4407,7 @@ remote_foreground({server}) *remote_foreground()*
remote_peek({serverid} [, {retvar}]) *remote_peek()*
Returns a positive number if there are available strings
from {serverid}. Copies any reply string into the variable
- {retvar} if specified. {retvar} must be a string with the
+ {retvar} if specified. {retvar} must be a string with the
name of a variable.
Returns zero if none are available.
Returns -1 if something is wrong.
@@ -4162,7 +4429,7 @@ remote_read({serverid}) *remote_read()*
<
*remote_send()* *E241*
remote_send({server}, {string} [, {idvar}])
- Send the {string} to {server}. The string is sent as input
+ Send the {string} to {server}. The string is sent as input
keys and the function returns immediately. At the Vim server
the keys are not mapped |:map|.
If {idvar} is present, it is taken as the name of a variable
@@ -4213,7 +4480,7 @@ repeat({expr}, {count}) *repeat()*
:let separator = repeat('-', 80)
< When {count} is zero or negative the result is empty.
When {expr} is a |List| the result is {expr} concatenated
- {count} times. Example: >
+ {count} times. Example: >
:let longlist = repeat(['a', 'b'], 3)
< Results in ['a', 'b', 'a', 'b', 'a', 'b'].
@@ -4232,18 +4499,33 @@ resolve({filename}) *resolve()* *E655*
path name) and also keeps a trailing path separator.
*reverse()*
-reverse({list}) Reverse the order of items in {list} in-place. Returns
+reverse({list}) Reverse the order of items in {list} in-place. Returns
{list}.
If you want a list to remain unmodified make a copy first: >
:let revlist = reverse(copy(mylist))
+round({expr}) *round()*
+ Round off {expr} to a the nearest integral value and return it
+ as a |Float|. If {expr} lies halfway between two integral
+ values, then use the larger one (away from zero).
+ {expr} must evaluate to a |Float| or a |Number|.
+ Examples: >
+ echo round(0.456)
+< 0.0 >
+ echo round(4.5)
+< 5.0 >
+ echo round(-4.5)
+< -5.0
+ {only available when compiled with the |+float| feature}
+
+
search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()*
Search for regexp pattern {pattern}. The search starts at the
cursor position (you can use |cursor()| to set it).
{flags} is a String, which can contain these character flags:
'b' search backward instead of forward
- 'c' accept a match at the cursor position
+ 'c' accept a match at the cursor position
'e' move to the End of the match
'n' do Not move the cursor
'p' return number of matching sub-pattern (see below)
@@ -4268,7 +4550,7 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()*
A zero value is equal to not giving the argument.
When the {timeout} argument is given the search stops when
- more than this many milli seconds have passed. Thus when
+ more than this many milli seconds have passed. Thus when
{timeout} is 500 the search stops after half a second.
The value must not be negative. A zero value is like not
giving the argument.
@@ -4295,7 +4577,7 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()*
: normal G$
: let flags = "w"
: while search("foo", flags) > 0
- : s/foo/bar/g
+ : s/foo/bar/g
: let flags = "W"
: endwhile
: update " write the file if modified
@@ -4358,9 +4640,11 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip}
{flags} 'b', 'c', 'n', 's', 'w' and 'W' are used like with
|search()|. Additionally:
'r' Repeat until no more matches found; will find the
- outer pair
- 'm' return number of Matches instead of line number with
+ outer pair. Implies the 'W' flag.
+ 'm' Return number of matches instead of line number with
the match; will be > 1 when 'r' is used.
+ Note: it's nearly always a good idea to use the 'W' flag, to
+ avoid wrapping around the end of the file.
When a match for {start}, {middle} or {end} is found, the
{skip} expression is evaluated with the cursor positioned on
@@ -4386,7 +4670,7 @@ searchpair({start}, {middle}, {end} [, {flags} [, {skip}
< When starting at the "if 2", with the cursor on the "i", and
searching forwards, the "endif 2" is found. When starting on
the character just before the "if 2", the "endif 1" will be
- found. That's because the "if 2" will be found first, and
+ found. That's because the "if 2" will be found first, and
then this is considered to be a nested if/endif from "if 2" to
"endif 2".
When searching backwards and {end} is more than one character,
@@ -4479,7 +4763,7 @@ setbufvar({expr}, {varname}, {val}) *setbufvar()*
setcmdpos({pos}) *setcmdpos()*
Set the cursor position in the command line to byte position
- {pos}. The first position is 1.
+ {pos}. The first position is 1.
Use |getcmdpos()| to obtain the current position.
Only works while editing the command line, thus you must use
|c_CTRL-\_e|, |c_CTRL-R_=| or |c_CTRL-R_CTRL-R| with '='. For
@@ -4492,15 +4776,15 @@ setcmdpos({pos}) *setcmdpos()*
Returns 0 when successful, 1 when not editing the command
line.
-setline({lnum}, {line}) *setline()*
- Set line {lnum} of the current buffer to {line}.
+setline({lnum}, {text}) *setline()*
+ Set line {lnum} of the current buffer to {text}.
{lnum} is used like with |getline()|.
- When {lnum} is just below the last line the {line} will be
+ When {lnum} is just below the last line the {text} will be
added as a new line.
If this succeeds, 0 is returned. If this fails (most likely
because {lnum} is invalid) 1 is returned. Example: >
:call setline(5, strftime("%c"))
-< When {line} is a |List| then line {lnum} and following lines
+< When {text} is a |List| then line {lnum} and following lines
will be set to the items in the list. Example: >
:call setline(5, ['aaa', 'bbb', 'ccc'])
< This is equivalent to: >
@@ -4519,7 +4803,7 @@ setloclist({nr}, {list} [, {action}]) *setloclist()*
setmatches({list}) *setmatches()*
Restores a list of matches saved by |getmatches()|. Returns 0
- if succesfull, otherwise -1. All current matches are cleared
+ if successful, otherwise -1. All current matches are cleared
before the list is restored. See example for |getmatches()|.
*setpos()*
@@ -4531,7 +4815,7 @@ setpos({expr}, {list})
{list} must be a |List| with four numbers:
[bufnum, lnum, col, off]
- "bufnum" is the buffer number. Zero can be used for the
+ "bufnum" is the buffer number. Zero can be used for the
current buffer. Setting the cursor is only possible for
the current buffer. To set a mark in another buffer you can
use the |bufnr()| function to turn a file name into a buffer
@@ -4562,9 +4846,9 @@ setqflist({list} [, {action}]) *setqflist()*
item can contain the following entries:
bufnr buffer number; must be the number of a valid
- buffer
+ buffer
filename name of a file; only used when "bufnr" is not
- present or it is invalid.
+ present or it is invalid.
lnum line number in the file
pattern search pattern used to locate the error
col column number
@@ -4688,6 +4972,17 @@ simplify({filename}) *simplify()*
links before simplifying the path name, use |resolve()|.
+sin({expr}) *sin()*
+ Return the sine of {expr}, measured in radians, as a |Float|.
+ {expr} must evaluate to a |Float| or a |Number|.
+ Examples: >
+ :echo sin(100)
+< -0.506366 >
+ :echo sin(-4.01)
+< 0.763301
+ {only available when compiled with the |+float| feature}
+
+
sort({list} [, {func}]) *sort()* *E702*
Sort the items in {list} in-place. Returns {list}. If you
want a list to remain unmodified make a copy first: >
@@ -4710,7 +5005,7 @@ sort({list} [, {func}]) *sort()* *E702*
*soundfold()*
soundfold({word})
Return the sound-folded equivalent of {word}. Uses the first
- language in 'spellang' for the current window that supports
+ language in 'spelllang' for the current window that supports
soundfolding. 'spell' must be set. When no sound folding is
possible the {word} is returned unmodified.
This can be used for making spelling suggestions. Note that
@@ -4788,6 +5083,34 @@ split({expr} [, {pattern} [, {keepempty}]]) *split()*
< The opposite function is |join()|.
+sqrt({expr}) *sqrt()*
+ Return the non-negative square root of Float {expr} as a
+ |Float|.
+ {expr} must evaluate to a |Float| or a |Number|. When {expr}
+ is negative the result is NaN (Not a Number).
+ Examples: >
+ :echo sqrt(100)
+< 10.0 >
+ :echo sqrt(-4.01)
+< nan
+ {only available when compiled with the |+float| feature}
+
+
+str2float( {expr}) *str2float()*
+ Convert String {expr} to a Float. This mostly works the same
+ as when using a floating point number in an expression, see
+ |floating-point-format|. But it's a bit more permissive.
+ E.g., "1e40" is accepted, while in an expression you need to
+ write "1.0e40".
+ Text after the number is silently ignored.
+ The decimal point is always '.', no matter what the locale is
+ set to. A comma ends the number: "12,345.67" is converted to
+ 12.0. You can strip out thousands separators with
+ |substitute()|: >
+ let f = str2float(substitute(text, ',', '', 'g'))
+< {only available when compiled with the |+float| feature}
+
+
str2nr( {expr} [, {base}]) *str2nr()*
Convert string {expr} to a number.
{base} is the conversion base, it can be 8, 10 or 16.
@@ -4839,11 +5162,12 @@ stridx({haystack}, {needle} [, {start}]) *stridx()*
*string()*
string({expr}) Return {expr} converted to a String. If {expr} is a Number,
- String or a composition of them, then the result can be parsed
- back with |eval()|.
+ Float, String or a composition of them, then the result can be
+ parsed back with |eval()|.
{expr} type result ~
String 'string'
Number 123
+ Float 123.123456 or 1.123456e8
Funcref function('name')
List [item, item]
Dictionary {key: value, key: value}
@@ -4872,7 +5196,7 @@ strpart({src}, {start}[, {len}]) *strpart()*
strpart("abcdefg", 3, 2) == "de"
strpart("abcdefg", -2, 4) == "ab"
strpart("abcdefg", 5, 4) == "fg"
- strpart("abcdefg", 3) == "defg"
+ strpart("abcdefg", 3) == "defg"
< Note: To get the first character, {start} must be 0. For
example, to get three bytes under and after the cursor: >
strpart(getline("."), col(".") - 1, 3)
@@ -4922,7 +5246,7 @@ substitute({expr}, {pat}, {sub}, {flags}) *substitute()*
See |string-match| for how {pat} is used.
And a "~" in {sub} is not replaced with the previous {sub}.
Note that some codes in {sub} have a special meaning
- |sub-replace-special|. For example, to replace something with
+ |sub-replace-special|. For example, to replace something with
"\n" (two characters), use "\\\\n" or '\\n'.
When {pat} does not match in {expr}, {expr} is returned
unmodified.
@@ -4944,7 +5268,7 @@ synID({lnum}, {col}, {trans}) *synID()*
line. 'synmaxcol' applies, in a longer line zero is returned.
When {trans} is non-zero, transparent items are reduced to the
- item that they reveal. This is useful when wanting to know
+ item that they reveal. This is useful when wanting to know
the effective color. When {trans} is zero, the transparent
item is returned. This is useful when wanting to know which
syntax item is effective (e.g. inside parens).
@@ -4959,7 +5283,7 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()*
syntax ID {synID}. This can be used to obtain information
about a syntax item.
{mode} can be "gui", "cterm" or "term", to get the attributes
- for that mode. When {mode} is omitted, or an invalid value is
+ for that mode. When {mode} is omitted, or an invalid value is
used, the attributes for the currently active highlighting are
used (GUI, cterm or term).
Use synIDtrans() to follow linked highlight groups.
@@ -5118,7 +5442,7 @@ taglist({expr}) *taglist()*
tempname() *tempname()* *temp-file-name*
The result is a String, which is the name of a file that
- doesn't exist. It can be used for a temporary file. The name
+ doesn't exist. It can be used for a temporary file. The name
is different for at least 26 consecutive calls. Example: >
:let tmpfile = tempname()
:exe "redir > " . tmpfile
@@ -5153,6 +5477,19 @@ tr({src}, {fromstr}, {tostr}) *tr()*
echo tr("<blob>", "<>", "{}")
< returns "{blob}"
+trunc({expr}) *trunc()*
+ Return the largest integral value with magnituted less than or
+ equal to {expr} as a |Float| (truncate towards zero).
+ {expr} must evaluate to a |Float| or a |Number|.
+ Examples: >
+ echo trunc(1.456)
+< 1.0 >
+ echo trunc(-5.456)
+< -5.0 >
+ echo trunc(4.0)
+< 4.0
+ {only available when compiled with the |+float| feature}
+
*type()*
type({expr}) The result is a Number, depending on the type of {expr}:
Number: 0
@@ -5160,15 +5497,17 @@ type({expr}) The result is a Number, depending on the type of {expr}:
Funcref: 2
List: 3
Dictionary: 4
+ Float: 5
To avoid the magic numbers it should be used this way: >
:if type(myvar) == type(0)
:if type(myvar) == type("")
:if type(myvar) == type(function("tr"))
:if type(myvar) == type([])
:if type(myvar) == type({})
+ :if type(myvar) == type(0.0)
values({dict}) *values()*
- Return a |List| with all the values of {dict}. The |List| is
+ Return a |List| with all the values of {dict}. The |List| is
in arbitrary order.
@@ -5199,8 +5538,8 @@ virtcol({expr}) *virtcol()*
Examples: >
virtcol(".") with text "foo^Lbar", with cursor on the "^L", returns 5
virtcol("$") with text "foo^Lbar", returns 9
- virtcol("'t") with text " there", with 't at 'h', returns 6
-< The first column is 1. 0 is returned for an error.
+ virtcol("'t") with text " there", with 't at 'h', returns 6
+< The first column is 1. 0 is returned for an error.
A more advanced example that echoes the maximum length of
all lines: >
echo max(map(range(1, line('$')), "virtcol([v:val, '$'])"))
@@ -5218,10 +5557,12 @@ visualmode([expr]) *visualmode()*
< This enters the same Visual mode as before. It is also useful
in scripts if you wish to act differently depending on the
Visual mode that was used.
+ If Visual mode is active, use |mode()| to get the Visual mode
+ (e.g., in a |:vmap|).
- If an expression is supplied that results in a non-zero number
- or a non-empty string, then the Visual mode will be cleared
- and the old value is returned. Note that " " and "0" are also
+ If [expr] is supplied and it evaluates to a non-zero number or
+ a non-empty string, then the Visual mode will be cleared and
+ the old value is returned. Note that " " and "0" are also
non-empty strings, thus cause the mode to be cleared.
*winbufnr()*
@@ -5247,7 +5588,7 @@ winheight({nr}) *winheight()*
<
*winline()*
winline() The result is a Number, which is the screen line of the cursor
- in the window. This is counting screen lines from the top of
+ in the window. This is counting screen lines from the top of
the window. The first line is one.
If the cursor was moved the view on the file will be updated
first, this may cause a scroll.
@@ -5394,6 +5735,7 @@ filterpipe When 'shelltemp' is off pipes are used for shell
read/write/filter commands
find_in_path Compiled with support for include file searches
|+find_in_path|.
+float Compiled with support for |Float|.
fname_case Case in file names matters (for Amiga, MS-DOS, and
Windows this is not present).
folding Compiled with |folding| support.
@@ -5404,6 +5746,7 @@ gui Compiled with GUI enabled.
gui_athena Compiled with Athena GUI.
gui_gtk Compiled with GTK+ GUI (any version).
gui_gtk2 Compiled with GTK+ 2 GUI (gui_gtk is also defined).
+gui_gnome Compiled with Gnome support (gui_gtk is also defined).
gui_mac Compiled with Macintosh GUI.
gui_motif Compiled with Motif GUI.
gui_photon Compiled with Photon GUI.
@@ -5435,6 +5778,7 @@ mouse_dec Compiled with support for Dec terminal mouse.
mouse_gpm Compiled with support for gpm (Linux console mouse)
mouse_netterm Compiled with support for netterm mouse.
mouse_pterm Compiled with support for qnx pterm mouse.
+mouse_sysmouse Compiled with support for sysmouse (*BSD console mouse)
mouse_xterm Compiled with support for xterm mouse.
multi_byte Compiled with support for editing Korean et al.
multi_byte_ime Compiled with support for IME input method.
@@ -5587,9 +5931,9 @@ See |:verbose-cmd| for more information.
{name} can also be a |Dictionary| entry that is a
|Funcref|: >
:function dict.init(arg)
-< "dict" must be an existing dictionary. The entry
+< "dict" must be an existing dictionary. The entry
"init" is added if it didn't exist yet. Otherwise [!]
- is required to overwrite an existing function. The
+ is required to overwrite an existing function. The
result is a |Funcref| to a numbered function. The
function can only be used with a |Funcref| and will be
deleted if there are no more references to it.
@@ -5613,12 +5957,15 @@ See |:verbose-cmd| for more information.
abort as soon as an error is detected.
When the [dict] argument is added, the function must
- be invoked through an entry in a |Dictionary|. The
+ be invoked through an entry in a |Dictionary|. The
local variable "self" will then be set to the
dictionary. See |Dictionary-function|.
+ *function-search-undo*
The last used search pattern and the redo command "."
- will not be changed by the function.
+ will not be changed by the function. This also
+ implies that the effect of |:nohlsearch| is undone
+ when the function returns.
*:endf* *:endfunction* *E126* *E193*
:endf[unction] The end of a function definition. Must be on a line
@@ -5629,7 +5976,7 @@ See |:verbose-cmd| for more information.
{name} can also be a |Dictionary| entry that is a
|Funcref|: >
:delfunc dict.init
-< This will remove the "init" entry from "dict". The
+< This will remove the "init" entry from "dict". The
function is deleted if there are no more references to
it.
*:retu* *:return* *E133*
@@ -5649,7 +5996,7 @@ See |:verbose-cmd| for more information.
returns at the outermost ":endtry".
*function-argument* *a:var*
-An argument can be defined by giving its name. In the function this can then
+An argument can be defined by giving its name. In the function this can then
be used as "a:name" ("a:" for argument).
*a:0* *a:1* *a:000* *E740* *...*
Up to 20 arguments can be given, separated by commas. After the named
@@ -5721,7 +6068,7 @@ This function can then be called with: >
itself, the function is executed for each line in the range,
with the cursor in the first column of that line. The cursor
is left at the last line (possibly moved by the last function
- call). The arguments are re-evaluated for each line. Thus
+ call). The arguments are re-evaluated for each line. Thus
this works:
*function-range-example* >
:function Mynumber(arg)
@@ -5766,7 +6113,7 @@ This is introduced in the user manual, section |41.14|.
The autocommand is useful if you have a plugin that is a long Vim script file.
You can define the autocommand and quickly quit the script with |:finish|.
-That makes Vim startup faster. The autocommand should then load the same file
+That makes Vim startup faster. The autocommand should then load the same file
again, setting a variable to skip the |:finish| command.
Use the FuncUndefined autocommand event with a pattern that matches the
@@ -5827,7 +6174,7 @@ function, the script will be sourced every time you try to call the function.
And you will get an error message every time.
Also note that if you have two script files, and one calls a function in the
-other and vise versa, before the used function is defined, it won't work.
+other and vice versa, before the used function is defined, it won't work.
Avoid using the autoload functionality at the toplevel.
Hint: If you distribute a bunch of scripts you can pack them together with the
@@ -5848,7 +6195,7 @@ name. So in the above example, if the variable "adjective" was set to
"adjective" was set to "quiet", then it would be to "my_quiet_variable".
One application for this is to create a set of variables governed by an option
-value. For example, the statement >
+value. For example, the statement >
echo my_{&background}_message
would output the contents of "my_dark_message" or "my_light_message" depending
@@ -5888,8 +6235,11 @@ This would call the function "my_func_whizz(parameter)".
{expr1}. {var-name} must refer to a list and {idx}
must be a valid index in that list. For nested list
the index can be repeated.
- This cannot be used to add an item to a list.
-
+ This cannot be used to add an item to a |List|.
+ This cannot be used to set a byte in a String. You
+ can do that like this: >
+ :let var = var[0:2] . 'X' . var[4:]
+<
*E711* *E719*
:let {var-name}[{idx1}:{idx2}] = {expr1} *E708* *E709* *E710*
Set a sequence of items in a |List| to the result of
@@ -5931,7 +6281,7 @@ This would call the function "my_func_whizz(parameter)".
that would match everywhere.
:let @{reg-name} .= {expr1}
- Append {expr1} to register {reg-name}. If the
+ Append {expr1} to register {reg-name}. If the
register was empty it's like setting it to {expr1}.
:let &{option-name} = {expr1} *:let-option* *:let-&*
@@ -6006,7 +6356,7 @@ This would call the function "my_func_whizz(parameter)".
Like above, but append/add/subtract the value for each
|List| item.
*E106*
-:let {var-name} .. List the value of variable {var-name}. Multiple
+:let {var-name} .. List the value of variable {var-name}. Multiple
variable names may be given. Special names recognized
here: *E738*
g: global variables
@@ -6150,7 +6500,7 @@ This would call the function "my_func_whizz(parameter)".
:for item in copy(mylist)
< When not making a copy, Vim stores a reference to the
next item in the list, before executing the commands
- with the current item. Thus the current item can be
+ with the current item. Thus the current item can be
removed without effect. Removing any later item means
it will not be found. Thus the following example
works (an inefficient way to make a list empty): >
@@ -6356,7 +6706,7 @@ This would call the function "my_func_whizz(parameter)".
message in the |message-history|. When used in a
script or function the line number will be added.
Spaces are placed between the arguments as with the
- :echo command. When used inside a try conditional,
+ :echo command. When used inside a try conditional,
the message is raised as an error exception instead
(see |try-echoerr|).
Example: >
@@ -6368,7 +6718,7 @@ This would call the function "my_func_whizz(parameter)".
*:exe* *:execute*
:exe[cute] {expr1} .. Executes the string that results from the evaluation
of {expr1} as an Ex command. Multiple arguments are
- concatenated, with a space in between. {expr1} is
+ concatenated, with a space in between. {expr1} is
used as the processed command, command line editing
keys are not recognized.
Cannot be followed by a comment.
@@ -6386,6 +6736,11 @@ This would call the function "my_func_whizz(parameter)".
:execute "normal ixxx\<Esc>"
< This has an <Esc> character, see |expr-string|.
+ Be careful to correctly escape special characters in
+ file names. The |fnameescape()| function can be used
+ for this. Example: >
+ :execute "e " . fnameescape(filename)
+<
Note: The executed string may be any command-line, but
you cannot start or end a "while", "for" or "if"
command. Thus this is illegal: >
@@ -6428,21 +6783,21 @@ which must not be followed by any catch clauses. The lines before the catch
clauses and the finally clause is called a try block. >
:try
- : ...
- : ... TRY BLOCK
- : ...
+ : ...
+ : ... TRY BLOCK
+ : ...
:catch /{pattern}/
- : ...
- : ... CATCH CLAUSE
- : ...
+ : ...
+ : ... CATCH CLAUSE
+ : ...
:catch /{pattern}/
- : ...
- : ... CATCH CLAUSE
- : ...
+ : ...
+ : ... CATCH CLAUSE
+ : ...
:finally
- : ...
- : ... FINALLY CLAUSE
- : ...
+ : ...
+ : ... FINALLY CLAUSE
+ : ...
:endtry
The try conditional allows to watch code for exceptions and to take the
@@ -6467,14 +6822,14 @@ the finally clause. It is resumed at the ":endtry", so that commands after
the ":endtry" are not executed and the exception might be caught elsewhere,
see |try-nesting|.
When during execution of a catch clause another exception is thrown, the
-remaining lines in that catch clause are not executed. The new exception is
+remaining lines in that catch clause are not executed. The new exception is
not matched against the patterns in any of the ":catch" commands of the same
try conditional and none of its catch clauses is taken. If there is, however,
a finally clause, it is executed, and the exception pends during its
execution. The commands following the ":endtry" are not executed. The new
exception might, however, be caught elsewhere, see |try-nesting|.
When during execution of the finally clause (if present) an exception is
-thrown, the remaining lines in the finally clause are skipped. If the finally
+thrown, the remaining lines in the finally clause are skipped. If the finally
clause has been taken because of an exception from the try block or one of the
catch clauses, the original (pending) exception is discarded. The commands
following the ":endtry" are not executed, and the exception from the finally
@@ -6508,7 +6863,7 @@ catch an exception thrown in its try block or throws a new exception from one
of its catch clauses or its finally clause, the outer try conditional is
checked according to the rules above. If the inner try conditional is in the
try block of the outer try conditional, its catch clauses are checked, but
-otherwise only the finally clause is executed. It does not matter for
+otherwise only the finally clause is executed. It does not matter for
nesting, whether the inner try conditional is directly contained in the outer
one, or whether the outer one sources a script or calls a function containing
the inner try conditional.
@@ -6571,7 +6926,7 @@ executed. >
however displays "in Bar" and throws 4711.
Any other command that takes an expression as argument might also be
-abandoned by an (uncaught) exception during the expression evaluation. The
+abandoned by an (uncaught) exception during the expression evaluation. The
exception is then propagated to the caller of the command.
Example: >
@@ -6748,20 +7103,20 @@ the original error exception value, you can use the |:echoerr| command: >
This code displays
- Vim(echoerr):Vim:E492: Not an editor command: asdf ~
+ Vim(echoerr):Vim:E492: Not an editor command: asdf ~
CLEANUP CODE *try-finally*
Scripts often change global settings and restore them at their end. If the
user however interrupts the script by pressing CTRL-C, the settings remain in
-an inconsistent state. The same may happen to you in the development phase of
+an inconsistent state. The same may happen to you in the development phase of
a script when an error occurs or you explicitly throw an exception without
catching it. You can solve these problems by using a try conditional with
a finally clause for restoring the settings. Its execution is guaranteed on
normal control flow, on error, on an explicit ":throw", and on interrupt.
(Note that errors and interrupts from inside the try conditional are converted
-to exceptions. When not caught, they terminate the script after the finally
+to exceptions. When not caught, they terminate the script after the finally
clause has been executed.)
Example: >
@@ -6819,7 +7174,7 @@ This displays "first", "cleanup", "second", "cleanup", and "end". >
:echo Foo() "returned by Foo"
This displays "cleanup" and "4711 returned by Foo". You don't need to add an
-extra ":return" in the finally clause. (Above all, this would override the
+extra ":return" in the finally clause. (Above all, this would override the
return value.)
*except-from-finally*
@@ -6863,7 +7218,7 @@ or >
Vim:{errmsg}
{cmdname} is the name of the command that failed; the second form is used when
-the command name is not known. {errmsg} is the error message usually produced
+the command name is not known. {errmsg} is the error message usually produced
when the error occurs outside try conditionals. It always begins with
a capital "E", followed by a two or three-digit error number, a colon, and
a space.
@@ -6968,7 +7323,7 @@ This works also when a try conditional is active.
CATCHING INTERRUPTS *catch-interrupt*
When there are active try conditionals, an interrupt (CTRL-C) is converted to
-the exception "Vim:Interrupt". You can catch it like every exception. The
+the exception "Vim:Interrupt". You can catch it like every exception. The
script is not terminated, then.
Example: >
@@ -7002,7 +7357,7 @@ script is not terminated, then.
:endwhile
You can interrupt a task here by pressing CTRL-C; the script then asks for
-a new command. If you press CTRL-C at the prompt, the script is terminated.
+a new command. If you press CTRL-C at the prompt, the script is terminated.
For testing what happens when CTRL-C would be pressed on a specific line in
your script, use the debug mode and execute the |>quit| or |>interrupt|
@@ -7159,7 +7514,7 @@ For some commands, the normal action can be replaced by a sequence of
autocommands. Exceptions from that sequence will be catchable by the caller
of the command.
Example: For the ":write" command, the caller cannot know whether the file
-had actually been written when the exception occurred. You need to tell it in
+had actually been written when the exception occurred. You need to tell it in
some way. >
:if !exists("cnt")
@@ -7255,7 +7610,7 @@ parentheses can be cut out from |v:exception| with the ":substitute" command.
:
:function! Write(file)
: try
- : execute "write" a:file
+ : execute "write" fnameescape(a:file)
: catch /^Vim(write):/
: throw "EXCEPT:IO(" . getcwd() . ", " . a:file . "):WRITEERR"
: endtry
@@ -7307,8 +7662,8 @@ or ":endif". On the other hand, errors should be catchable as exceptions
This problem has been solved by converting errors to exceptions and using
immediate abortion (if not suppressed by ":silent!") only when a try
-conditional is active. This is no restriction since an (error) exception can
-be caught only from an active try conditional. If you want an immediate
+conditional is active. This is no restriction since an (error) exception can
+be caught only from an active try conditional. If you want an immediate
termination without catching the error, just use a try conditional without
catch clause. (You can cause cleanup code being executed before termination
by specifying a finally clause.)
@@ -7323,8 +7678,8 @@ conditional of a new script, you might change the control flow of the existing
script on error. You get the immediate abortion on error and can catch the
error in the new script. If however the sourced script suppresses error
messages by using the ":silent!" command (checking for errors by testing
-|v:errmsg| if appropriate), its execution path is not changed. The error is
-not converted to an exception. (See |:silent|.) So the only remaining cause
+|v:errmsg| if appropriate), its execution path is not changed. The error is
+not converted to an exception. (See |:silent|.) So the only remaining cause
where this happens is for scripts that don't care about errors and produce
error messages. You probably won't want to use such code from your new
scripts.
@@ -7476,18 +7831,18 @@ code can be used: >
silent scriptnames
redir END
- " Split the output into lines and parse each line. Add an entry to the
+ " Split the output into lines and parse each line. Add an entry to the
" "scripts" dictionary.
let scripts = {}
for line in split(scriptnames_output, "\n")
" Only do non-blank lines.
if line =~ '\S'
" Get the first number in the line.
- let nr = matchstr(line, '\d\+')
+ let nr = matchstr(line, '\d\+')
" Get the file name, remove the script number " 123: ".
- let name = substitute(line, '.\+:\s*', '', '')
+ let name = substitute(line, '.\+:\s*', '', '')
" Add an item to the Dictionary
- let scripts[nr] = name
+ let scripts[nr] = name
endif
endfor
unlet scriptnames_output
@@ -7518,7 +7873,7 @@ missing: >
The 'foldexpr', 'includeexpr', 'indentexpr', 'statusline' and 'foldtext'
options are evaluated in a sandbox. This means that you are protected from
these expressions having nasty side effects. This gives some safety for when
-these options are set from a modeline. It is also used when the command from
+these options are set from a modeline. It is also used when the command from
a tags file is executed and for CTRL-R = in the command line.
The sandbox is also used for the |:sandbox| command.
@@ -7556,7 +7911,7 @@ option will still be marked as it was set in the sandbox.
In a few situations it is not allowed to change the text in the buffer, jump
to another window and some other things that might confuse or break what Vim
is currently doing. This mostly applies to things that happen when Vim is
-actually doing something else. For example, evaluating the 'balloonexpr' may
+actually doing something else. For example, evaluating the 'balloonexpr' may
happen any moment the mouse cursor is resting at some position.
This is not allowed when the textlock is active:
diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt
index fd71db9d..c8140939 100644
--- a/runtime/doc/fold.txt
+++ b/runtime/doc/fold.txt
@@ -1,4 +1,4 @@
-*fold.txt* For Vim version 7.1. Last change: 2007 May 11
+*fold.txt* For Vim version 7.2a. Last change: 2007 May 11
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/gui_x11.txt b/runtime/doc/gui_x11.txt
index 9ff6177b..457d2ccf 100644
--- a/runtime/doc/gui_x11.txt
+++ b/runtime/doc/gui_x11.txt
@@ -1,4 +1,4 @@
-*gui_x11.txt* For Vim version 7.1. Last change: 2006 Jul 12
+*gui_x11.txt* For Vim version 7.2a. Last change: 2007 Dec 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -426,7 +426,7 @@ means in detail:
- The session file is stored to a separate directory (usually $HOME/.gnome2).
- 'sessionoptions' is ignored, and a hardcoded set of appropriate flags is
used instead: >
- blank,curdir,folds,globals,help,options,winsize
+ blank,curdir,folds,globals,help,options,tabpages,winsize
- The internal variable |v:this_session| is not changed when storing the
session. Also, it is restored to its old value when logging in again.
diff --git a/runtime/doc/help.txt b/runtime/doc/help.txt
index 5bc8800e..5cad2bf2 100644
--- a/runtime/doc/help.txt
+++ b/runtime/doc/help.txt
@@ -1,4 +1,4 @@
-*help.txt* For Vim version 7.1. Last change: 2006 Nov 07
+*help.txt* For Vim version 7.2a. Last change: 2008 Jun 21
VIM - main help file
k
@@ -143,7 +143,7 @@ Special issues ~
|farsi.txt| Farsi (Persian) editing
|hebrew.txt| Hebrew language support and editing
|russian.txt| Russian language support and editing
-|ada.txt| Ada (the programming language) support
+|ft_ada.txt| Ada (the programming language) support
|hangulin.txt| Hangul (Korean) input mode
|rileft.txt| right-to-left editing mode
diff --git a/runtime/doc/if_cscop.txt b/runtime/doc/if_cscop.txt
index c02d97e3..74480621 100644
--- a/runtime/doc/if_cscop.txt
+++ b/runtime/doc/if_cscop.txt
@@ -1,4 +1,4 @@
-*if_cscop.txt* For Vim version 7.1. Last change: 2005 Mar 29
+*if_cscop.txt* For Vim version 7.2a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Andy Kahn
diff --git a/runtime/doc/if_ruby.txt b/runtime/doc/if_ruby.txt
index 2dfe2572..c381a634 100644
--- a/runtime/doc/if_ruby.txt
+++ b/runtime/doc/if_ruby.txt
@@ -1,4 +1,4 @@
-*if_ruby.txt* For Vim version 7.1. Last change: 2006 Apr 30
+*if_ruby.txt* For Vim version 7.2a. Last change: 2006 Apr 30
VIM REFERENCE MANUAL by Shugo Maeda
diff --git a/runtime/doc/if_sniff.txt b/runtime/doc/if_sniff.txt
index c2b79470..956895d9 100644
--- a/runtime/doc/if_sniff.txt
+++ b/runtime/doc/if_sniff.txt
@@ -1,4 +1,4 @@
-*if_sniff.txt* For Vim version 7.1. Last change: 2005 Mar 29
+*if_sniff.txt* For Vim version 7.2a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL
diff --git a/runtime/doc/if_tcl.txt b/runtime/doc/if_tcl.txt
index fd954598..344592b3 100644
--- a/runtime/doc/if_tcl.txt
+++ b/runtime/doc/if_tcl.txt
@@ -1,4 +1,4 @@
-*if_tcl.txt* For Vim version 7.1. Last change: 2006 Mar 06
+*if_tcl.txt* For Vim version 7.2a. Last change: 2006 Mar 06
VIM REFERENCE MANUAL by Ingo Wilken
diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt
index 121dec17..4eabcf79 100644
--- a/runtime/doc/mbyte.txt
+++ b/runtime/doc/mbyte.txt
@@ -1,4 +1,4 @@
-*mbyte.txt* For Vim version 7.1. Last change: 2006 Aug 11
+*mbyte.txt* For Vim version 7.2a. Last change: 2008 Jun 21
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@@ -235,7 +235,7 @@ You could make a small shell script for this.
==============================================================================
3. Encoding *mbyte-encoding*
-Vim uses the 'encoding' option to specify how characters identified and
+Vim uses the 'encoding' option to specify how characters are identified and
encoded when they are used inside Vim. This applies to all the places where
text is used, including buffers (files loaded into memory), registers and
variables.
@@ -351,6 +351,8 @@ u unicode same as ucs-2
u ucs2be same as ucs-2 (big endian)
u ucs-2be same as ucs-2 (big endian)
u ucs-4be same as ucs-4 (big endian)
+u utf-32 same as ucs-4
+u utf-32le same as ucs-4le
default stands for the default value of 'encoding', depends on the
environment
@@ -966,11 +968,11 @@ WHAT IS GLOBAL IME *global-ime*
- Active Input Method Manager (Global IME)
http://msdn.microsoft.com/workshop/misc/AIMM/aimm.asp
- Support Global IME is a experimental feature.
+ Support for Global IME is an experimental feature.
NOTE: For IME to work you must make sure the input locales of your language
are added to your system. The exact location of this depends on the version
-of Windows you use. For example, on my W2P box:
+of Windows you use. For example, on my Windows 2000 box:
1. Control Panel
2. Regional Options
3. Input Locales Tab
@@ -1295,7 +1297,7 @@ Useful commands:
characters, as hex numbers.
- ":set encoding=utf-8 fileencodings=" forces using UTF-8 for all files. The
default is to use the current locale for 'encoding' and set 'fileencodings'
- to automatically the encoding of a file.
+ to automatically detect the encoding of a file.
STARTING VIM
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index a7302e92..cdeb4f92 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -1,4 +1,4 @@
-*motion.txt* For Vim version 7.1. Last change: 2006 Dec 07
+*motion.txt* For Vim version 7.2a. Last change: 2008 May 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -366,9 +366,11 @@ W [count] WORDS forward. |exclusive| motion.
*e*
e Forward to the end of word [count] |inclusive|.
+ Does not stop in an empty line.
*E*
E Forward to the end of WORD [count] |inclusive|.
+ Does not stop in an empty line.
<S-Left> or *<S-Left>* *b*
b [count] words backward. |exclusive| motion.
@@ -465,9 +467,9 @@ The definition of a sentence cannot be changed.
*paragraph*
A paragraph begins after each empty line, and also at each of a set of
paragraph macros, specified by the pairs of characters in the 'paragraphs'
-option. The default is "IPLPPPQPP LIpplpipbp", which corresponds to the
-macros ".IP", ".LP", etc. (These are nroff macros, so the dot must be in the
-first column). A section boundary is also a paragraph boundary.
+option. The default is "IPLPPPQPP TPHPLIPpLpItpplpipbp", which corresponds to
+the macros ".IP", ".LP", etc. (These are nroff macros, so the dot must be in
+the first column). A section boundary is also a paragraph boundary.
Note that a blank line (only containing white space) is NOT a paragraph
boundary.
Also note that this does not include a '{' or '}' in the first column. When
@@ -809,10 +811,6 @@ Lowercase marks 'a to 'z are remembered as long as the file remains in the
buffer list. If you remove the file from the buffer list, all its marks are
lost. If you delete a line that contains a mark, that mark is erased.
-To delete a mark: Create a new line, position the mark there, delete the line.
-E.g.: "o<Esc>mxdd". This does change the file though. Using "u" won't work,
-it also restores marks.
-
Lowercase marks can be used in combination with operators. For example: "d't"
deletes the lines from the cursor position to mark 't'. Hint: Use mark 't' for
Top, 'b' for Bottom, etc.. Lowercase marks are restored when using undo and
@@ -1173,13 +1171,15 @@ remembered.
cursor is on the # or no ([{
following)
For other items the matchit plugin can be used, see
- |matchit-install|.
+ |matchit-install|. This plugin also helps to skip
+ matches in comments.
When 'cpoptions' contains "M" |cpo-M| backslashes
before parens and braces are ignored. Without "M" the
number of backslashes matters: an even number doesn't
match with an odd number. Thus in "( \) )" and "\( (
\)" the first and last parenthesis match.
+
When the '%' character is not present in 'cpoptions'
|cpo-%|, parens and braces inside double quotes are
ignored, unless the number of parens/braces in a line
@@ -1188,8 +1188,13 @@ remembered.
are also ignored (parens and braces inside single
quotes). Note that this works fine for C, but not for
Perl, where single quotes are used for strings.
- No count is allowed ({count}% jumps to a line {count}
- percentage down the file |N%|). Using '%' on
+
+ Nothing special is done for matches in comments. You
+ can either use the matchit plugin |matchit-install| or
+ put quotes around matches.
+
+ No count is allowed, {count}% jumps to a line {count}
+ percentage down the file |N%|. Using '%' on
#if/#else/#endif makes the movement linewise.
*[(*
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 568228c6..568dab68 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.1. Last change: 2008 Feb 24
+*options.txt* For Vim version 7.2a. Last change: 2008 Jun 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -111,19 +111,31 @@ and the following arguments will be ignored.
When 'verbose' is non-zero, displaying an option value will also tell where it
was last set. Example: >
:verbose set shiftwidth cindent?
- shiftwidth=4
- Last set from modeline
- cindent
- Last set from /usr/local/share/vim/vim60/ftplugin/c.vim
-This is only done when specific option values are requested, not for ":set
-all" or ":set" without an argument.
-When the option was set by hand there is no "Last set" message. There is only
-one value for all local options with the same name. Thus the message applies
-to the option name, not necessarily its value.
+< shiftwidth=4 ~
+ Last set from modeline ~
+ cindent ~
+ Last set from /usr/local/share/vim/vim60/ftplugin/c.vim ~
+This is only done when specific option values are requested, not for ":verbose
+set all" or ":verbose set" without an argument.
+When the option was set by hand there is no "Last set" message.
When the option was set while executing a function, user command or
autocommand, the script in which it was defined is reported.
Note that an option may also have been set as a side effect of setting
'compatible'.
+A few special texts:
+ Last set from modeline ~
+ Option was set in a |modeline|.
+ Last set from --cmd argument ~
+ Option was set with command line argument |--cmd| or +.
+ Last set from -c argument ~
+ Option was set with command line argument |-c|, +, |-S| or
+ |-q|.
+ Last set from environment variable ~
+ Option was set from an environment variable, $VIMINIT,
+ $GVIMINIT or $EXINIT.
+ Last set from error handler ~
+ Option was cleared when evaluating it resulted in an error.
+
{not available when compiled without the +eval feature}
*:set-termcap* *E522*
@@ -265,7 +277,10 @@ You will not get back the 'list' value as it was the last time you edited
Without argument: Display all local option's local
values which are different from the default.
When displaying a specific local option, show the
- local value. For a global option the global value is
+ local value. For a global/local boolean option, when
+ the global value is being used, "--" is displayed
+ before the option name.
+ For a global option the global value is
shown (but that might change in the future).
{not in Vi}
@@ -797,7 +812,7 @@ A jump table for the options with a short description can be found at |Q_op|.
When 'background' is set Vim will adjust the default color groups for
the new value. But the colors used for syntax highlighting will not
- change.
+ change. *g:colors_name*
When a color scheme is loaded (the "colors_name" variable is set)
setting 'background' will cause the color scheme to be reloaded. If
the color scheme adjusts to the value of 'background' this will work.
@@ -1148,9 +1163,11 @@ A jump table for the options with a short description can be found at |Q_op|.
*'browsedir'* *'bsdir'*
'browsedir' 'bsdir' string (default: "last")
global
- {not in Vi} {only for Motif and Win32 GUI}
+ {not in Vi} {only for Motif, Athena, GTK, Mac and
+ Win32 GUI}
Which directory to use for the file browser:
- last Use same directory as with last file browser.
+ last Use same directory as with last file browser, where a
+ file was opened or saved.
buffer Use the directory of the related buffer.
current Use the current directory.
{path} Use the specified directory
@@ -1343,7 +1360,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{not available when compiled without the |+cindent|
feature}
- Enables automatic C program indenting See 'cinkeys' to set the keys
+ Enables automatic C program indenting. See 'cinkeys' to set the keys
that trigger reindenting in insert mode and 'cinoptions' to set your
preferred indent style.
If 'indentexpr' is not empty, it overrules 'cindent'.
@@ -1711,7 +1728,8 @@ A jump table for the options with a short description can be found at |Q_op|.
tabs followed by spaces as required (unless |'expandtab'| is enabled,
in which case only spaces are used). Enabling this option makes the
new line copy whatever characters were used for indenting on the
- existing line. If the new indent is greater than on the existing
+ existing line. 'expandtab' has no effect on these characters, a Tab
+ remains a Tab. If the new indent is greater than on the existing
line, the remaining space is filled in the normal manner.
NOTE: 'copyindent' is reset when 'compatible' is set.
Also see 'preserveindent'.
@@ -2423,8 +2441,8 @@ A jump table for the options with a short description can be found at |Q_op|.
global or local to buffer |global-local|
{not in Vi}
External program to use for "=" command. When this option is empty
- the internal formatting functions are used ('lisp', 'cindent' or
- 'indentexpr').
+ the internal formatting functions are used; either 'lisp', 'cindent'
+ or 'indentexpr'.
Environment variables are expanded |:set_env|. See |option-backslash|
about including spaces and backslashes.
This option cannot be set from a |modeline| or in the |sandbox|, for
@@ -3362,7 +3380,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'guitablabel' can be used to change the text in the labels.
When 'e' is missing a non-GUI tab pages line may be used.
The GUI tabs are only supported on some systems, currently
- GTK, Motif and MS-Windows.
+ GTK, Motif, Mac OS/X and MS-Windows.
*'go-f'*
'f' Foreground: Don't use fork() to detach the GUI from the shell
where it was started. Use this for programs that wait for the
@@ -3618,7 +3636,7 @@ A jump table for the options with a short description can be found at |Q_op|.
When you get bored looking at the highlighted matches, you can turn it
off with |:nohlsearch|. As soon as you use a search command, the
highlighting comes back.
- 'redrawtime' specifies the maximum time spend on finding matches.
+ 'redrawtime' specifies the maximum time spent on finding matches.
When the search pattern can match an end-of-line, Vim will try to
highlight all of the matched text. However, this depends on where the
search starts. This will be the first line in the window or the first
@@ -3917,12 +3935,13 @@ A jump table for the options with a short description can be found at |Q_op|.
local to buffer
{not in Vi}
When doing keyword completion in insert mode |ins-completion|, and
- 'ignorecase' is also on, the case of the match is adjusted. If the
- typed text contains a lowercase letter where the match has an upper
- case letter, the completed part is made lowercase. If the typed text
- has no lowercase letters and the match has a lowercase letter where
- the typed text has an uppercase letter, and there is a letter before
- it, the completed part is made uppercase.
+ 'ignorecase' is also on, the case of the match is adjusted depending
+ on the typed text. If the typed text contains a lowercase letter
+ where the match has an upper case letter, the completed part is made
+ lowercase. If the typed text has no lowercase letters and the match
+ has a lowercase letter where the typed text has an uppercase letter,
+ and there is a letter before it, the completed part is made uppercase.
+ With 'noinfercase' the match is used as-is.
*'insertmode'* *'im'* *'noinsertmode'* *'noim'*
'insertmode' 'im' boolean (default off)
@@ -3967,6 +3986,10 @@ A jump table for the options with a short description can be found at |Q_op|.
Multi-byte characters 256 and above are always included, only the
characters up to 255 are specified with this option.
For UTF-8 the characters 0xa0 to 0xff are included as well.
+ Think twice before adding white space to this option. Although a
+ space may appear inside a file name, the effect will be that Vim
+ doesn't know where a file name starts or ends when doing completion.
+ It most likely works better without a space in 'isfname'.
Note that on systems using a backslash as path separator, Vim tries to
do its best to make it work as you would expect. That is a bit
@@ -3993,7 +4016,7 @@ A jump table for the options with a short description can be found at |Q_op|.
are included. Normally these are the characters a to z and A to Z,
plus accented characters. To include '@' itself use "@-@". Examples:
"@,^a-z" All alphabetic characters, excluding lower
- case letters.
+ case ASCII letters.
"a-z,A-Z,@-@" All letters plus the '@' character.
A comma can be included by using it where a character number is
expected. Example:
@@ -4617,8 +4640,9 @@ A jump table for the options with a short description can be found at |Q_op|.
global
{not in Vi}
Enable the use of the mouse. Only works for certain terminals
- (xterm, MS-DOS, Win32 |win32-mouse|, QNX pterm, and Linux console
- with gpm). For using the mouse in the GUI, see |gui-mouse|.
+ (xterm, MS-DOS, Win32 |win32-mouse|, QNX pterm, *BSD console with
+ sysmouse and Linux console with gpm). For using the mouse in the
+ GUI, see |gui-mouse|.
The mouse can be enabled for different modes:
n Normal mode
v Visual mode
@@ -4948,6 +4972,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Note that typing <F10> in paste mode inserts "<F10>", since in paste
mode everything is inserted literally, except the 'pastetoggle' key
sequence.
+ When the value has several bytes 'ttimeoutlen' applies.
*'pex'* *'patchexpr'*
'patchexpr' 'pex' string (default "")
@@ -5054,6 +5079,8 @@ A jump table for the options with a short description can be found at |Q_op|.
enabled, in which case only spaces are used). Enabling this option
means the indent will preserve as many existing characters as possible
for indenting, and only add additional tabs or spaces as required.
+ 'expandtab' does not apply to the preserved white space, a Tab remains
+ a Tab.
NOTE: When using ">>" multiple times the resulting indent is a mix of
tabs and spaces. You might not like this.
NOTE: 'preserveindent' is reset when 'compatible' is set.
@@ -5894,6 +5921,9 @@ A jump table for the options with a short description can be found at |Q_op|.
pattern (if there is one) as possible matches. Thus, if you have
matched a C function, you can see a template for what arguments are
required (coding style permitting).
+ Note that this doesn't work well together with having "longest" in
+ 'completeopt', because the completion from the search pattern may not
+ match the typed text.
*'showmatch'* *'sm'* *'noshowmatch'* *'nosm'*
'showmatch' 'sm' boolean (default off)
@@ -6478,6 +6508,8 @@ A jump table for the options with a short description can be found at |Q_op|.
split If included, split the current window before loading
a buffer. Otherwise: do not split, use current window.
Supported in |quickfix| commands that display errors.
+ newtab Like "split", but open a new tab page. Overrules
+ "split" when both are present.
*'synmaxcol'* *'smc'*
'synmaxcol' 'smc' number (default 3000)
@@ -6602,7 +6634,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Linear searching is done anyway, for one file, when Vim finds a line
at the start of the file indicating that it's not sorted: >
- !_TAG_FILE_SORTED 0 /some command/
+ !_TAG_FILE_SORTED 0 /some comment/
< [The whitespace before and after the '0' must be a single <Tab>]
When a binary search was done and no match was found in any of the
@@ -7089,7 +7121,7 @@ A jump table for the options with a short description can be found at |Q_op|.
"xterm", when the terminal name doesn't start with "xterm", but it can
handle xterm mouse codes.
The "xterm2" value will be set if the xterm version is reported to be
- 95 of higher. This only works when compiled with the |+termresponse|
+ 95 or higher. This only works when compiled with the |+termresponse|
feature and if |t_RV| is set to the escape sequence to request the
xterm version number. Otherwise "xterm2" must be set explicitly.
If you do not want 'ttymouse' to be set to "xterm2" automatically, set
@@ -7424,6 +7456,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
Character you have to type to start wildcard expansion in the
command-line, as specified with 'wildmode'.
+ More info here: |cmdline-completion|.
The character is not recognized when used inside a macro. See
'wildcharm' for that.
Although 'wc' is a number option, you can set it to a special key: >
@@ -7441,7 +7474,7 @@ A jump table for the options with a short description can be found at |Q_op|.
you'll never actually type 'wildcharm', just use it in mappings that
automatically invoke completion mode, e.g.: >
:set wcm=<C-Z>
- :cmap ss so $vim/sessions/*.vim<C-Z>
+ :cnoremap ss so $vim/sessions/*.vim<C-Z>
< Then after typing :ss you can use CTRL-P & CTRL-N.
*'wildignore'* *'wig'*
@@ -7536,6 +7569,7 @@ A jump table for the options with a short description can be found at |Q_op|.
< List all matches without completing, then each full match >
:set wildmode=longest,list
< Complete longest common string, then list alternatives.
+ More info here: |cmdline-completion|.
*'wildoptions'* *'wop'*
'wildoptions' 'wop' string (default "")
@@ -7596,13 +7630,17 @@ A jump table for the options with a short description can be found at |Q_op|.
feature}
Minimal number of lines for the current window. This is not a hard
minimum, Vim will use fewer lines if there is not enough room. If the
- current window is smaller, its size is increased, at the cost of the
- height of other windows. Set it to 999 to make the current window
- always fill the screen (although this has the drawback that ":all"
- will create only two windows). Set it to a small number for normal
- editing.
- Minimum value is 1.
- The height is not adjusted after one of the commands to change the
+ focus goes to a window that is smaller, its size is increased, at the
+ cost of the height of other windows.
+ Set 'winheight' to a small number for normal editing.
+ Set it to 999 to make the current window fill most of the screen.
+ Other windows will be only 'winminheight' high. This has the drawback
+ that ":all" will create only two windows. To avoid "vim -o 1 2 3 4"
+ to create only two windows, set the option after startup is done,
+ using the |VimEnter| event: >
+ au VimEnter * set winheight=999
+< Minimum value is 1.
+ The height is not adjusted after one of the commands that change the
height of the current window.
'winheight' applies to the current window. Use 'winminheight' to set
the minimal height for other windows.
diff --git a/runtime/doc/os_390.txt b/runtime/doc/os_390.txt
index 1e0251be..9c7c0dcc 100644
--- a/runtime/doc/os_390.txt
+++ b/runtime/doc/os_390.txt
@@ -1,4 +1,4 @@
-*os_390.txt* For Vim version 7.1. Last change: 2005 Mar 29
+*os_390.txt* For Vim version 7.2a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Ralf Schandl
diff --git a/runtime/doc/os_mac.txt b/runtime/doc/os_mac.txt
index d0cc7803..7c88f9e4 100644
--- a/runtime/doc/os_mac.txt
+++ b/runtime/doc/os_mac.txt
@@ -1,4 +1,4 @@
-*os_mac.txt* For Vim version 7.1. Last change: 2006 Apr 30
+*os_mac.txt* For Vim version 7.2a. Last change: 2006 Apr 30
VIM REFERENCE MANUAL by Bram Moolenaar et al.
diff --git a/runtime/doc/os_msdos.txt b/runtime/doc/os_msdos.txt
index c222e9a5..6aa80724 100644
--- a/runtime/doc/os_msdos.txt
+++ b/runtime/doc/os_msdos.txt
@@ -1,4 +1,4 @@
-*os_msdos.txt* For Vim version 7.1. Last change: 2005 Mar 29
+*os_msdos.txt* For Vim version 7.2a. Last change: 2005 Mar 29
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index e880aef8..68a0299c 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -1,93 +1,99 @@
-*pi_netrw.txt* For Vim version 7.1. Last change: 2007 May 08
+*pi_netrw.txt* For Vim version 7.2a. Last change: 2008 Jun 21
-----------------------------------------------------
NETRW REFERENCE MANUAL by Charles E. Campbell, Jr.
-----------------------------------------------------
-*dav* *http* *network* *Nwrite* *netrw-file*
-*fetch* *netrw* *Nread* *rcp* *scp*
-*ftp* *netrw.vim* *Nsource* *rsync* *sftp*
+*dav* *ftp* *netrw-file* *Nread* *rcp* *scp*
+*davs* *http* *netrw.vim* *Nsource* *rsync* *sftp*
+*fetch* *netrw* *network* *Nwrite*
==============================================================================
-1. Contents *netrw-contents*
+1. Contents *netrw-contents* {{{1
1. Contents.............................................|netrw-contents|
2. Starting With Netrw..................................|netrw-start|
3. Netrw Reference......................................|netrw-ref|
- CONTROLLING EXTERNAL APPLICATIONS..................|netrw-externapp|
+ EXTERNAL APPLICATIONS AND PROTOCOLS................|netrw-externapp|
READING............................................|netrw-read|
WRITING............................................|netrw-write|
DIRECTORY LISTING..................................|netrw-dirlist|
CHANGING THE USERID AND PASSWORD...................|netrw-chgup|
- VARIABLES..........................................|netrw-variables|
+ VARIABLES AND SETTINGS.............................|netrw-variables|
PATHS..............................................|netrw-path|
4. Network-Oriented File Transfer.......................|netrw-xfer|
NETRC..............................................|netrw-netrc|
PASSWORD...........................................|netrw-passwd|
5. Activation...........................................|netrw-activate|
-6. Transparent File Transfer............................|netrw-transparent|
+6. Transparent File Editing.............................|netrw-transparent|
7. Ex Commands..........................................|netrw-ex|
8. Variables and Options................................|netrw-var|
-9. Directory Browsing...................................|netrw-browse| {{{1
- Maps...............................................|netrw-maps|
- Exploring..........................................|netrw-explore-cmds|
- Quick Reference Commands Table.....................|netrw-browse-cmds|
- Netrw Browser Variables............................|netrw-browse-var|
- Introduction To Directory Browsing.................|netrw-browse-intro|
- Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
- Directory Exploring Commands.......................|netrw-explore|
- Refreshing The Listing.............................|netrw-ctrl-l|
- Going Up...........................................|netrw--|
+9. Browsing.............................................|netrw-browse|
+ Introduction To Browsing...........................|netrw-intro-browse|
+ Quick Reference: Maps..............................|netrw-browse-maps|
+ Quick Reference: Commands..........................|netrw-browse-cmds|
+ Bookmarking A Directory............................|netrw-mb|
Browsing...........................................|netrw-cr|
- Obtaining A File...................................|netrw-O|
- Change Listing Style...............................|netrw-i|
- Making A New Directory.............................|netrw-d|
- Deleting Files Or Directories......................|netrw-D|
- Renaming Files Or Directories......................|netrw-move|
- Hiding Files Or Directories........................|netrw-a|
- Edit File Or Directory Hiding List.................|netrw-ctrl-h|
Browsing With A Horizontally Split Window..........|netrw-o|
- Browsing With A Vertically Split Window............|netrw-v|
Browsing With A New Tab............................|netrw-t|
- Preview Window.....................................|netrw-p|
- Selecting Sorting Style............................|netrw-s|
- Editing The Sorting Sequence.......................|netrw-S|
- Reversing Sorting Order............................|netrw-r|
+ Browsing With A Vertically Split Window............|netrw-v|
+ Change Listing Style...............................|netrw-i|
+ Changing To A Bookmarked Directory.................|netrw-gb|
Changing To A Predecessor Directory................|netrw-u|
Changing To A Successor Directory..................|netrw-U|
Customizing Browsing With A User Function..........|netrw-x|
+ Deleting Files Or Directories......................|netrw-D|
+ Directory Exploring Commands.......................|netrw-explore|
+ Exploring With Stars and Patterns..................|netrw-star|
+ Displaying Information About File..................|netrw-qf|
+ Edit File Or Directory Hiding List.................|netrw-ctrl-h|
+ Editing The Sorting Sequence.......................|netrw-S|
+ Going Up...........................................|netrw--|
+ Hiding Files Or Directories........................|netrw-a|
+ Improving Browsing.................................|netrw-ssh-hack|
+ Listing Bookmarks And History......................|netrw-qb|
+ Making A New Directory.............................|netrw-d|
Making The Browsing Directory The Current Directory|netrw-c|
- Bookmarking A Directory............................|netrw-mb|
- Changing To A Bookmarked Directory.................|netrw-gb|
- Listing Bookmarks And History......................|netrw-q|
- Improving Directory Browsing.......................|netrw-listhack| }}}1
+ Marking Files......................................|netrw-mf|
+ Marking Files By Regular Expression................|netrw-mr|
+ Marked Files: Arbitrary Command....................|netrw-mx|
+ Marked Files: Compression And Decompression........|netrw-mz|
+ Marked Files: Copying..............................|netrw-mc|
+ Marked Files: Diff.................................|netrw-md|
+ Marked Files: Editing..............................|netrw-me|
+ Marked Files: Grep.................................|netrw-mg|
+ Marked Files: Hiding and Unhiding by Suffix........|netrw-mh|
+ Marked Files: Moving...............................|netrw-mm|
+ Marked Files: Printing.............................|netrw-mp|
+ Marked Files: Sourcing.............................|netrw-ms|
+ Marked Files: Tagging..............................|netrw-mT|
+ Marked Files: Setting the Target Directory.........|netrw-mt|
+ Marked Files: Unmarking............................|netrw-mu|
+ Netrw Browser Variables............................|netrw-browser-var|
+ Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
+ Netrw Settings.....................................|netrw-settings|
+ Obtaining A File...................................|netrw-O|
+ Preview Window.....................................|netrw-p|
+ Previous Window....................................|netrw-P|
+ Refreshing The Listing.............................|netrw-ctrl-l|
+ Renaming Files Or Directories......................|netrw-move|
+ Reversing Sorting Order............................|netrw-r|
+ Selecting Sorting Style............................|netrw-s|
10. Problems and Fixes...................................|netrw-problems|
-11. Debugging............................................|netrw-debug|
+11. Debugging Netrw Itself...............................|netrw-debug|
12. History..............................................|netrw-history|
13. Credits..............................................|netrw-credits|
-The Netrw plugin is generally sourced automatically as it is a
-|standard-plugin|. That said, to make use of netrw, one must
-have plugins available which can be done with the following
-two lines in your <.vimrc>: >
-
- set nocp " 'compatible' is not set
- filetype plugin on " plugins are enabled
-<
-You can avoid loading this plugin by setting the "loaded_netrw" variable
-in your <.vimrc> file: >
-
- :let loaded_netrw = 1
-
{Vi does not have any of this}
==============================================================================
-2. Starting With Netrw *netrw-start*
+2. Starting With Netrw *netrw-start* {{{1
-Netrw makes reading, writing, and browsing over a network connection easy!
-First, make sure that you have plugins enabled, so you'll need to have at
-least the following in your <.vimrc>: (or see |netrw-activate|) >
+Netrw makes reading files, writing files, browsing over a network, and
+browsing locally easy! First, make sure that you have plugins enabled, so
+you'll need to have at least the following in your <.vimrc>:
+(or see |netrw-activate|) >
set nocp " 'compatible' is not set
filetype plugin on " plugins are enabled
@@ -96,14 +102,13 @@ least the following in your <.vimrc>: (or see |netrw-activate|) >
Netrw supports "transparent" editing of files on other machines using urls
(see |netrw-transparent|). As an example of this, let's assume you have an
-account on some other machine; try >
+account on some other machine; if you can use scp, try: >
vim scp://hostname/path/to/file
<
-if you have an ssh connection. Want to make ssh/scp easier to use? Check
-out |netrw-listhack|!
+Want to make ssh/scp easier to use? Check out |netrw-ssh-hack|!
-What if you have ftp, not ssh/scp? That's easy, too; try >
+So, what if you have ftp, not ssh/scp? That's easy, too; try >
vim ftp://hostname/path/to/file
<
@@ -117,7 +122,7 @@ and has lines resembling >
...
default login USERID password "PASSWORD"
<
-Now about browsing -- ie. when you just want to look around before editing a
+Now about browsing -- when you just want to look around before editing a
file. For browsing on your current host, just "edit" a directory: >
vim .
@@ -131,28 +136,49 @@ the directory name is followed by a "/"): >
<
See |netrw-browse| for more!
-There's more protocols supported than scp and ftp, too: see the next
-section, |netrw-externapp|.
+There are more protocols supported by netrw just than scp and ftp, too: see the
+next section, |netrw-externapp|, for how to use these external applications.
+
+If you want to use plugins, but for some reason don't wish to use netrw, then
+you need to avoid loading both the plugin and the autoload portions of netrw.
+You may do so by placing the following two lines in your <.vimrc>: >
+
+ :let g:loaded_netrw = 1
+ :let g:loaded_netrwPlugin = 1
+<
==============================================================================
-3. Netrw Reference *netrw-ref*
+3. Netrw Reference *netrw-ref* {{{1
-CONTROLLING EXTERNAL APPLICATIONS *netrw-externapp*
+ Netrw supports several protocols in addition to scp and ftp mentioned
+ in |netrw-start|. These include dav, fetch, http,... well, just look
+ at the list in |netrw-externapp|. Each protocol is associated with a
+ variable which holds the default command supporting that protocol.
+
+EXTERNAL APPLICATIONS AND PROTOCOLS *netrw-externapp* {{{2
Protocol Variable Default Value
-------- ---------------- -------------
dav: *g:netrw_dav_cmd* = "cadaver"
fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
ftp: *g:netrw_ftp_cmd* = "ftp"
- http: *g:netrw_http_cmd* = "curl -o" if curl is available
- http: g:netrw_http_cmd = "wget -q -O" else if wget is available
- http: g:netrw_http_cmd = "fetch -o" else if fetch is available
+ http: *g:netrw_http_cmd* = "curl -o" if curl is available
+ http: g:netrw_http_cmd = "wget -q -O" elseif wget is available
+ http: g:netrw_http_cmd = "fetch -o" elseif fetch is available
rcp: *g:netrw_rcp_cmd* = "rcp"
rsync: *g:netrw_rsync_cmd* = "rsync -a"
scp: *g:netrw_scp_cmd* = "scp -q"
sftp: *g:netrw_sftp_cmd* = "sftp"
-READING *netrw-read* *netrw-nread*
+READING *netrw-read* *netrw-nread* {{{2
+
+ Generally, one may just use the url notation with a normal editing
+ command, such as >
+
+ :e ftp://[user@]machine/path
+<
+ Netrw also provides the Nread command:
+
:Nread ? give help
:Nread "machine:path" uses rcp
:Nread "machine path" uses ftp w/ <.netrc>
@@ -166,7 +192,15 @@ READING *netrw-read* *netrw-nread*
:Nread "scp://[user@]machine[[:#]port]/path" uses scp
:Nread "sftp://[user@]machine/path" uses sftp
-WRITING *netrw-write* *netrw-nwrite*
+WRITING *netrw-write* *netrw-nwrite* {{{2
+
+ One may just use the url notation with a normal file writing
+ command, such as >
+
+ :w ftp://[user@]machine/path
+<
+ Netrw also provides the Nwrite command:
+
:Nwrite ? give help
:Nwrite "machine:path" uses rcp
:Nwrite "machine path" uses ftp w/ <.netrc>
@@ -179,7 +213,15 @@ WRITING *netrw-write* *netrw-nwrite*
:Nwrite "sftp://[user@]machine/path" uses sftp
http: not supported!
-SOURCING *netrw-source*
+SOURCING *netrw-source* {{{2
+
+ One may just use the url notation with the normal file sourcing
+ command, such as >
+
+ :so ftp://[user@]machine/path
+<
+ Netrw also provides the Nsource command:
+
:Nsource ? give help
:Nsource "dav://machine[:port]/path" uses cadaver
:Nsource "fetch://[user@]machine/path" uses fetch
@@ -190,30 +232,48 @@ SOURCING *netrw-source*
:Nsource "scp://[user@]machine[[:#]port]/path" uses scp
:Nsource "sftp://[user@]machine/path" uses sftp
-DIRECTORY LISTING *netrw-dirlist*
+DIRECTORY LISTING *netrw-dirlist* {{{2
+
+ One may browse a directory to get a listing by simply attempting to
+ edit the directory: >
+
+ :e scp://[user]@hostname/path/
+ :e ftp://[user]@hostname/path/
+<
+ For remote directories (ie. those using scp or ftp), that trailing
+ "/" is necessary (it tells netrw that its to treat it as a directory
+ to browse instead of a file to download).
+
+ However, the Nread command can also be used to accomplish this:
+
:Nread [protocol]://[user]@hostname/path/
- *netrw-login* *netrw-password*
- CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass*
+ *netrw-login* *netrw-password*
+CHANGING USERID AND PASSWORD *netrw-chgup* *netrw-userpass* {{{2
Attempts to use ftp will prompt you for a user-id and a password.
These will be saved in global variables g:netrw_uid and
- g:netrw_passwd; subsequent uses of ftp will re-use those two items to
+ s:netrw_passwd; subsequent uses of ftp will re-use those two items to
simplify the further use of ftp. However, if you need to use a
different user id and/or password, you'll want to call NetUserPass()
first. To work around the need to enter passwords, check if your ftp
supports a <.netrc> file in your home directory. Also see
|netrw-passwd| (and if you're using ssh/scp hoping to figure out how
- to not need to use passwords, look at |netrw-listhack|).
+ to not need to use passwords, look at |netrw-ssh-hack|).
:NetUserPass [uid [password]] -- prompts as needed
:call NetUserPass() -- prompts for uid and password
:call NetUserPass("uid") -- prompts for password
:call NetUserPass("uid","password") -- sets global uid and password
-VARIABLES *netrw-variables*
+NETRW VARIABLES AND SETTINGS *netrw-variables* {{{2
+(also see: |netrw-browser-var| |netrw-protocol| |netrw-settings| |netrw-var|)
-(also see: |netrw-browse-var| |netrw-protocol| |netrw-settings| |netrw-var|)
+Netrw provides a lot of variables which allow you to customize netrw to your
+preferences. One way to look at them is via the command :NetrwSettings (see
+|netrw-settings|) which will display your current netrw settings. Most such
+settings are described below, in |netrw-browser-options|, and in
+|netrw-externapp|:
*b:netrw_lastfile* last file Network-read/written retained on a per-buffer
basis (supports plain :Nw )
@@ -236,8 +296,8 @@ VARIABLES *netrw-variables*
*g:netrw_ignorenetrc* =0 (default for linux, cygwin)
=1 If you have a <.netrc> file but it doesn't work and
- you want it ignored, then set this variable as shown.
- (default for Windows + cmd.exe)
+ you want it ignored, then set this variable as
+ shown. (default for Windows + cmd.exe)
*g:netrw_menu* =0 disable netrw's menu
=1 (default) netrw's menu enabled
@@ -246,7 +306,13 @@ VARIABLES *netrw-variables*
be available (see |netrw-gx|)
*g:netrw_uid* (ftp) user-id, retained on a per-session basis
- *g:netrw_passwd* (ftp) password, retained on a per-session basis
+ *s:netrw_passwd* (ftp) password, retained on a per-session basis
+
+ *g:netrw_preview* =0 (default) preview window shown in a horizontally
+ split window
+ =1 preview window shown in a vertically split window.
+ Also affects the "previous window" (see |netrw-P|) in
+ the same way.
*g:netrw_shq* = "'" for Unix/Linux systems (ie. a single quote)
= "'" for Windows + cygwin systems (ie. a single quote)
@@ -258,6 +324,9 @@ VARIABLES *netrw-variables*
*g:netrw_scpport* = "-P" : option to use to set port for scp
*g:netrw_sshport* = "-p" : option to use to set port for ssh
+ *g:netrw_silent* =0 : transfers done normally
+ =1 : transfers done silently
+
*g:netrw_use_errorwindow* =1 : messages from netrw will use a separate one
line window. This window provides reliable
delivery of messages. (default)
@@ -279,7 +348,7 @@ VARIABLES *netrw-variables*
*g:netrw_use_nt_rcp* =0 don't use the rcp of WinNT, Win2000 and WinXP
=1 use WinNT's rcp in binary mode (default)
-PATHS *netrw-path*
+PATHS *netrw-path* {{{2
Paths to files are generally user-directory relative for most protocols.
It is possible that some protocol will make paths relative to some
@@ -288,7 +357,7 @@ associated directory, however.
example: vim scp://user@host/somefile
example: vim scp://user@host/subdir1/subdir2/somefile
<
-where "somefile" is the "user"'s home directory. If you wish to get a
+where "somefile" is in the "user"'s home directory. If you wish to get a
file using root-relative paths, use the full path:
>
example: vim scp://user@host//somefile
@@ -296,7 +365,7 @@ file using root-relative paths, use the full path:
<
==============================================================================
-4. Network-Oriented File Transfer *netrw-xfer*
+4. Network-Oriented File Transfer *netrw-xfer* {{{1
Network-oriented file transfer under Vim is implemented by a VimL-based script
(<netrw.vim>) using plugin techniques. It currently supports both reading and
@@ -312,7 +381,7 @@ FileReadCmd, BufWriteCmd) to intercept reads/writes with url-like filenames. >
ex. vim ftp://hostname/path/to/file
<
The characters preceding the colon specify the protocol to use; in the
-example, its ftp. The <netrw.vim> script then formulates a command or a
+example, it's ftp. The <netrw.vim> script then formulates a command or a
series of commands (typically ftp) which it issues to an external program
(ftp, scp, etc) which does the actual file transfer/protocol. Files are read
from/written to a temporary file (under Unix/Linux, /tmp/...) which the
@@ -364,6 +433,10 @@ additional prompting.
| dav://host/path | | cadaver |
| :Nread dav://host/path | :Nwrite dav://host/path | cadaver |
+---------------------------------+----------------------------+------------+
+ | DAV + SSL: | | |
+ | davs://host/path | | cadaver |
+ | :Nread davs://host/path | :Nwrite davs://host/path | cadaver |
+ +---------------------------------+----------------------------+------------+
| FETCH: | | |
| fetch://[user@]host/path | | |
| fetch://[user@]host:http/path | Not Available | fetch |
@@ -419,6 +492,10 @@ Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
NETRC *netrw-netrc*
+The <.netrc> file, typically located in your home directory, contains lines
+therein which map a hostname (machine name) to the user id and password you
+prefer to use with it.
+
The typical syntax for lines in a <.netrc> file is given as shown below.
Ftp under Unix usually supports <.netrc>; ftp under Windows usually doesn't.
>
@@ -433,7 +510,7 @@ password.
Since this file contains passwords, make very sure nobody else can
read this file! Most programs will refuse to use a .netrc that is
readable for others. Don't forget that the system administrator can
- still read the file!
+ still read the file! Ie. for Linux/Unix: chmod 600 .netrc
PASSWORD *netrw-passwd*
@@ -444,17 +521,19 @@ after one has set it.
Unfortunately there doesn't appear to be a way for netrw to feed a password to
scp. Thus every transfer via scp will require re-entry of the password.
-However, |netrw-listhack| can help with this problem.
+However, |netrw-ssh-hack| can help with this problem.
==============================================================================
-5. Activation *netrw-activate*
+5. Activation *netrw-activate* {{{1
Network-oriented file transfers are available by default whenever Vim's
-|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
-system's vim-plugin directory and is sourced automatically whenever you bring
-up vim. I suggest that, at a minimum, you have at least the following in your
-<.vimrc> customization file: >
+|'nocompatible'| mode is enabled. Netrw's script files reside in your
+system's plugin, autoload, and syntax directories; just the
+plugin/netrwPlugin.vim script is sourced automatically whenever you bring up
+vim. The main script in autoload/netrw.vim is only loaded when you actually
+use netrw. I suggest that, at a minimum, you have at least the following in
+your <.vimrc> customization file: >
set nocp
if version >= 600
@@ -463,11 +542,12 @@ up vim. I suggest that, at a minimum, you have at least the following in your
<
==============================================================================
-6. Transparent File Transfer *netrw-transparent*
+6. Transparent File Editing *netrw-transparent* {{{1
Transparent file transfers occur whenever a regular file read or write
-(invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made.
-Thus one may use files across networks just as simply as if they were local. >
+(invoked via an |:autocmd| for |BufReadCmd|, |BufWriteCmd|, or |SourceCmd|
+events) is made. Thus one may read, write, or source files across networks
+just as easily as if they were local files! >
vim ftp://[user@]machine/path
...
@@ -478,10 +558,10 @@ such as netrw.
==============================================================================
-7. Ex Commands *netrw-ex*
+7. Ex Commands *netrw-ex* {{{1
The usual read/write commands are supported. There are also a few
-additional commands available. Often you won't need to use Nw or
+additional commands available. Often you won't need to use Nwrite or
Nread as shown in |netrw-transparent| (ie. simply use >
:e url
:r url
@@ -489,20 +569,20 @@ Nread as shown in |netrw-transparent| (ie. simply use >
instead, as appropriate) -- see |netrw-urls|. In the explanations
below, a {netfile} is an url to a remote file.
-:[range]Nw Write the specified lines to the current
+:[range]Nw[rite] Write the specified lines to the current
file as specified in b:netrw_lastfile.
-:[range]Nw {netfile} [{netfile}]...
+:[range]Nw[rite] {netfile} [{netfile}]...
Write the specified lines to the {netfile}.
-:Nread Read the specified lines into the current
+:Nr[ead] Read the specified lines into the current
buffer from the file specified in
b:netrw_lastfile.
-:Nread {netfile} {netfile}...
+:Nr[ead] {netfile} {netfile}...
Read the {netfile} after the current line.
-:Nsource {netfile}
+:Ns[ource] {netfile}
Source the {netfile}.
To start up vim using a remote .vimrc, one may use
the following (all on one line) (tnx to Antoine Mechelynck) >
@@ -511,31 +591,33 @@ below, a {netfile} is an url to a remote file.
--cmd "source scp://HOSTNAME/.vimrc"
< *netrw-uidpass*
:call NetUserPass()
- If b:netrw_uid and b:netrw_passwd don't exist,
- this function query the user for them.
+ If g:netrw_uid and s:netrw_passwd don't exist,
+ this function will query the user for them.
:call NetUserPass("userid")
- This call will set the b:netrw_uid and, if
+ This call will set the g:netrw_uid and, if
the password doesn't exist, will query the user for it.
:call NetUserPass("userid","passwd")
- This call will set both the b:netrw_uid and b:netrw_passwd.
+ This call will set both the g:netrw_uid and s:netrw_passwd.
The user-id and password are used by ftp transfers. One may
- effectively remove the user-id and password by using ""
- strings.
+ effectively remove the user-id and password by using empty
+ strings (ie. "").
:NetrwSettings This command is described in |netrw-settings| -- used to
display netrw settings and change netrw behavior.
==============================================================================
-8. Variables and Options *netrw-options* *netrw-var*
+8. Variables and Options *netrw-options* *netrw-var* {{{1
+
+(if you're interested in the netrw browser settings, see: |netrw-browser-var|)
The <netrw.vim> script provides several variables which act as options to
-ffect <netrw.vim>'s behavior. These variables typically may be set in the
-user's <.vimrc> file:
-(also see:
-|netrw-settings| |netrw-browse-var| |netrw-protocol| |netrw-settings|) >
+affect <netrw.vim>'s file transfer behavior. These variables typically may be
+set in the user's <.vimrc> file: (see also |netrw-settings| |netrw-protocol|)
+
+>
-------------
Netrw Options
@@ -584,7 +666,7 @@ temporarily.
g:netrw_fname Holds filename being accessed >
------------------------------------------------------------
<
- *netrw-protocol*
+ *netrw-protocol*
Netrw supports a number of protocols. These protocols are invoked using the
variables listed below, and may be modified by the user.
@@ -706,297 +788,460 @@ itself:
>
==============================================================================
-9. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
-
-MAPS *netrw-maps*
- <F1>.............Help.......................................|netrw-help|
- <cr>.............Browsing...................................|netrw-cr|
- <del>............Deleting Files or Directories..............|netrw-delete|
- -................Going Up...................................|netrw--|
- a................Hiding Files or Directories................|netrw-a|
- mb...............Bookmarking a Directory....................|netrw-mb|
- gb...............Changing to a Bookmarked Directory.........|netrw-gb|
- c................Make Browsing Directory The Current Dir....|netrw-c|
- d................Make A New Directory.......................|netrw-d|
- D................Deleting Files or Directories..............|netrw-D|
- <c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
- i................Change Listing Style.......................|netrw-i|
- <c-l>............Refreshing the Listing.....................|netrw-ctrl-l|
- o................Browsing with a Horizontal Split...........|netrw-o|
- p................Preview Window.............................|netrw-p|
- q................Listing Bookmarks and History..............|netrw-q|
- r................Reversing Sorting Order....................|netrw-r|
- R................Renaming Files or Directories..............|netrw-R|
- s................Selecting Sorting Style....................|netrw-s|
- S................Editing the Sorting Sequence...............|netrw-S|
- t................Browsing with a new tab....................|netrw-t|
- u................Changing to a Predecessor Directory........|netrw-u|
- U................Changing to a Successor Directory..........|netrw-U|
- v................Browsing with a Vertical Split.............|netrw-v|
- x................Customizing Browsing.......................|netrw-x|
-
- COMMANDS *netrw-explore-cmds*
- :Explore[!] [dir] Explore directory of current file........|netrw-explore|
- :Sexplore[!] [dir] Split & Explore directory ...............|netrw-explore|
- :Hexplore[!] [dir] Horizontal Split & Explore...............|netrw-explore|
- :Vexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
- :Texplore[!] [dir] Tab & Explore............................|netrw-explore|
- :Pexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
- :Nexplore[!] [dir] Vertical Split & Explore.................|netrw-explore|
- :NetrwSettings.............................................|netrw-settings|
-
-QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
+9. Browsing *netrw-browsing* *netrw-browse* *netrw-help* {{{1
+ *netrw-browser* *netrw-dir* *netrw-list*
+
+INTRODUCTION TO BROWSING *netrw-intro-browse* {{{2
+ (Quick References: |netrw-quickmaps| |netrw-quickcoms|)
+
+Netrw supports the browsing of directories on your local system and on remote
+hosts; browsing includes listing files and directories, entering directories,
+editing files therein, deleting files/directories, making new directories,
+moving (renaming) files and directories, copying files and directories, etc.
+One may mark files and execute any system command on them! The Netrw browser
+generally implements the previous explorer's maps and commands for remote
+directories, although details (such as pertinent global variable names)
+necessarily differ. To browse a directory, simply "edit" it! >
+
+ vim /your/directory/
+ vim .
+ vim c:\your\directory\
+<
+(Related topics: |netrw-cr| |netrw-o| |netrw-p| |netrw-P| |netrw-t|
+ |netrw-mf| |netrw-mx| |netrw-D| |netrw-R| |netrw-v| )
+
+The Netrw remote file and directory browser handles two protocols: ssh and
+ftp. The protocol in the url, if it is ftp, will cause netrw also to use ftp
+in its remote browsing. Specifying any other protocol will cause it to be
+used for file transfers; but the ssh protocol will be used to do remote
+browsing.
+
+To use Netrw's remote directory browser, simply attempt to read a "file" with
+a trailing slash and it will be interpreted as a request to list a directory:
>
- ------- -----------
- Command Explanation
- ------- -----------
-< <F1> Causes Netrw to issue help
- <cr> Netrw will enter the directory or read the file |netrw-cr|
- <del> Netrw will attempt to remove the file/directory |netrw-del|
- - Makes Netrw go up one directory |netrw--|
- a Toggles between normal display, |netrw-a|
- hiding (suppress display of files matching g:netrw_list_hide)
- showing (display only files which match g:netrw_list_hide)
- mb bookmark current directory
- gb go to previous bookmarked directory
- c Make current browsing directory the current directory |netrw-c|
- d Make a directory |netrw-d|
- D Netrw will attempt to remove the file(s)/directory(ies) |netrw-D|
- <c-h> Edit file hiding list |netrw-ctrl-h|
- i Cycle between thin, long, wide, and tree listings|netrw-i|
- <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
- o Enter the file/directory under the cursor in a new browser
- window. A horizontal split is used. |netrw-o|
- O Obtain a file specified by cursor |netrw-O|
- p Preview the file |netrw-p|
- P Browse in the previously used window |netrw-P|
- q List bookmarked directories and history |netrw-q|
- r Reverse sorting order |netrw-r|
- R Rename the designed file(s)/directory(ies) |netrw-R|
- s Select sorting style: by name, time, or file size |netrw-s|
- S Specify suffix priority for name-sorting |netrw-S|
- t Enter the file/directory under the cursor in a new tab|netrw-t|
- u Change to recently-visited directory |netrw-u|
- U Change to subsequently-visited directory |netrw-U|
- v Enter the file/directory under the cursor in a new browser
- window. A vertical split is used. |netrw-v|
- x Apply a function to a file. (special browsers) |netrw-x|
+ vim [protocol]://[user@]hostname/path/
+<
+where [protocol] is typically scp or ftp. As an example, try: >
-NETRW BROWSER VARIABLES *netrw-browse-var*
+ vim ftp://ftp.home.vim.org/pub/vim/
+<
+For local directories, the trailing slash is not required. Again, because its
+easy to miss: to browse remote directories, the url must terminate with a
+slash!
+
+If you'd like to avoid entering the password repeatedly for remote directory
+listings with ssh or scp, see |netrw-ssh-hack|. To avoid password entry with
+ftp, see |netrw-netrc| (if your ftp supports it).
+
+There are several things you can do to affect the browser's display of files:
+
+ * To change the listing style, press the "i" key (|netrw-i|).
+ Currently there are four styles: thin, long, wide, and tree.
+
+ * To hide files (don't want to see those xyz~ files anymore?) see
+ |netrw-ctrl-h|.
+
+ * Press s to sort files by name, time, or size.
+
+See |netrw-browse-cmds| for all the things you can do with netrw!
+
+
+QUICK HELP *netrw-quickhelp* {{{2
+ (Use ctrl-] to select a topic)~
+ Intro to Browsing...............................|netrw-intro-browse|
+ Quick Reference: Maps.........................|netrw-quickmap|
+ Quick Reference: Commands.....................|netrw-browse-cmds|
+ Hiding
+ Edit hiding list..............................|netrw-ctrl-h|
+ Hiding Files or Directories...................|netrw-a|
+ Hiding/Unhiding by suffix.....................|netrw-mh|
+ Hiding dot-files.............................|netrw-gh|
+ Listing Style
+ Select listing style (thin/long/wide/tree)....|netrw-i|
+ Associated setting variable...................|g:netrw_liststyle|
+ Shell command used to perform listing.........|g:netrw_list_cmd|
+ Quick file info...............................|netrw-qf|
+ Sorted by
+ Select sorting style (name/time/size).........|netrw-s|
+ Editing the sorting sequence..................|netrw-S|
+ Associated setting variable...................|g:netrw_sort_sequence|
+ Reverse sorting order.........................|netrw-r|
+
+
+ *netrw-quickmap* *netrw-quickmaps*
+QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
>
- --- -----------
- Var Explanation
- --- -----------
-< *g:netrw_alto* change from above splitting to below splitting
- by setting this variable (see |netrw-o|)
- default: =&sb (see |'sb'|)
+ --- ----------------- ----
+ Map Quick Explanation Link
+ --- ----------------- ----
+< <F1> Causes Netrw to issue help
+ <cr> Netrw will enter the directory or read the file |netrw-cr|
+ <del> Netrw will attempt to remove the file/directory |netrw-del|
+ - Makes Netrw go up one directory |netrw--|
+ a Toggles between normal display, |netrw-a|
+ hiding (suppress display of files matching g:netrw_list_hide)
+ showing (display only files which match g:netrw_list_hide)
+ c Make browsing directory the current directory |netrw-c|
+ d Make a directory |netrw-d|
+ D Attempt to remove the file(s)/directory(ies) |netrw-D|
+ gb Go to previous bookmarked directory |netrw-gb|
+ gh Quick hide/unhide of dot-files |netrw-gh|
+ gi Display information on file |netrw-qf|
+ <c-h> Edit file hiding list |netrw-ctrl-h|
+ i Cycle between thin, long, wide, and tree listings |netrw-i|
+ <c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
+ mb Bookmark current directory |netrw-mb|
+ mc Copy marked files to marked-file target directory |netrw-mc|
+ md Apply diff to marked files (up to 3) |netrw-md|
+ me Place marked files on arg list and edit them |netrw-me|
+ mf Mark a file |netrw-mf|
+ mh Toggle marked file suffices' presence on hiding list |netrw-mh|
+ mm Move marked files to marked-file target directory |netrw-mm|
+ mp Print marked files |netrw-mp|
+ mr Mark files satisfying a |regexp| |netrw-mr|
+ mt Current browsing directory becomes markfile target |netrw-mt|
+ mT Apply ctags to marked files |netrw-mT|
+ mu Unmark all marked files |netrw-mu|
+ mx Apply arbitrary shell command to marked files |netrw-mx|
+ mz Compress/decompress marked files |netrw-mz|
+ o Enter the file/directory under the cursor in a new |netrw-o|
+ browser window. A horizontal split is used.
+ O Obtain a file specified by cursor |netrw-O|
+ p Preview the file |netrw-p|
+ P Browse in the previously used window |netrw-P|
+ q List bookmarked directories and history |netrw-qb|
+ r Reverse sorting order |netrw-r|
+ R Rename the designed file(s)/directory(ies) |netrw-R|
+ s Select sorting style: by name, time, or file size |netrw-s|
+ S Specify suffix priority for name-sorting |netrw-S|
+ t Enter the file/directory under the cursor in a new tab|netrw-t|
+ u Change to recently-visited directory |netrw-u|
+ U Change to subsequently-visited directory |netrw-U|
+ v Enter the file/directory under the cursor in a new |netrw-v|
+ browser window. A vertical split is used.
+ x View file with an associated program |netrw-x|
+
+ <leftmouse> (gvim only) selects word under mouse as if a <cr>
+ had been pressed (ie. edit file, change directory)
+ <middlemouse> (gvim only) same as P selecting word under mouse;
+ see |netrw-P|
+ <rightmouse> (gvim only) delete file/directory using word under
+ mouse
+ <2-leftmouse> (gvim only) when:
+ * in a netrw-selected file, AND
+ * |g:netrw_retmap| == 1 AND
+ * the user doesn't already have a <2-leftmouse> mapping
+ defined before netrw is autoloaded,
+ then a double clicked leftmouse button will return
+ to the netrw browser window.
+ <s-leftmouse> (gvim only) like mf, will mark files
+
+ *netrw-quickcom* *netrw-quickcoms*
+QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
+ :NetrwClean[!] ...........................................|netrw-clean|
+ :NetrwSettings ...........................................|netrw-settings|
+ :Explore[!] [dir] Explore directory of current file......|netrw-explore|
+ :Hexplore[!] [dir] Horizontal Split & Explore.............|netrw-explore|
+ :Nexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
+ :Pexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
+ :Rexplore Return to Explorer.....................|netrw-explore|
+ :Sexplore[!] [dir] Split & Explore directory .............|netrw-explore|
+ :Texplore[!] [dir] Tab & Explore..........................|netrw-explore|
+ :Vexplore[!] [dir] Vertical Split & Explore...............|netrw-explore|
+
+BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks* {{{2
+One may easily "bookmark" a directory by using >
- *g:netrw_altv* change from left splitting to right splitting
- by setting this variable (see |netrw-v|)
- default: =&spr (see |'spr'|)
+ {cnt}mb
+<
+Any count may be used. One may use viminfo's "!" option (|'viminfo'|) to
+retain bookmarks between vim sessions. See |netrw-gb| for how to return
+to a bookmark and |netrw-qb| for how to list them.
- *g:netrw_browse_split* when browsing, <cr> will open the file by:
- =0: re-using the same window
- =1: horizontally splitting the window first
- =2: vertically splitting the window first
- =3: open file in new tab
- *g:netrw_browsex_viewer* specify user's preference for a viewer: >
- "kfmclient exec"
- "gnome-open"
-< If >
- "-"
-< is used, then netrwFileHandler() will look for
- a script/function to handle the given
- extension. (see |netrw_filehandler|).
+BROWSING *netrw-cr* {{{2
- *g:netrw_fastbrowse* =0: slow speed browsing, never re-use
- directory listings; always obtain
- directory listings.
- =1: medium speed browsing, re-use directory
- listings only when remote browsing.
- (default value)
- =2: fast browsing, only obtains directory
- listings when the directory hasn't been
- seen before (or |netrw-ctrl-l| is used).
- Fast browsing retains old directory listing
- buffers so that they don't need to be
- re-acquired. This feature is especially
- important for remote browsing. However, if
- a file is introduced or deleted into or from
- such directories, the old directory buffer
- becomes out-of-date. One may always refresh
- such a directory listing with |netrw-ctrl-l|.
- This option gives the choice of the trade-off
- between accuracy and speed to the user.
+Browsing is simple: move the cursor onto a file or directory of interest.
+Hitting the <cr> (the return key) will select the file or directory.
+Directories will themselves be listed, and files will be opened using the
+protocol given in the original read request.
- *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
- that can show up as "directories" and "files"
- in the listing. This pattern is used to
- remove such embedded messages. By default its
- value is:
- '^total\s\+\d\+$\|
- ^Trying\s\+\d\+.*$\|
- ^KERBEROS_V\d rejected\|
- ^Security extensions not\|
- No such file\|
- : connect to address [0-9a-fA-F:]*
- : No route to host$'
+ CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes that
+ two or more spaces delimit filenames and directory names for the long and
+ wide listing formats. Thus, if your filename or directory name has two or
+ more sequential spaces embedded in it, or any trailing spaces, then you'll
+ need to use the "thin" format to select it.
- *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
- listing. Defaults:
- unix or g:netrw_cygwin set: : "ls -lF"
- otherwise "dir"
+The |g:netrw_browse_split| option, which is zero by default, may be used to
+cause the opening of files to be done in a new window or tab instead of the
+default. When the option is one or two, the splitting will be taken
+horizontally or vertically, respectively. When the option is set to three, a
+<cr> will cause the file to appear in a new tab.
- *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
- listing, sorted by size of file.
- Defaults:
- unix or g:netrw_cygwin set: : "ls -slF"
- otherwise "dir"
+When using the gui (gvim) one may select a file by pressing the <leftmouse>
+button. In addtion, if
- *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
- listing, sorted by time of last modification.
- Defaults:
- unix or g:netrw_cygwin set: : "ls -tlF"
- otherwise "dir"
+ *|g:netrw_retmap| == 1 AND (its default value is 0)
+ * in a netrw-selected file, AND
+ * the user doesn't already have a <2-leftmouse> mapping defined before
+ netrw is loaded
- *g:netrw_hide* if true, the hiding list is used
- default: =0
+then a doubly-clicked leftmouse button will return to the netrw browser
+window.
- *g:netrw_keepdir* =1 (default) keep current directory immune from
- the browsing directory.
- =0 keep the current directory the same as the
- browsing directory.
- The current browsing directory is contained in
- b:netrw_curdir (also see |netrw-c|)
+Netrw attempts to speed up browsing, especially for remote browsing where one
+may have to enter passwords, by keeping and re-using previously obtained
+directory listing buffers. The |g:netrw_fastbrowse| variable is used to
+control this behavior; one may have slow browsing (no buffer re-use), medium
+speed browsing (re-use directory buffer listings only for remote directories),
+and fast browsing (re-use directory buffer listings as often as possible).
+The price for such re-use is that when changes are made (such as new files
+are introduced into a directory), the listing may become out-of-date. One may
+always refresh directory listing buffers by pressing ctrl-L (see
+|netrw-ctrl-l|).
- *g:netrw_list_cmd* command for listing remote directories
- default: (if ssh is executable)
- "ssh HOSTNAME ls -FLa"
- *g:netrw_liststyle* Set the default listing style:
- = 0: thin listing (one file per line)
- = 1: long listing (one file per line with time
- stamp information and file size)
- = 2: wide listing (multiple files in columns)
- = 3: tree style listing
- *g:netrw_list_hide* comma separated pattern list for hiding files
- default: ""
+Related topics: |netrw-o| |netrw-p| |netrw-P| |netrw-t| |netrw-v|
+Associated setting variables: |g:netrw_browse_split| |g:netrw_fastbrowse|
+ |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
+ |g:netrw_ftp_timelist_cmd| |g:netrw_ssh_cmd|
+ |g:netrw_ssh_browse_reject| |g:netrw_use_noswf|
- *g:netrw_local_mkdir* command for making a local directory
- default: "mkdir"
- *g:netrw_local_rmdir* remove directory command (rmdir)
- default: "rmdir"
+BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz* {{{2
- *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
- listings fit on 80 column displays.
- If your screen is wider, and you have file
- or directory names longer than 32 bytes,
- you may set this option to keep listings
- columnar.
+Normally one enters a file or directory using the <cr>. However, the "o" map
+allows one to open a new window to hold the new directory listing or file. A
+horizontal split is used. (for vertical splitting, see |netrw-v|)
- *g:netrw_mkdir_cmd* command for making a remote directory
- default: "ssh USEPORT HOSTNAME mkdir"
+Normally, the o key splits the window horizontally with the new window and
+cursor at the top. To change to splitting the window horizontally with the
+new window and cursor at the bottom, have
- *g:netrw_rm_cmd* command for removing files
- default: "ssh USEPORT HOSTNAME rm"
+ let g:netrw_alto = 1
- *g:netrw_rmdir_cmd* command for removing directories
- default: "ssh USEPORT HOSTNAME rmdir"
+in your <.vimrc>. (also see |netrw-t| |netrw-v|)
- *g:netrw_rmf_cmd* command for removing softlinks
- default: "ssh USEPORT HOSTNAME rm -f"
+There is only one tree listing buffer; using "o" on a displayed subdirectory
+will split the screen, but the same buffer will be shown twice.
- *g:netrw_sort_by* sort by "name", "time", or "size"
- default: "name"
+Associated setting variables: |g:netrw_alto| |g:netrw_winsize|
- *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
- default: "normal"
- *g:netrw_sort_sequence* when sorting by name, first sort by the
- comma-separated pattern sequence
- default: '[\/]$,*,\.bak$,\.o$,\.h$,
- \.info$,\.swp$,\.obj$'
+BROWSING WITH A NEW TAB *netrw-t* {{{2
- *g:netrw_ssh_cmd* One may specify an executable command
- to use instead of ssh for remote actions
- such as listing, file removal, etc.
- default: ssh
+Normally one enters a file or directory using the <cr>. The "t" map
+allows one to open a new window hold the new directory listing or file in a
+new tab. (also see: |netrw-o| |netrw-v|)
- *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
- messages, banners, and whatnot that one doesn't
- want masquerading as "directories" and "files".
- Use this pattern to remove such embedded
- messages. By default its value is:
- '^total\s\+\d\+$'
- *g:netrw_use_noswf* netrw normally avoids writing swapfiles
- for browser buffers. However, under some
- systems this apparently is causing nasty
- ml_get errors to appear; if you're getting
- ml_get errors, try putting
- let g:netrw_use_noswf= 0
- in your .vimrc.
+BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v* {{{2
- *g:netrw_timefmt* specify format string to strftime() (%c)
- default: "%c"
+Normally one enters a file or directory using the <cr>. However, the "v" map
+allows one to open a new window to hold the new directory listing or file. A
+vertical split is used. (for horizontal splitting, see |netrw-o|)
- *g:netrw_winsize* specify initial size of new o/v windows
- default: ""
+Normally, the v key splits the window vertically with the new window and
+cursor at the left. To change to splitting the window vertically with the new
+window and cursor at the right, have
- *g:NetrwTopLvlMenu* This variable specifies the top level
- menu name; by default, its "Netrw.". If
- you wish to change this, do so in your
- .vimrc.
+ let g:netrw_altv = 1
-INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro*
+in your <.vimrc>. (also see: |netrw-o| |netrw-t|)
-Netrw supports the browsing of directories on the local system and on remote
-hosts, including listing files and directories, entering directories, editing
-files therein, deleting files/directories, making new directories, and moving
-(renaming) files and directories. The Netrw browser generally implements the
-previous explorer maps and commands for remote directories, although details
-(such as pertinent global variable names) necessarily differ.
+There is only one tree listing buffer; using "v" on a displayed subdirectory
+will split the screen, but the same buffer will be shown twice.
-The Netrw remote file and directory browser handles two protocols: ssh and
-ftp. The protocol in the url, if it is ftp, will cause netrw to use ftp
-in its remote browsing. Any other protocol will be used for file transfers,
-but otherwise the ssh protocol will be used to do remote directory browsing.
+Associated setting variable: |g:netrw_altv| |g:netrw_winsize|
-To use Netrw's remote directory browser, simply attempt to read a "file" with a
-trailing slash and it will be interpreted as a request to list a directory:
+CHANGE LISTING STYLE *netrw-i* {{{2
- vim [protocol]://[user@]hostname/path/
+The "i" map cycles between the thin, long, wide, and tree listing formats.
+
+The short listing format gives just the files' and directories' names.
+
+The long listing is either based on the "ls" command via ssh for remote
+directories or displays the filename, file size (in bytes), and the time and
+date of last modification for local directories. With the long listing
+format, netrw is not able to recognize filenames which have trailing spaces.
+Use the thin listing format for such files.
-For local directories, the trailing slash is not required.
+The wide listing format uses two or more contiguous spaces to delineate
+filenames; when using that format, netrw won't be able to recognize or use
+filenames which have two or more contiguous spaces embedded in the name or any
+trailing spaces. The thin listing format will, however, work with such files.
+This listing format is the most compact.
-If you'd like to avoid entering the password in for remote directory listings
-with ssh or scp, see |netrw-listhack|.
+The tree listing format has a top directory followed by files and directories
+preceded by a "|". One may open and close directories by pressing the <cr>
+key while atop the directory name. There is only one tree listing buffer;
+hence, using "v" or "o" on a subdirectory will only show the same buffer,
+twice.
+Associated setting variables: |g:netrw_liststyle| |g:netrw_maxfilenamelen|
+ |g:netrw_timefmt| |g:netrw_list_cmd|
-NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible*
-Netrw will not work properly with >
+CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb* {{{2
- :set acd
- :set fo=...ta...
+To change directory back to a bookmarked directory, use
+
+ {cnt}gb
+
+Any count may be used to reference any of the bookmarks. See |netrw-mb| on
+how to bookmark a directory and |netrw-qb| on how to list bookmarks.
+
+
+CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2
+
+Every time you change to a new directory (new for the current session),
+netrw will save the directory in a recently-visited directory history
+list (unless g:netrw_dirhistmax is zero; by default, it's ten). With the
+"u" map, one can change to an earlier directory (predecessor). To do
+the opposite, see |netrw-U|.
+
+
+CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
+
+With the "U" map, one can change to a later directory (successor).
+This map is the opposite of the "u" map. (see |netrw-u|) Use the
+q map to list both the bookmarks and history. (see |netrw-qb|)
+
+
+NETRW CLEAN *netrw-clean* *:NetrwClean*
+
+With :NetrwClean one may easily remove netrw from one's home directory;
+more precisely, from the first directory on your |'runtimepath'|.
+
+With :NetrwClean!, netrw will remove netrw from all directories on your
+|'runtimepath'|.
+
+With either form of the command, netrw will first ask for confirmation
+that the removal is in fact what you want to do. If netrw doesn't have
+permission to remove a file, it will issue an error message.
+
+ *netrw-gx*
+CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* {{{2
+ (also see |netrw_filehandler|)
+
+Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
+best seen with a special handler (ie. a tool provided with your computer).
+Netrw allows one to invoke such special handlers by: >
+
+ * when Exploring, hit the "x" key
+ * when editing, hit gx with the cursor atop the special filename
+< (not available if the |g:netrw_nogx| variable exists)
+
+Netrw determines which special handler by the following method:
+
+ * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
+ view files. Examples of useful settings (place into your <.vimrc>): >
+
+ :let g:netrw_browsex_viewer= "kfmclient exec"
+< or >
+ :let g:netrw_browsex_viewer= "gnome-open"
<
-If either of these options are present when browsing is attempted, netrw
-will change them by using noacd and removing the ta suboptions from the
-|'formatoptions'|.
+ If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
+ invoked first (see |netrw_filehandler|).
+
+ * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
+ * for Gnome (with gnome-open): gnome-open is used.
+ * for KDE (with kfmclient) : kfmclient is used.
+ * for Mac OS X : open is used.
+ * otherwise the netrwFileHandler plugin is used.
- *netrw-explore* *netrw-pexplore* *netrw-texplore*
- *netrw-hexplore* *netrw-sexplore* *netrw-nexplore*
- *netrw-vexplore*
-DIRECTORY EXPLORING COMMANDS
+The file's suffix is used by these various approaches to determine an
+appropriate application to use to "handle" these files. Such things as
+OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
+*.eps) can be handled.
+
+ *netrw_filehandler*
+
+The "x" map applies a function to a file, based on its extension. Of course,
+the handler function must exist for it to be called!
+>
+ Ex. mypgm.html x ->
+ NFH_html("scp://user@host/some/path/mypgm.html")
+<
+Users may write their own netrw File Handler functions to support more
+suffixes with special handling. See <plugin/netrwFileHandlers.vim> for
+examples on how to make file handler functions. As an example: >
+
+ " NFH_suffix(filename)
+ fun! NFH_suffix(filename)
+ ..do something special with filename..
+ endfun
+<
+These functions need to be defined in some file in your .vim/plugin
+(vimfiles\plugin) directory. Vim's function names may not have punctuation
+characters (except for the underscore) in them. To support suffices that
+contain such characters, netrw will first convert the suffix using the
+following table: >
+
+ @ -> AT ! -> EXCLAMATION % -> PERCENT
+ : -> COLON = -> EQUAL ? -> QUESTION
+ , -> COMMA - -> MINUS ; -> SEMICOLON
+ $ -> DOLLAR + -> PLUS ~ -> TILDE
+<
+So, for example: >
+
+ file.rcs,v -> NFH_rcsCOMMAv()
+<
+If more such translations are necessary, please send me email: >
+ NdrOchip at ScampbellPfamily.AbizM - NOSPAM
+with a request.
+
+Associated setting variable: |g:netrw_browsex_viewer|
+
+ *netrw-curdir*
+DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del* {{{2
+
+If files have not been marked with |netrw-mf|: (local marked file list)
+
+ Deleting/removing files and directories involves moving the cursor to the
+ file/directory to be deleted and pressing "D". Directories must be empty
+ first before they can be successfully removed. If the directory is a
+ softlink to a directory, then netrw will make two requests to remove the
+ directory before succeeding. Netrw will ask for confirmation before doing
+ the removal(s). You may select a range of lines with the "V" command
+ (visual selection), and then pressing "D".
+
+If files have been marked with |netrw-mf|: (local marked file list)
+
+ Marked files (and empty directories) will be deleted; again, you'll be
+ asked to confirm the deletion before it actually takes place.
+
+The |g:netrw_rm_cmd|, |g:netrw_rmf_cmd|, and |g:netrw_rmdir_cmd| variables are
+used to control the attempts to remove files and directories. The
+g:netrw_rm_cmd is used with files, and its default value is:
+
+ g:netrw_rm_cmd: ssh HOSTNAME rm
+
+The g:netrw_rmdir_cmd variable is used to support the removal of directories.
+Its default value is:
+
+ g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
+
+If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
+to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
+
+ g:netrw_rmf_cmd: ssh HOSTNAME rm -f
+
+Associated setting variable: |g:netrw_local_rmdir| |g:netrw_rm_cmd|
+ |g:netrw_rmdir_cmd| |g:netrw_ssh_cmd|
+
+
+*netrw-explore* *netrw-hexplore* *netrw-nexplore* *netrw-pexplore*
+*netrw-rexplore* *netrw-sexplore* *netrw-texplore* *netrw-vexplore*
+DIRECTORY EXPLORATION COMMANDS {{{2
:Explore[!] [dir]... Explore directory of current file *:Explore*
- :Sexplore[!] [dir]... Split&Explore directory of current file *:Sexplore*
:Hexplore[!] [dir]... Horizontal Split & Explore *:Hexplore*
- :Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
+ :Rexplore ... Return to Explorer *:Rexplore*
+ :Sexplore[!] [dir]... Split&Explore directory of current file *:Sexplore*
:Texplore [dir]... Tab & Explore *:Texplore*
+ :Vexplore[!] [dir]... Vertical Split & Explore *:Vexplore*
Used with :Explore **/pattern : (also see |netrw-starstar|)
:Nexplore............. go to next matching file *:Nexplore*
@@ -1021,32 +1266,51 @@ DIRECTORY EXPLORING COMMANDS
By default, these commands use the current file's directory. However, one
may explicitly provide a directory (path) to use.
- *netrw-starstar*
-When Explore, Sexplore, Hexplore, or Vexplore are used with a **/filepat,
-such as:
->
- :Explore **/filename_pattern
-<
-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
+The |g:netrw_winsize| variable also is used, if specified by the user, to
+size Hexplore and Vexplore windows.
+
+:Rexplore This command is a little different from the others. When one
+ edits a file, for example by pressing <cr> when atop a file in
+ a netrw browser window, :Rexplore will return the display to
+ that of the last netrw browser window. Its a command version
+ of <2-leftmouse> (which is only available under gvim and
+ cooperative terms).
+
+
+*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat*
+EXPLORING WITH STARS AND PATTERNS
+
+When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
+following four styles, Explore generates a list of files which satisfy
+the request. >
+
+ */filepat files in current directory which satisfy filepat
+ **/filepat files in current directory or below which satisfy the
+ file pattern
+ *//pattern files in the current directory which contain the
+ pattern (vimgrep is used)
+ **//pattern files in the current directory or below which contain
+ the pattern (vimgrep is used)
<
-The directory display is updated to show the subdirectory containing a
-matching file. One may then proceed to the next (or previous) matching files'
-directories by using Nexplore or Pexplore, respectively. If your console or
-gui produces recognizable shift-up or shift-down sequences, then you'll likely
-find using shift-downarrow and shift-uparrow convenient. They're mapped by
-netrw:
+The cursor will be placed on the first file in the list. One may then
+continue to go to subsequent files on that list via |:Nexplore| or to
+preceding files on that list with |:Pexplore|. Explore will update the
+directory and place the cursor appropriately.
+
+A plain >
+ :Explore
+will clear the explore list.
+
+If your console or gui produces recognizable shift-up or shift-down sequences,
+then you'll likely find using shift-downarrow and shift-uparrow convenient.
+They're mapped by netrw:
<s-down> == Nexplore, and
<s-up> == Pexplore.
As an example, consider
>
- :Explore **/*.c
+ :Explore */*.c
:Nexplore
:Nexplore
:Pexplore
@@ -1054,38 +1318,55 @@ 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.
-
- *netrw-starstarpat*
-When Explore, Sexplore, Hexplore, or Vexplore are used with a **//pattern,
-such as:
->
- :Explore **//pattern
-<
-then Explore will use |:vimgrep| to find files like |netrw-starpat|;
-however, Explore will also search subdirectories as well as the current
-directory.
+Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split|
+ |g:netrw_fastbrowse| |g:netrw_ftp_browse_reject|
+ |g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
+ |g:netrw_ftp_timelist_cmd| |g:netrw_list_cmd|
+ |g:netrw_liststyle|
-REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l*
+DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2
-To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
-hit the <cr> when atop the ./ directory entry in the listing. One may also
-refresh a local directory by using ":e .".
+With the cursor atop a filename, pressing "qf" will reveal the file's size
+and last modification timestamp. Currently this capability is only available
+for local files.
+
+
+EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2
+
+The "<ctrl-h>" map brings up a requestor allowing the user to change the
+file/directory hiding list contained in |g:netrw_list_hide|. The hiding list
+consists of one or more patterns delimited by commas. Files and/or
+directories satisfying these patterns will either be hidden (ie. not shown) or
+be the only ones displayed (see |netrw-a|).
+The "gh" mapping (see |netrw-gh|) quickly alternates between the usual
+hiding list and the hiding of files or directories that begin with ".".
+
+Associated setting variables: |g:netrw_hide| |g:netrw_list_hide|
+Associated topics: |netrw-a| |netrw-gh| |netrw-mh|
+
+
+EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
+
+When "Sorted by" is name, one may specify priority via the sorting sequence
+(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
+name-listing by suffix, although any pattern will do. Patterns are delimited
+by commas. The default sorting sequence is (all one line):
+>
+ '[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
+ \.swp$,\.bak$,\~$'
+<
+The lone * is where all filenames not covered by one of the other patterns
+will end up. One may change the sorting sequence by modifying the
+g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
+using the "S" map.
-GOING UP *netrw--*
+Related topics: |netrw-s|
+Associated setting variable: |g:netrw_sort_sequence|
+
+
+GOING UP *netrw--* {{{2
To go up a directory, press "-" or press the <cr> when atop the ../ directory
entry in the listing.
@@ -1098,78 +1379,111 @@ user-provided url. By default netrw provides the command as:
where the HOSTNAME becomes the [user@]hostname as requested by the attempt to
read. Naturally, the user may override this command with whatever is
-preferred. The NetList function which implements remote directory browsing
+preferred. The NetList function which implements remote browsing
expects that directories will be flagged by a trailing slash.
-BROWSING *netrw-cr*
+HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
-Browsing is simple: move the cursor onto a file or directory of interest.
-Hitting the <cr> (the return key) will select the file or directory.
-Directories will themselves be listed, and files will be opened using the
-protocol given in the original read request.
+Netrw's browsing facility allows one to use the hiding list in one of three
+ways: ignore it, hide files which match, and show only those files which
+match.
- CAVEAT: There are four forms of listing (see |netrw-i|). Netrw assumes
- that two or more spaces delimit filenames and directory names for the long
- and wide listing formats. Thus, if your filename or directory name has two
- or more spaces embedded in it, or any trailing spaces, then you'll need to
- use the "thin" format to select it.
+If no files have been marked via |netrw-mf|:
-The |g:netrw_browse_split| option, which is zero by default, may be used to
-cause the opening of files to be done in a new window or tab. When the option
-is one or two, the splitting will be taken horizontally or vertically,
-respectively. When the option is set to three, a <cr> will cause the file
-to appear in a new tab.
+The "a" map allows the user to cycle through the three hiding modes.
+The |g:netrw_list_hide| variable holds a comma delimited list of patterns
+based on regular expressions (ex. ^.*\.obj$,^\.) which specify the hiding list.
+(also see |netrw-ctrl-h|) To set the hiding list, use the <c-h> map. As an
+example, to hide files which begin with a ".", one may use the <c-h> map to
+set the hiding list to '^\..*' (or one may put let g:netrw_list_hide= '^\..*'
+in one's <.vimrc>). One may then use the "a" key to show all files, hide
+matching files, or to show only the matching files.
-OBTAINING A FILE *netrw-O*
+ Example: \.[ch]$
+ This hiding list command will hide/show all *.c and *.h files.
-When browsing a remote directory, one may obtain a file under the cursor (ie.
-get a copy on your local machine, but not edit it) by pressing the O key.
-Only ftp and scp are supported for this operation (but since these two are
-available for browsing, that shouldn't be a problem). The status bar
-will then show, on its right hand side, a message like "Obtaining filename".
-The statusline will be restored after the transfer is complete.
+ Example: \.c$,\.h$
+ This hiding list command will also hide/show all *.c and *.h
+ files.
-Netrw can also "obtain" a file using the local browser. Netrw's display
-of a directory is not necessarily the same as Vim's "current directory",
-unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
-a file using the local browser (by putting the cursor on it) and pressing
-"O" will then "obtain" the file; ie. copy it to Vim's current directory.
+Don't forget to use the "a" map to select the mode (normal/hiding/show) you
+want!
-Related topics:
- * To see what the current directory is, use |:pwd|
- * To make the currently browsed directory the current directory, see |netrw-c|
- * To automatically make the currently browsed directory the current
- directory, see |g:netrw_keepdir|.
+If files have been marked using |netrw-mf|, then this command will:
+ if showing all files or non-hidden files:
+ modify the g:netrw_list_hide list by appending the marked files to it
+ and showing only non-hidden files.
-CHANGE LISTING STYLE *netrw-i*
+ else if showing hidden files only:
+ modify the g:netrw_list_hide list by removing the marked files from it
+ and showing only non-hidden files.
+ endif
-The "i" map cycles between the thin, long, wide, and tree listing formats.
+ *netrw-gh* *netrw-hide*
+As a quick shortcut, one may press >
+ gh
+to toggle between hiding files which begin with a period (dot) and not hiding
+them.
-The short listing format gives just the files' and directories' names.
+Associated setting variable: |g:netrw_list_hide|
+Associated topics: |netrw-a| |netrw-ctrl-h| |netrw-mh|
-The long listing is either based on the "ls" command via ssh for remote
-directories or displays the filename, file size (in bytes), and the time and
-date of last modification for local directories. With the long listing
-format, netrw is not able to recognize filenames which have trailing spaces.
-Use the thin listing format for such files.
+IMPROVING BROWSING *netrw-listhack* *netrw-ssh-hack* {{{2
-The wide listing format uses two or more contiguous spaces to delineate
-filenames; when using that format, netrw won't be able to recognize or use
-filenames which have two or more contiguous spaces embedded in the name or any
-trailing spaces. The thin listing format will, however, work with such files.
-This listing format is the most compact.
+Especially with the remote directory browser, constantly entering the password
+is tedious.
-The tree listing format has a top directory followed by files and directories
-preceded by a "|". One may open and close directories by pressing the <cr>
-key while atop the directory name. There is only one tree listing buffer;
-hence, using "v" or "o" on a subdirectory will only show the same buffer,
-twice.
+For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
+tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
+for setting up no-password ssh and scp and discusses associated security
+issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
+but apparently that address is now being redirected to some "hackzine".
+I'll attempt a summary:
+
+ 1. Generate a public/private key pair on the ssh server:
+ ssh-keygen -t rsa
+ (saving the file in ~/.ssh/id_rsa is ok)
+ 2. Just hit the <CR> when asked for passphrase (twice).
+ 3. This creates two files:
+ ~/.ssh/id_rsa
+ ~/.ssh/id_rsa.pub
+ 4. On the client:
+ cd
+ mkdir .ssh
+ chmod 0700 .ssh
+ scp {serverhostname}:.ssh/id_rsa.pub .
+ cat id_rsa.pub >> .ssh/authorized_keys2
+
+For Windows, folks on the vim mailing list have mentioned that Pageant helps
+with avoiding the constant need to enter the password.
+
+Kingston Fung wrote about another way to avoid constantly needing to enter
+passwords:
+
+ In order to avoid the need to type in the password for scp each time, you
+ provide a hack in the docs to set up a non password ssh account. I found a
+ better way to do that: I can use a regular ssh account which uses a
+ password to access the material without the need to key-in the password
+ each time. It's good for security and convenience. I tried ssh public key
+ authorization + ssh-agent, implementing this, and it works! Here are two
+ links with instructions:
+ http://www.ibm.com/developerworks/library/l-keyc2/
+ http://sial.org/howto/openssh/publickey-auth/
-MAKING A NEW DIRECTORY *netrw-d*
+
+LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2
+
+Pressing "qb" (query bookmarks) will list the bookmarked directories and
+directory traversal history (query).
+
+(see |netrw-mb|, |netrw-gb|, |netrw-u|, and |netrw-U|)
+
+
+MAKING A NEW DIRECTORY *netrw-d* {{{2
With the "d" map one may make a new directory either remotely (which depends
on the global variable g:netrw_mkdir_cmd) or locally (which depends on the
@@ -1178,332 +1492,502 @@ directory's name. A bare <CR> at that point will abort the making of the
directory. Attempts to make a local directory that already exists (as either
a file or a directory) will be detected, reported on, and ignored.
+Currently, making a directory via ftp is not supported.
-DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del*
+Associated setting variable: |g:netrw_local_mkdir| |g:netrw_mkdir_cmd|
-Deleting/removing files and directories involves moving the cursor to the
-file/directory to be deleted and pressing "D". Directories must be empty
-first before they can be successfully removed. If the directory is a softlink
-to a directory, then netrw will make two requests to remove the directory
-before succeeding. Netrw will ask for confirmation before doing the
-removal(s). You may select a range of lines with the "V" command (visual
-selection), and then pressing "D".
-The g:netrw_rm_cmd, g:netrw_rmf_cmd, and g:netrw_rmdir_cmd variables are used
-to control the attempts to remove files and directories. The g:netrw_rm_cmd
-is used with files, and its default value is:
+MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* {{{2
- g:netrw_rm_cmd: ssh HOSTNAME rm
+By default, |g:netrw_keepdir| is 1. This setting means that the current
+directory will not track the browsing directory.
-The g:netrw_rmdir_cmd variable is used to support the removal of directories.
-Its default value is:
+Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory to
+track netrw's browsing directory.
- g:netrw_rmdir_cmd: ssh HOSTNAME rmdir
+However, given 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 netrw's current browsing
+directory.
-If removing a directory fails with g:netrw_rmdir_cmd, netrw then will attempt
-to remove it again using the g:netrw_rmf_cmd variable. Its default value is:
+Associated setting variable: |g:netrw_keepdir|
- g:netrw_rmf_cmd: ssh HOSTNAME rm -f
+MARKING FILES *netrw-mf* {{{2
+ (also see |netrw-mr|)
+One may mark files with the cursor atop a filename and then pressing "mf".
+With gvim, one may also mark files with <s-leftmouse>. The following netrw
+maps make use of marked files:
-RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R*
+ |netrw-a| Hide marked files/directories
+ |netrw-D| Delete marked files/directories
+ |netrw-mc| Copy marked files to target
+ |netrw-md| Apply vimdiff to marked files
+ |netrw-me| Edit marked files
+ |netrw-mg| Apply vimgrep to marked files
+ |netrw-mm| Move marked files
+ |netrw-mp| Print marked files
+ |netrw-mt| Set target for |netrw-mm| and |netrw-mc|
+ |netrw-mT| Generate tags using marked files
+ |netrw-mx| Apply shell command to marked files
+ |netrw-mz| Compress/Decompress marked files
+ |netrw-O| Obtain marked files
+ |netrw-R| Rename marked files
-Renaming/moving files and directories involves moving the cursor to the
-file/directory to be moved (renamed) and pressing "R". You will then be
-queried for where you want the file/directory to be moved. You may select a
-range of lines with the "V" command (visual selection), and then pressing "R".
+One may unmark files one at a time the same way one marks them; ie. place
+the cursor atop a marked file and press "mf". This process also works
+with <s-leftmouse> using gvim. One may unmark all files by pressing
+"mu" (see |netrw-mu|).
-The g:netrw_rename_cmd variable is used to implement renaming. By default its
-value is:
+*markfilelist* *global_markfilelist* *local_markfilelist*
+All marked files are entered onto the global marked file list; there is only
+one such list. In addition, every netrw buffer also has its own local marked
+file list; since netrw buffers are associated with specific directories, this
+means that each directory has its own local marked file list. The various
+commands which operate on marked files use one or the other of the marked file
+lists.
- ssh HOSTNAME mv
-One may rename a block of files and directories by selecting them with
-the V (|linewise-visual|).
+MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
+ (also see |netrw-mf|)
+One may also mark files by pressing "mr"; netrw will then issue a prompt,
+"Enter regexp: ". You may then enter a regular expression such as \.c$ .
+All files in the current directory will then be marked. Note that the
+regular expressions are vim-style |regexp| ones, not shell ones. So
+entering *.c probably isn't what you want!
-HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding*
-Netrw's browsing facility allows one to use the hiding list in one of three
-ways: ignore it, hide files which match, and show only those files which
-match. The "a" map allows the user to cycle about these three ways.
+MARKED FILES: ARBITRARY COMMAND *netrw-mx* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the local marked-file list)
-The g:netrw_list_hide variable holds a comma delimited list of patterns (ex.
-\.obj) which specify the hiding list. (also see |netrw-ctrl-h|) To set the
-hiding list, use the <c-h> map. As an example, to hide files which begin with
-a ".", one may use the <c-h> map to set the hiding list to '^\..*' (or one may
-put let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the
-"a" key to show all files, hide matching files, or to show only the matching
-files.
+Upon activation of the "mx" map, netrw will query the user for some (external)
+command to be applied to all marked files. All "%"s in the command will be
+substituted with the name of each marked file in turn. If no "%"s are in the
+command, then the command will be followed by a space and a marked filename.
- Example: ^.*\.[ch]
- This hiding list command will hide/show all *.c and *.h files.
- Example: ^.*\.c,^.*\.h
- This hiding list command will also hide/show all *.c and *.h
- files.
+MARKED FILES: COMPRESSION AND DECOMPRESSION *netrw-mz* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the local marked file list)
-Don't forget to use the "a" map to select the normal/hiding/show mode you want!
+If any marked files are compressed, then "mz" will decompress them.
+If any marked files are decompressed, then "mz" will compress them
+using the command specified by |g:netrw_compress|; by default,
+that's "gzip".
- *netrw-ctrl_h*
-EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide*
+For decompression, netrw provides a |Dictionary| of suffices and their
+associated decompressing utilities; see |g:netrw_decompress|.
-The "<ctrl-h>" map brings up a requestor allowing the user to change the
-file/directory hiding list. The hiding list consists of one or more patterns
-delimited by commas. Files and/or directories satisfying these patterns will
-either be hidden (ie. not shown) or be the only ones displayed (see
-|netrw-a|).
+Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
+MARKED FILES: COPYING *netrw-mc* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (Uses the global marked file list)
-BROWSING WITH A HORIZONTALLY SPLIT WINDOW *netrw-o* *netrw-horiz*
+Select a target directory with mt (|netrw-mt|). Then change directory,
+select file(s) (see |netrw-mf|), and press "mc".
-Normally one enters a file or directory using the <cr>. However, the "o" map
-allows one to open a new window to hold the new directory listing or file. A
-horizontal split is used. (for vertical splitting, see |netrw-v|)
+Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
-Normally, the o key splits the window horizontally with the new window and
-cursor at the top. To change to splitting the window horizontally with the
-new window and cursor at the bottom, have
+MARKED FILES: DIFF *netrw-md* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the global marked file list)
- let g:netrw_alto = 1
+Use |vimdiff| to visualize difference between selected files (two or
+three may be selected for this). Uses the global marked file list.
-in your <.vimrc>. (also see |netrw-t| |netrw-v| |g:netrw_alto|)
+MARKED FILES: EDITING *netrw-me* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the global marked file list)
-There is only one tree listing buffer; using "o" on a displayed subdirectory
-will split the screen, but the same buffer will be shown twice.
+This command will place the marked files on the |arglist| and commence
+editing them. One may return the to explorer window with |:Rexplore|.
+MARKED FILES: GREP *netrw-mg* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the global marked file list)
-BROWSING WITH A VERTICALLY SPLIT WINDOW *netrw-v*
+This command will apply |:vimgrep| to the marked files. The command will ask
+for the requested pattern; one may enter: >
+ /pattern/[g][j]
+ ! /pattern/[g][j]
+ pattern
+<
+MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the local marked file list)
-Normally one enters a file or directory using the <cr>. However, the "v" map
-allows one to open a new window to hold the new directory listing or file. A
-vertical split is used. (for horizontal splitting, see |netrw-o|)
+This command extracts the suffices of the marked files and toggles their
+presence on the hiding list. Please note that marking the same suffix
+this way multiple times will result in the suffix's presence being toggled
+for each file (so an even quantity of marked files having the same suffix
+is the same as not having bothered to select them at all).
-Normally, the v key splits the window vertically with the new window and
-cursor at the left. To change to splitting the window vertically with the new
-window and cursor at the right, have
+Related topics: |netrw-a| |g:netrw_list_hide|
- let g:netrw_altv = 1
+MARKED FILES: MOVING *netrw-mm* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the global marked file list)
-in your <.vimrc>. (also see: |netrw-o| |netrw-t| |g:netrw_altv|)
+Select a target directory with mT (|netrw-mt|). Then change directory,
+select file(s) (see |netrw-mf|), and press "mm".
-There is only one tree listing buffer; using "v" on a displayed subdirectory
-will split the screen, but the same buffer will be shown twice.
+Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
+MARKED FILES: PRINTING *netrw-mp* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the local marked file list)
-BROWSING WITH A NEW TAB *netrw-t*
+Netrw will apply the |:hardcopy| command to marked files. What it does
+is open each file in a one-line window, execute hardcopy, then close the
+one-line window.
-Normally one enters a file or directory using the <cr>. The "t" map
-allows one to open a new window hold the new directory listing or file in a
-new tab. (also see: |netrw-o| |netrw-v|)
+MARKED FILES: SOURCING *netrw-ms* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the local marked file list)
-PREVIEW WINDOW *netrw-p* *netrw-preview*
+Netrw will source the marked files (using vim's |:source| command)
-One may use a preview window by using the "p" key when the cursor is atop the
-desired filename to be previewed.
+MARKED FILES: TAGGING *netrw-mT* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+ (uses the global marked file list)
-PREVIOUS WINDOW *netrw-P* *netrw-prvwin*
+The "mt" mapping will apply the command in g:netrw_ctags (by default, its
+"ctags") to marked files. For remote browsing, in order to create a tags file
+netrw will use ssh (see |g:netrw_ssh_cmd|), and so ssh must be available for
+this to work on remote systems. For your local system, see |ctags| on how to
+get a version. I myself use hdrtags, currently available at
+http://mysite.verizon.net/astronaut/src/index.html , and have >
-To edit a file or directory in the previously used window (see :he |CTRL-W_P|),
-press a "P". If there's only one window, then the one window will be
-horizontally split (above/below splitting is controlled by |g:netrw_alto|,
-and its initial size is controlled by |g:netrw_winsize|).
+ let g:netrw_ctags= "hdrtag"
+<
+in my <.vimrc>.
-If there's more than one window, the previous window will be re-used on
-the selected file/directory. If the previous window's associated buffer
-has been modified, and there's only one window with that buffer, then
-the user will be asked if s/he wishes to save the buffer first (yes,
-no, or cancel).
+When a remote set of files are tagged, the resulting tags file is "obtained";
+ie. a copy is transferred to the local system's directory. The local tags
+file is then modified so that one may use it through the network. The
+modification is concerns the names of the files in the tags; each filename is
+preceded by the netrw-compatible url used to obtain it. When one subsequently
+uses one of the go to tag actions (|tags|), the url will be used by netrw to
+edit the desired file and go to the tag.
+Associated setting variables: |g:netrw_ssh_cmd|
-SELECTING SORTING STYLE *netrw-s* *netrw-sort*
-One may select the sorting style by name, time, or (file) size. The "s" map
-allows one to circulate amongst the three choices; the directory listing will
-automatically be refreshed to reflect the selected style.
+MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
-EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence*
+ * if the cursor is atop a file name, then the netrw window's currently
+ displayed directory is used for the copy/move-to target.
-When "Sorted by" is name, one may specify priority via the sorting sequence
-(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
-name-listing by suffix, although any pattern will do. Patterns are delimited
-by commas. The default sorting sequence is:
->
- [\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
-<
-The lone * is where all filenames not covered by one of the other patterns
-will end up. One may change the sorting sequence by modifying the
-g:netrw_sort_sequence variable (either manually or in your <.vimrc>) or by
-using the "S" map.
+ * also, if the cursor is in the banner, then the netrw window's currently
+ displayed directory is used for the copy/move-to target.
+ * however, if the cursor is atop a directory name, then that directory is
+ used for the copy/move-to target
-REVERSING SORTING ORDER *netrw-r* *netrw-reverse*
+There is only one copy/move-to target per vim session; ie. the target is a
+script variable (see |s:var|) and is shared between all netrw windows (in an
+instance of vim).
-One may toggle between normal and reverse sorting order by pressing the
-"r" key.
+MARKED FILES: UNMARKING *netrw-mu* {{{2
+ (See |netrw-mf| and |netrw-mr| for how to mark files)
+The "mu" mapping will unmark all currently marked files.
-CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir*
-Every time you change to a new directory (new for the current session),
-netrw will save the directory in a recently-visited directory history
-list (unless g:netrw_dirhistmax is zero; by default, its ten). With the
-"u" map, one can change to an earlier directory (predecessor). To do
-the opposite, see |netrw-U|.
+NETRW BROWSER VARIABLES *netrw-browser-options* *netrw-browser-var* {{{2
+(if you're interestd in the netrw file transfer settings, see |netrw-options|)
-CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir*
+The <netrw.vim> browser provides settings in the form of variables which
+you may modify; by placing these settings in your <.vimrc>, you may customize
+your browsing preferences. (see also: |netrw-settings|)
+>
+ --- -----------
+ Var Explanation
+ --- -----------
+< *g:netrw_alto* change from above splitting to below splitting
+ by setting this variable (see |netrw-o|)
+ default: =&sb (see |'sb'|)
-With the "U" map, one can change to a later directory (successor).
-This map is the opposite of the "u" map. (see |netrw-u|) Use the
-q map to list both the bookmarks and history. (see |netrw-q|)
+ *g:netrw_altv* change from left splitting to right splitting
+ by setting this variable (see |netrw-v|)
+ default: =&spr (see |'spr'|)
- *netrw-gx*
-CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler*
- (also see |netrw_filehandler|)
+ *g:netrw_browse_split* when browsing, <cr> will open the file by:
+ =0: re-using the same window
+ =1: horizontally splitting the window first
+ =2: vertically splitting the window first
+ =3: open file in new tab
+ =4: act like "P" (ie. open previous window)
-Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
-best seen with a special handler (ie. a tool provided with your computer).
-Netrw allows one to invoke such special handlers by: >
+ *g:netrw_browsex_viewer* specify user's preference for a viewer: >
+ "kfmclient exec"
+ "gnome-open"
+< If >
+ "-"
+< is used, then netrwFileHandler() will look for
+ a script/function to handle the given
+ extension. (see |netrw_filehandler|).
- * when Exploring, hit the "x" key
- * when editing, hit gx with the cursor atop the special filename
-< (not available if the |g:netrw_nogx| variable exists)
+ *g:netrw_cd_escape* ="[]#*$%'\" ?`!&();<>\\"
+ This option is used to escape directory names
+ before changing directory to them.
+
+ *g:netrw_compress* ="gzip"
+ Will compress marked files with this
+ command
+
+ *g:netrw_decompress* = { ".gz" : "gunzip" ,
+ ".bz2" : "bunzip2" ,
+ ".zip" : "unzip" ,
+ ".tar" : "tar -xf"}
+ A dictionary mapping suffices to
+ decompression programs.
+
+ *g:netrw_fastbrowse* =0: slow speed directory browsing;
+ never re-uses directory listings,
+ always obtains directory listings.
+ =1: medium speed directory browsing;
+ re-use directory listings only
+ when remote directory browsing.
+ (default value)
+ =2: fast directory browsing;
+ only obtains directory listings when the
+ directory hasn't been seen before
+ (or |netrw-ctrl-l| is used).
-Netrw determines which special handler by the following method:
+ Fast browsing retains old directory listing
+ buffers so that they don't need to be
+ re-acquired. This feature is especially
+ important for remote browsing. However, if
+ a file is introduced or deleted into or from
+ such directories, the old directory buffer
+ becomes out-of-date. One may always refresh
+ such a directory listing with |netrw-ctrl-l|.
+ This option gives the user the choice of
+ trading off accuracy (ie. up-to-date listing)
+ versus speed.
- * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
- view files. Examples of useful settings (place into your <.vimrc>): >
+ *g:netrw_fname_escape* =' ?&;%'
+ Used on filenames before remote reading/writing
- :let g:netrw_browsex_viewer= "kfmclient exec"
-< or >
- :let g:netrw_browsex_viewer= "gnome-open"
-<
- If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
- invoked first (see |netrw_filehandler|).
+ *g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
+ that can show up as "directories" and "files"
+ in the listing. This pattern is used to
+ remove such embedded messages. By default its
+ value is:
+ '^total\s\+\d\+$\|
+ ^Trying\s\+\d\+.*$\|
+ ^KERBEROS_V\d rejected\|
+ ^Security extensions not\|
+ No such file\|
+ : connect to address [0-9a-fA-F:]*
+ : No route to host$'
- * for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
- * for Gnome (with gnome-open): gnome-open is used.
- * for KDE (with kfmclient): kfmclient is used.
- * otherwise the netrwFileHandler plugin is used.
+ *g:netrw_ftp_list_cmd* options for passing along to ftp for directory
+ listing. Defaults:
+ unix or g:netrw_cygwin set: : "ls -lF"
+ otherwise "dir"
-The file's suffix is used by these various approaches to determine an
-appropriate application to use to "handle" these files. Such things as
-OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
-*.eps) can be handled.
- *netrw_filehandler*
+ *g:netrw_ftp_sizelist_cmd* options for passing along to ftp for directory
+ listing, sorted by size of file.
+ Defaults:
+ unix or g:netrw_cygwin set: : "ls -slF"
+ otherwise "dir"
-The "x" map applies a function to a file, based on its extension. Of course,
-the handler function must exist for it to be called!
->
- Ex. mypgm.html x ->
- NFH_html("scp://user@host/some/path/mypgm.html")
-<
-Users may write their own netrw File Handler functions to support more
-suffixes with special handling. See <plugin/netrwFileHandlers.vim> for
-examples on how to make file handler functions. As an example: >
+ *g:netrw_ftp_timelist_cmd* options for passing along to ftp for directory
+ listing, sorted by time of last modification.
+ Defaults:
+ unix or g:netrw_cygwin set: : "ls -tlF"
+ otherwise "dir"
- " NFH_suffix(filename)
- fun! NFH_suffix(filename)
- ..do something special with filename..
- endfun
-<
-These functions need to be defined in some file in your .vim/plugin
-(vimfiles\plugin) directory. Vim's function names may not have punctuation
-characters (except for the underscore) in them. To support suffices that
-contain such characters, netrw will first convert the suffix using the
-following table: >
+ *g:netrw_glob_escape* ='[]*?`{~$'
+ These characters in directory names are
+ escaped before applying glob()
- @ -> AT ! -> EXCLAMATION % -> PERCENT
- : -> COLON = -> EQUAL ? -> QUESTION
- , -> COMMA - -> MINUS ; -> SEMICOLON
- $ -> DOLLAR + -> PLUS ~ -> TILDE
-<
-So, for example: >
+ *g:netrw_hide* if true, the hiding list is used
+ default: =0
- file.rcs,v -> NFH_rcsCOMMAv()
-<
-If more such translations are necessary, please send me email: >
- NdrOchip at ScampbellPfamily.AbizM - NOSPAM
-with a request.
+ *g:netrw_keepdir* =1 (default) keep current directory immune from
+ the browsing directory.
+ =0 keep the current directory the same as the
+ browsing directory.
+ The current browsing directory is contained in
+ b:netrw_curdir (also see |netrw-c|)
+ *g:netrw_list_cmd* command for listing remote directories
+ default: (if ssh is executable)
+ "ssh HOSTNAME ls -FLa"
-MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir*
+ *g:netrw_liststyle* Set the default listing style:
+ = 0: thin listing (one file per line)
+ = 1: long listing (one file per line with time
+ stamp information and file size)
+ = 2: wide listing (multiple files in columns)
+ = 3: tree style listing
+ *g:netrw_list_hide* comma separated pattern list for hiding files
+ Patterns are regular expressions (see |regexp|)
+ Example: let g:netrw_list_hide= '.*\.swp$'
+ default: ""
-By default, |g:netrw_keepdir| is 1. This setting means that the current
-directory will not track the browsing directory.
+ *g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
+ ="copy" Windows
+ Copies marked files (|netrw-mf|) to target
+ directory (|netrw-mt|, |netrw-mc|)
-Setting g:netrw_keepdir to 0 tells netrw to make vim's current directory to
-track netrw's browsing directory.
+ *g:netrw_localmovecmd* ="mv" Linux/Unix/MacOS/Cygwin
+ ="move" Windows
+ Moves marked files (|netrw-mf|) to target
+ directory (|netrw-mt|, |netrw-mm|)
-However, given 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 netrw's current browsing
-directory.
+ *g:netrw_local_mkdir* command for making a local directory
+ default: "mkdir"
+ *g:netrw_local_rmdir* remove directory command (rmdir)
+ default: "rmdir"
-BOOKMARKING A DIRECTORY *netrw-mb* *netrw-bookmark* *netrw-bookmarks*
-One may easily "bookmark" a directory by using >
+ *g:netrw_maxfilenamelen* =32 by default, selected so as to make long
+ listings fit on 80 column displays.
+ If your screen is wider, and you have file
+ or directory names longer than 32 bytes,
+ you may set this option to keep listings
+ columnar.
- {cnt}mb
-<
-Any count may be used. One may use viminfo's "!" option to retain bookmarks
-between vim sessions. See |netrw-gb| for how to return to a bookmark and
-|netrw-q| for how to list them.
+ *g:netrw_mkdir_cmd* command for making a remote directory
+ default: "ssh USEPORT HOSTNAME mkdir"
+ *g:netrw_retmap* if it exists and is set to one, then
+ <2-leftmouse> will be mapped for easy
+ return to the netrw browser window.
+ (example: click once to select and open
+ a file, double-click to return)
+ default: =0
-CHANGING TO A BOOKMARKED DIRECTORY *netrw-gb*
+ *g:netrw_rm_cmd* command for removing files
+ default: "ssh USEPORT HOSTNAME rm"
-To change directory back to a bookmarked directory, use
+ *g:netrw_rmdir_cmd* command for removing directories
+ default: "ssh USEPORT HOSTNAME rmdir"
- {cnt}gb
+ *g:netrw_rmf_cmd* command for removing softlinks
+ default: "ssh USEPORT HOSTNAME rm -f"
-Any count may be used to reference any of the bookmarks. See |netrw-mb| on
-how to bookmark a directory and |netrw-q| on how to list bookmarks.
+ *g:netrw_sort_by* sort by "name", "time", or "size"
+ default: "name"
+ *g:netrw_sort_direction* sorting direction: "normal" or "reverse"
+ default: "normal"
-LISTING BOOKMARKS AND HISTORY *netrw-q* *netrw-listbookmark*
+ *g:netrw_sort_sequence* when sorting by name, first sort by the
+ comma-separated pattern sequence
+ default: '[\/]$,*,\.bak$,\.o$,\.h$,
+ \.info$,\.swp$,\.obj$'
-Pressing "q" will list the bookmarked directories and directory traversal
-history (query). (see |netrw-mb|, |netrw-gb|, |netrw-u|, and |netrw-U|)
+ *g:netrw_special_syntax* If true, then certain files will be shown
+ in special syntax in the browser:
+
+ netrwBak : *.bak
+ netrwCompress: *.gz *.bz2 *.Z *.zip
+ netrwData : *.dat
+ netrwHdr : *.h
+ netrwLib : *.a *.so *.lib *.dll
+ netrwMakefile: [mM]akefile *.mak
+ netrwObj : *.o *.obj
+ netrwTags : tags ANmenu ANtags
+ netrwTilde : *~
+ netrwTmp : tmp* *tmp
+
+ These syntax highlighting groups are linked
+ to Folded or DiffChange by default
+ (see |hl-Folded| and |hl-DiffChange|), but
+ one may put lines like >
+ hi link netrwCompress Visual
+< into one's <.vimrc> to use one's own
+ preferences.
+ *g:netrw_ssh_cmd* One may specify an executable command
+ to use instead of ssh for remote actions
+ such as listing, file removal, etc.
+ default: ssh
-IMPROVING DIRECTORY BROWSING *netrw-listhack*
+ *g:netrw_ssh_browse_reject* ssh can sometimes produce unwanted lines,
+ messages, banners, and whatnot that one doesn't
+ want masquerading as "directories" and "files".
+ Use this pattern to remove such embedded
+ messages. By default its value is:
+ '^total\s\+\d\+$'
-Especially with the remote directory browser, constantly entering the password
-is tedious.
-For Linux/Unix systems, the book "Linux Server Hacks - 100 industrial strength
-tips & tools" by Rob Flickenger (O'Reilly, ISBN 0-596-00461-3) gives a tip
-for setting up no-password ssh and scp and discusses associated security
-issues. It used to be available at http://hacks.oreilly.com/pub/h/66 ,
-but apparently that address is now being redirected to some "hackzine".
-I'll attempt a summary:
+ *g:netrw_tmpfile_escape* =' &;'
+ escape() is applied to all temporary files
+ to escape these characters.
- 1. Generate a public/private key pair on the ssh server:
- ssh-keygen -t rsa
- (saving the file in ~/.ssh/id_rsa is ok)
- 2. Just hit the <CR> when asked for passphrase (twice).
- 3. This creates two files:
- ~/.ssh/id_rsa
- ~/.ssh/id_rsa.pub
- 4. On the client:
- cd
- mkdir .ssh
- chmod 0700 .ssh
- scp {serverhostname}:.ssh/id_rsa.pub .
- cat id_rsa.pub >> .ssh/authorized_keys2
+ *g:netrw_timefmt* specify format string to vim's strftime().
+ The default, "%c", is "the preferred date
+ and time representation for the current
+ locale" according to my manpage entry for
+ strftime(); however, not all are satisfied
+ with it. Some alternatives:
+ "%a %d %b %Y %T",
+ " %a %Y-%m-%d %I-%M-%S %p"
+ default: "%c"
-For Windows, folks on the vim mailing list have mentioned that Pageant helps
-with avoiding the constant need to enter the password.
+ *g:netrw_use_noswf* netrw normally avoids writing swapfiles
+ for browser buffers. However, under some
+ systems this apparently is causing nasty
+ ml_get errors to appear; if you're getting
+ ml_get errors, try putting
+ let g:netrw_use_noswf= 0
+ in your .vimrc.
+ *g:netrw_winsize* specify initial size of new windows made with
+ "o" (see |netrw-o|), "v" (see |netrw-v|),
+ |:Hexplore| or |:Vexplore|.
+ default: ""
-NETRW SETTINGS *netrw-settings*
+ *g:netrw_xstrlen* Controls how netrw computes a string
+ including multi-byte characters' string
+ length. (thanks to N Weibull, T Mechelynck)
+ =0: uses Vim's built-in strlen()
+ =1: number of codepoints (Latin + a combining
+ circumflex is two codepoints) (DEFAULT)
+ =2: number of spacing codepoints (Latin a +
+ combining circumflex is one spacing
+ codepoint; a hard tab is one; wide and
+ narrow CJK are one each; etc.)
+ =3: virtual length (counting tabs as anything
+ between 1 and |'tabstop'|, wide CJJK as 2
+ rather than 1, Arabic alif as zero when
+ immediately preceded by lam, one
+ otherwise, etc)
+
+ *g:NetrwTopLvlMenu* This variable specifies the top level
+ menu name; by default, it's "Netrw.". If
+ you wish to change this, do so in your
+ .vimrc.
+
+NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible* {{{2
+
+Netrw has been designed to handle user options by saving them, setting the
+options to something that's compatible with netrw's needs, and then restoring
+them. However, the autochdir option: >
+ :set acd
+is problematical. Autochdir sets the current directory to that containing the
+file you edit; this apparently also applies to directories. In other words,
+autochdir sets the current directory to that containing the "file" (even if
+that "file" is itself a directory).
+
+NETRW SETTINGS *netrw-settings* {{{2
With the NetrwSettings.vim plugin, >
:NetrwSettings
@@ -1512,11 +1996,121 @@ settings. You may change any of their values; when you save the file, the
settings therein will be used. One may also press "?" on any of the lines for
help on what each of the variables do.
-(also see: |netrw-browse-var| |netrw-protocol| |netrw-var| |netrw-variables|)
+(also see: |netrw-browser-var| |netrw-protocol| |netrw-var| |netrw-variables|)
==============================================================================
-10. Problems and Fixes *netrw-problems*
+OBTAINING A FILE *netrw-O* {{{2
+
+If there are no marked files:
+
+ When browsing a remote directory, one may obtain a file under the cursor
+ (ie. get a copy on your local machine, but not edit it) by pressing the O
+ key.
+
+If there are marked files:
+
+ The marked files will be obtained (ie. a copy will be transferred to your
+ local machine, but not set up for editing).
+
+Only ftp and scp are supported for this operation (but since these two are
+available for browsing, that shouldn't be a problem). The status bar will
+then show, on its right hand side, a message like "Obtaining filename". The
+statusline will be restored after the transfer is complete.
+
+Netrw can also "obtain" a file using the local browser. Netrw's display
+of a directory is not necessarily the same as Vim's "current directory",
+unless |g:netrw_keepdir| is set to 0 in the user's <.vimrc>. One may select
+a file using the local browser (by putting the cursor on it) and pressing
+"O" will then "obtain" the file; ie. copy it to Vim's current directory.
+
+Related topics:
+ * To see what the current directory is, use |:pwd|
+ * To make the currently browsed directory the current directory, see |netrw-c|
+ * To automatically make the currently browsed directory the current
+ directory, see |g:netrw_keepdir|.
+
+
+PREVIEW WINDOW *netrw-p* *netrw-preview* {{{2
+
+One may use a preview window by using the "p" key when the cursor is atop the
+desired filename to be previewed. The display will then split to show both
+the browser (where the cursor will remain) and the file (see |:pedit|).
+By default, the split will be taken horizontally; one may use vertical
+splitting if one has set |g:netrw_preview| first.
+
+
+PREVIOUS WINDOW *netrw-P* *netrw-prvwin* {{{2
+
+To edit a file or directory in the previously used (last accessed) window (see
+:he |CTRL-W_p|), press a "P". If there's only one window, then the one window
+will be horizontally split (above/below splitting is controlled by
+|g:netrw_alto|, and its initial size is controlled by |g:netrw_winsize|).
+
+If there's more than one window, the previous window will be re-used on
+the selected file/directory. If the previous window's associated buffer
+has been modified, and there's only one window with that buffer, then
+the user will be asked if s/he wishes to save the buffer first (yes,
+no, or cancel).
+
+
+REFRESHING THE LISTING *netrw-ctrl-l* *netrw-ctrl_l* {{{2
+
+To refresh either a local or remote directory listing, press ctrl-l (<c-l>) or
+hit the <cr> when atop the ./ directory entry in the listing. One may also
+refresh a local directory by using ":e .".
+
+
+RENAMING FILES OR DIRECTORIES *netrw-move* *netrw-rename* *netrw-R* {{{2
+
+If there are no marked files: (see |netrw-mf|)
+
+ Renaming/moving files and directories involves moving the cursor to the
+ file/directory to be moved (renamed) and pressing "R". You will then be
+ queried for where you want the file/directory to be moved. You may select
+ a range of lines with the "V" command (visual selection), and then
+ pressing "R".
+
+If there are marked files: (see |netrw-mf|)
+
+ Marked files will be renamed (moved). You will be queried as above in
+ order to specify where you want the file/directory to be moved.
+
+ WARNING:~
+
+ Note that moving files is a dangerous operation; copies are safer. That's
+ because a "move" for remote files is actually a copy + delete -- and if
+ the copy fails and the delete does not, you may lose the file.
+
+The g:netrw_rename_cmd variable is used to implement renaming. By default its
+value is:
+
+ ssh HOSTNAME mv
+
+One may rename a block of files and directories by selecting them with
+the V (|linewise-visual|).
+
+
+REVERSING SORTING ORDER *netrw-r* *netrw-reverse* {{{2
+
+One may toggle between normal and reverse sorting order by pressing the
+"r" key.
+
+Related topics: |netrw-s|
+Associated setting variable: |g:netrw_sort_direction|
+
+
+SELECTING SORTING STYLE *netrw-s* *netrw-sort* {{{2
+
+One may select the sorting style by name, time, or (file) size. The "s" map
+allows one to circulate amongst the three choices; the directory listing will
+automatically be refreshed to reflect the selected style.
+
+Related topics: |netrw-r| |netrw-S|
+Associated setting variables: |g:netrw_sort_by| |g:netrw_sort_sequence|
+
+
+10. Problems and Fixes *netrw-problems* {{{1
(This section is likely to grow as I get feedback)
(also see |netrw-debug|)
@@ -1568,9 +2162,11 @@ help on what each of the variables do.
*netrw-p4*
P4. I would like long listings to be the default.
- let g:netrw_liststyle= 1
+ Put the following statement into your |.vimrc|: >
- Check out |netrw-browse-var| for more customizations that
+ let g:netrw_liststyle= 1
+<
+ Check out |netrw-browser-var| for more customizations that
you can set.
*netrw-p5*
@@ -1579,15 +2175,18 @@ help on what each of the variables do.
Does your system's strftime() accept the "%c" to yield dates
such as "Sun Apr 27 11:49:23 1997"? If not, do a "man strftime"
and find out what option should be used. Then put it into
- your <.vimrc>:
- let g:netrw_timefmt= "%X" (where X is the option)
+ your |.vimrc|: >
+ let g:netrw_timefmt= "%X" (where X is the option)
+<
*netrw-p6*
P6. I want my current directory to track my browsing.
How do I do that?
+ Put the following line in your |.vimrc|:
+>
let g:netrw_keepdir= 0
-
+<
*netrw-p7*
P7. I use Chinese (or other non-ascii) characters in my filenames, and
netrw (Explore, Sexplore, Hexplore, etc) doesn't display them!
@@ -1652,9 +2251,9 @@ help on what each of the variables do.
{asterisk}.{asterisk} (all files), or whatever types
you want (cec: change {asterisk} to * ; I had to
write it that way because otherwise the helptags
- system thinks its a tag)
- - Make sure its at the top of the listbox (click it,
- then click "Up" if its not)
+ system thinks it's a tag)
+ - Make sure it's at the top of the listbox (click it,
+ then click "Up" if it's not)
If using the Norton Commander style, you just have to hit <F4>
to edit a file in a local copy of gvim.
@@ -1663,16 +2262,24 @@ help on what each of the variables do.
http://www.tartarus.org/~simon/puttydoc/Chapter8.html#pubkey-gettingready
8.3 Getting ready for public key authentication
<
- How to use private key with 'pscp': >
+ How to use a private key with 'pscp': >
+
http://www.tartarus.org/~simon/puttydoc/Chapter5.html
5.2.4 Using public key authentication with PSCP
<
+ (Ben Schmidt) I find the ssh included with cwRsync is
+ brilliant, and install cwRsync or cwRsyncServer on most
+ Windows systems I come across these days. I guess COPSSH,
+ packed by the same person, is probably even better for use as
+ just ssh on Windows, and probably includes sftp, etc. which I
+ suspect the cwRsync doesn't, though it might
+
(cec) To make proper use of these suggestions above, you will
need to modify the following user-settable variables in your
.vimrc:
- |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
- |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
+ |g:netrw_ssh_cmd| |g:netrw_list_cmd| |g:netrw_mkdir_cmd|
+ |g:netrw_rm_cmd| |g:netrw_rmdir_cmd| |g:netrw_rmf_cmd|
The first one (|g:netrw_ssh_cmd|) is the most important; most
of the others will use the string in g:netrw_ssh_cmd by
@@ -1688,52 +2295,77 @@ help on what each of the variables do.
in your <.vimrc>: >
let g:netrw_use_noswf= 0
<
+ *netrw-p10*
+ P10. I'm being pestered with "[something] is a directory" and
+ "Press ENTER or type command to continue" prompts...
+
+ The "[something] is a directory" prompt is issued by Vim,
+ not by netrw, and there appears to be no way to work around
+ it. Coupled with the default cmdheight of 1, this message
+ causes the "Press ENTER..." prompt. So: read |hit-enter|;
+ I also suggest that you set your |'cmdheight'| to 2 (or more) in
+ your <.vimrc> file.
+
+ *netrw-p11*
+ P11. I want to have two windows; a thin one on the left and my editing
+ window on the right. How can I do this?
+
+ * Put the following line in your <.vimrc>:
+ let g:netrw_altv = 1
+ * Edit the current directory: :e .
+ * Select some file, press v
+ * Resize the windows as you wish (see |CTRL-W_<| and
+ |CTRL-W_>|). If you're using gvim, you can drag
+ the separating bar with your mouse.
+ * When you want a new file, use ctrl-w h to go back to the
+ netrw browser, select a file, then press P (see |CTRL-W_h|
+ and |netrw-P|). If you're using gvim, you can press
+ <leftmouse> in the browser window and then press the
+ <middlemouse> to select the file.
==============================================================================
-11. Debugging *netrw-debug*
+11. Debugging Netrw Itself *netrw-debug* {{{1
The <netrw.vim> script is typically available as:
>
- /usr/local/share/vim/vim6x/plugin/netrw.vim
+ /usr/local/share/vim/vim6x/plugin/netrwPlugin.vim
+ /usr/local/share/vim/vim6x/autoload/netrw.vim
< -or- >
- /usr/local/share/vim/vim7x/plugin/netrw.vim
+ /usr/local/share/vim/vim7x/plugin/netrwPlugin.vim
+ /usr/local/share/vim/vim7x/autoload/netrw.vim
<
which is loaded automatically at startup (assuming :set nocp).
1. Get the <Decho.vim> script, available as:
- http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_scripts
- as "Decho, a vimL debugging aid"
+ http://mysite.verizon.net/astronaut/vim/index.html#DECHO
or
http://vim.sourceforge.net/scripts/script.php?script_id=120
- and put it into your local plugin directory.
-
- 2. <Decho.vim> itself needs the <cecutil.vim> script, so you'll need
- to put it into your .vim/plugin, too. You may obtain it from:
+ It now comes as a "vimball"; if you're using vim 7.0 or earlier,
+ you'll need to update vimball, too. See
+ http://mysite.verizon.net/astronaut/vim/index.html#VIMBALL
- http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
- as "DrC's Utilities"
-
- 3. Edit the <netrw.vim> file by typing:
+ 2. Edit the <netrw.vim> file by typing: >
vim netrw.vim
:DechoOn
:wq
-
- To restore to normal non-debugging behavior, edit <netrw.vim>
- by typing
+<
+ To restore to normal non-debugging behavior, re-edit <netrw.vim>
+ and type >
vim netrw.vim
:DechoOff
:wq
-
+<
This command, provided by <Decho.vim>, will comment out all
Decho-debugging statements (Dfunc(), Dret(), Decho(), Dredir()).
- 4. Then bring up vim and attempt a transfer or do browsing. A set of
- messages should appear concerning the steps that <netrw.vim> took
- in attempting to read/write your file over the network.
+ 3. Then bring up vim and attempt to evoke the problem by doing a
+ transfer or doing some browsing. A set of messages should appear
+ concerning the steps that <netrw.vim> took in attempting to
+ read/write your file over the network in a separate tab.
To save the file, use >
:wincmd j
@@ -1745,15 +2377,218 @@ which is loaded automatically at startup (assuming :set nocp).
==============================================================================
12. History *netrw-history* {{{1
+ v125: Apr 07, 2008 * (Cristian Rigamonti) CR provides a patch; he
+ noted that gx was failing since its call to
+ netrw#NetBrowseX() wasn't updated to
+ netrw#NetrwBrowseX().
+ * (Stanis Trendelenburg) ST provides a patch to
+ supports davs: (dav + ssl)
+ * (Rick Choi) noted that directory names comprised
+ of three digits were not being displayed by
+ the internal browser. Fixed.
+ * (Erik Falor) provided a patch to handle problems
+ with changing directory and |'acd'| option.
+ * (James Vega, Teemu Likonen) noted that netrw
+ wasn't handling multi-byte filenames/directories
+ correctly. Fixed.
+ * (Rick) found problem with g:netrw_maxfilenamelen
+ being overridden.
+ * (James Vega) pointed out that netrw was
+ misidentifying all files in a symbolically linked
+ directory as being symbolically linked
+ themselves. This particular problem was fixed;
+ however, there are now situations where
+ symbolically linked files will not be detected.
+ Really need an internal vim function to do this
+ identification.
+ Apr 17, 2008 * When g:netrw_keepdir==0, current directory
+ doesn't necessarily equal b:netrw_curdir
+ initially. Problem is due to the patch directly
+ above.
+ * Fixed qf to handle case where b:netrw_curdir
+ isn't the same as the current directory under
+ linux/macosx.
+ * New: |netrw-mg| (apply vimgrep to marked files)
+ May 05, 2008 * (Rick) pointed out that a "setlocal ts=32" was
+ interfering with g:netrw_maxfilenamelen
+ May 05, 2008 * (James Vega) a file inside a linked directory
+ was showing up as a symbolic link itself.
+ May 22, 2008 * symbolic links, fifos, and sockets are now
+ indicated by a trailing @, |, or =, respectively.
+ Jun 06, 2008 * Removed numerous bugs from the marked file
+ move and copy. Tested these changes under
+ Unix only thus far.
+ * :Rexplore returns to the screen position in the
+ netrw listing from whence the file was edited
+ v124: Apr 02, 2008 * (Adrian Rollett) change the line supporting the
+ "x" action for mac to use g:netrw_shq
+ v123: Feb 27, 2008 * Marked files now keeps a "global" marked file
+ list. The global marked file list is used to
+ support tag processing and vimdiff'ing
+ (|netrw-md| |netrw-mt|)
+ * Been insuring that mm and mc works with various
+ combinations of local and remote directories
+ * (Stefan Bittner) http://.../ should always have
+ filetype "html" -- fixed.
+ * (Stefan Bittner) a "?" in a http://.../ request
+ wasn't being handled correctly. Fixed by
+ removing ? from default |g:netrw_tmpfile_escape|.
+ * (Nico Weber) % codes in http://.../ requests
+ weren't being handled correctly. Fixed by
+ including % in default |g:netrw_fname_escape|.
+ * (Stefan Bittner) attempts to update Buffers.Refresh
+ were failing because locale use changed the menu
+ names. I implemented a workaround.
+ v122: Feb 12, 2008 * bugfix - first sorting sequence match now has
+ priority
+ Feb 14, 2008 * bugfix - sorting sequence was effectively ignoring
+ sequencing priority of anything following '*'
+ * toggling a marked file was showing incorrect list
+ (list was correct, but displayed matches weren't)
+ * |g:netrw_special_syntax| implemented
+ v121: Feb 11, 2008 * Bram M reported that :e file ... :e . would not
+ retain the alternate file. Fixed -- I hope!
+ * bugfix -- apparently v120 broke an explicit
+ :Explore dirname
+ v120: Jan 21, 2008 * |netrw-mt| changed to allow for target selection
+ based on whether or not word under cursor is a
+ directory or file, or if cursor is in banner
+ area.
+ * |netrw-mh| included (hiding by marked-file suffix)
+ * functions moved about a bit (improved
+ categorization)
+ * executable files now displayed with trailing (*)
+ * symbolically linked files now displayed with
+ trailing (@)
+ * Somewhen, s:NetrwMarkFileMove() got damaged. Its
+ now restored (missing an endif, for example).
+ * |netrw-mu| implemented (unmarking marked files)
+ * many bugs have been removed from the marked file
+ system (tnx to Mark S. for feedback)
+ * |netrw-ms| implemented (sourcing marked files)
+ * fixed use of P with tree listing style
+ * multiple tree listing now supported
+ * ./ suppressed
+ * changed q -> qb (query bookmarks)
+ * implemented |netrw-qf|
+ * Explore now has four special list-generation
+ modes: */filepat **/filepat
+ *//pattern **//pattern
+ * gh (|netrw-gh|) is a shortcut for toggling the
+ hiding of files and directories beginning with a
+ dot
+ v119: Jan 10, 2008 * When g:netrw_keepdir is false,
+ NetrwOptionsRestore() had a problem
+ (Bill McCarthy)
+ Jan 11, 2008 * Netrw now shows symbolic links with a trailing
+ "@" and special highlighting.
+ Jan 15, 2008 * Changed g:netrw_noretmap -> |g:netrw_retmap|.
+ Changed: disabled by default at Bram's
+ preference.
+ v118: Jan 02, 2008 * Fixed a problem with Windows;
+ :Explore c:/path/ would not work,
+ but :Explore c:/path would.
+ * Fixed a bug in s:NetrwOptionRestore() - lcd's
+ argument wasn't being properly escaped so it
+ wouldn't handle spaces in directory names.
+ (Gary Johnson)
+ v117: Jan 02, 2008 * Fixed a problem with P; had to include
+ a b:netrw_curdir bypass (Bram Moolenaar)
+ v116: Nov 27, 2007 * netrw#LocalBrowseCheck() has &ft=="netrw"
+ check to prevent doing a directory listing
+ (was getting unexpected directory refreshes
+ in the middle of some function calls)
+ * NetrwOptionRestore moved after e! filename
+ in order to retain user options for editing
+ in s:NetrwBrowseChgDir()
+ Dec 12, 2007 * Bug fix -- netrw does a better job of retaining
+ user options when editing files under the aegis
+ of the browser
+ v115: Oct 04, 2007 * Erik Remmelzwaal pointed out that the use of
+ shellslash in s:GetTempfile() was incorrect
+ Oct 11, 2007 * Tracked down and eliminated a bug with editing
+ remote *.tar.gz and *.tar.bz2 files
+ Oct 11, 2007 * g:netrw_localmovecmd wasn't being initialized
+ properly, and g:netrw_localcopycmd was being
+ overwritten.
+ Oct 12, 2007 * Placed all :Rexplore and <2-leftmouse> setup
+ in a new support function (s:SetRexDir()).
+ Oct 15, 2007 * new: g:netrw_browse_split == 4; means <cr>
+ based selection will use previous window
+ Oct 20, 2007 * also checks on |'shellxquote'| to set g:netrw_shq
+ Oct 24, 2007 * Explore handles path/**/filename
+ Oct 27, 2007 * sourcing remote files often didn't work with ftp,
+ turns out that b:netrw_method was undefined, so
+ s:SaveBufVars and s:RestoreBufVars() fixed it.
+ v114: Sep 28, 2007 * mT, the map that invokes tags, has been improved
+ to support use of remote tags files.
+ Oct 02, 2007 * changed Netrw menu to use more submenus
+ v113: Sep 07, 2007 * worked out why the cursor position wasn't being
+ saved and restored as intended after doing such
+ things as deleting and renaming files.
+ Sep 11, 2007 * Fixed bug which effectively disabled <c-l> and
+ <c-h> maps
+ Sep 18, 2007 * there used to be one NetrwOptionRestore() call at
+ the end of the s:NetrwBrowseChgDir() function;
+ they're now at the end of every if..elseif..else
+ block. The edit-a-file one is not quite at the end
+ of its block; instead, its just before the edit.
+ Restores user options, then this new placement
+ allows ftplugins, autocmds, etc to change settings
+ (ex. ftplugin/cpp.vim sets cindent).
+ Sep 19, 2007 * changed all strlen() calls to use s:Strlen(), a
+ function which handles utf-8 wide characters
+ correctly.
+ Sep 20, 2007 * (Nico Weber) the "x" command has been extended
+ to Mac's OS/X (macunix); it now uses open to
+ handle |netrw-x| browsing with special files.
+ Sep 22, 2007 * Added g:netrw_noretmap to netrw at Tony M's
+ request.
+ * Included path to NetrwRemoteRmFile()
+ v112: Aug 18, 2007 * added mx (|netrw-mx|) for executing arbitrary
+ commands on marked files
+ Aug 22, 2007 * more option save/restore work for
+ s:NetrwBrowseChgDir(); s:NetrwOptionSave()
+ and s:NetrwOptionRestore() now take a parameter
+ specifying the type of variables to be used for
+ saving and restoring (either "w:" or "s:")
+ Sep 04, 2007 * added the :NetrwClean[!] command
+ v111: Jul 25, 2007 * using Windows but not using Cygwin, netrw does a
+ "file bufname" where the bufname uses /s
+ instead of \s; Vim "fixes" it by changing the
+ bufname to use \s anyway. This meant that
+ NetrwGetBuffer() didn't find the appropriately
+ named buffer, and so would generate a new
+ buffer listing; hence the cursor would appear
+ to have been moved when doing a preview.
+ * added <2-leftmouse> map to return to netrw's
+ browser display
+ Aug 16, 2007 * added the mark-file system, including
+ maps for mf mp mt mz and mu. Modifications
+ made to maps for a D O and R to support
+ marked files.
+ v110: May 10, 2007 * added [ and ] maps to NetrwTreeListing
+ May 25, 2007 * |g:netrw_preview| included
+ May 29, 2007 * modifed netrw#NetBrowseX to consistently use
+ |g:netrw_shq| instead of hardcoded quotes,
+ and modified the snippet that sets up redir
+ so Windows machines use "nul" instead of
+ "/dev/null".
+ Jun 01, 2007 * fixed bug -- NetGetBuffer() wasn't always
+ recognizing a buffer name match when it should,
+ thus resulting in [Scratch] buffers.
+ Jun 04, 2007 * Gary Johnson found a bugfix for the "c" mapping
+ when the directory is to be made current but
+ the name contains spaces.
v109: Mar 26, 2007 * if a directory name includes a "$" character,
Explore() will use expand() in an attempt to
decipher the name.
May 07, 2007 * g:netrw_use_errorwindow now allows one to
- have error messages go to a reliable window
+ have error messages go to a reliable window
or to use a less reliable but recallable
echoerr method
May 07, 2007 * g:netrw_scpport and g:netrw_sshport support
- use of -P and -p, respectively, to set port
+ use of -P and -p, respectively, to set port
for scp/ssh.
v108: Jan 03, 2007 * included preview map (|netrw-p|), supporting
remote browsing
@@ -1879,257 +2714,319 @@ which is loaded automatically at startup (assuming :set nocp).
v97: May 01, 2006 * exists("&acd") now used to determine if
the 'acd' option exists
* "obtain" now works again under Windows
- v96: * bugfix - the |'acd'| option is not always defined but is
- now bypassed only when it is
- v95: * bugfix - Hiding mode worked correctly (don't show any file
- matching any of the g:netrw_hide patterns), but
- showing mode was showing only those files that didn't
- match any of the g:netrw_hide patterns. Instead, it now
- shows all files that match any of the g:netrw_hide patterns
- (the difference between a logical and and logical or).
- v94: * bugfix - a Decho() had a missing quote; only affects things
- when debugging was enabled.
- v93: * bugfix - removed FocusGained event from causing a slow-browser
- refresh for Windows
- v92: * :Explore **//pattern implemented (**/filepattern already taken)
- 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.
- * <s-down> and <s-up> 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 <s-down>, <s-up>, :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.
- * Changed filetype for browser displays from netrwlist to netrw.
- v87: * bug fix -- menus were partially disappearing
- v85: * bug fix -- missing an endif
- * bug fix -- handles spaces in names and directories when using
- ftp-based browsing
- v83: * disabled stop-acd handling; the change in directory handling
- may allow acd to be used again. Awaiting feedback.
- * D was refusing to delete remote files/directories in wide
- listing mode.
- v81: * FocusGained also used to refresh/wipe local browser directory
- buffers
- * (bugfix) netrw was leaving [Scratch] buffers behind when the
- user had the "hidden" option set. The 'hidden' option is
- now bypassed.
- v80: * ShellCmdPost event used in conjunction with g:netrw_fastbrowse
- to refresh/wipe local browser directory buffers.
- v79: * directories are now displayed with nowrap
- * (bugfix) if the column width was smaller than the largest
- file's name, then netrw would hang when using wide-listing
- mode - fixed
- * g:netrw_fastbrowse introduced
- v78: * progress has been made on allowing spaces inside directory
- names for remote work (reading, writing, browsing). (scp)
- v77: * Mikolaj Machowski fixed a bug in a substitute command
- * g:netrw_browsex_viewer implemented
- * Mikolaj Machowski pointed out that gnome-open is often
- executable under KDE systems, although it is effectively
- not functional. NetBrowseX now looks for "kicker" as
- a running process to determine if KDE is actually the
- really running.
- * Explorer's O functionality was inadvertently left out.
- Netrw now does the same thing, but with the "P" key.
- * added g:netrw_browse_split option
- * fixed a bug where the directory contained a "." but
- the file didn't (was treating the dirname from "."
- onwards as a suffix)
- v76: * "directory is missing" error message now restores echo
- highlighting
- v75: * file://... now conforms to RFC2396 (thanks to S. Zacchiroli)
- * if the binary option is set, then NetWrite() will only write
- the whole file (line numbers don't make sense with this).
- Supports writing of tar and zip files.
- v74: * bugfix (vim, then :Explore) now works
- * ctrl-L keeps cursor at same screen location (both local and
- remote browsing)
- * netrw now can read remote zip and tar files
- * Obtain now uses WinXP ftp+.netrc successfully
- v73: * bugfix -- scp://host/path/file was getting named incorrectly
- * netrw detects use of earlier-than-7.0 version of vim and issues
- a pertinent error message.
- * netrwSettings.vim is now uses autoloading. Only
- <netrwPlugin.vim> is needed as a pure plugin
- (ie. always loaded).
- v72: * bugfix -- formerly, one could prevent the loading of netrw
- by "let g:loaded_netrw=1"; when autoloading became supported,
- this feature was lost. It is now restored.
- v71: * bugfix -- made some "set nomodifiable"s into setlocal variants
- (allows :e somenewfile to be modifiable as usual)
- * NetrwSettings calls a netrw function, thereby assuring that
- netrw has loaded. However, if netrw does not load for whatever
- reason, then NetrwSettings will now issue a warning message.
- * For what reason I don't recall, when wget and fetch are both
- not present, and an attempt to read a http://... url is made,
- netrw exited. It now only returns.
- * When ch=1, on the second and subsequent uses of browsing Netrw
- would issue a blank line to clear the echo'd messages. This
- caused an annoying "Hit-Enter" prompt; now a blank line message
- is echo'd only if &ch>1.
- v70: * when using |netrw-O|, the "Obtaining filename" message is now
- shown using |hl-User9|. If User9 has not been defined, netrw
- will define it.
- v69: * Bugfix: win95/98 machines were experiencing a
- "E121: Undefined variable: g:netrw_win95ftp" message
- v68: * double-click-leftmouse selects word under mouse
- v67: * Passwords which contain blanks will now be surrounded by
- double-quotes automatically (Yongwei)
- v66: * Netrw now seems to work with a few more Windows situations
- * O now obtains a file: remote browsing file -> local copy,
- locally browsing file -> current directory (see :pwd)
- * i now cycles between thin, long, and wide listing styles
- * NB and Nb are maps that are always available; corresponding
- B and b maps are only available when not using wide listing
- in order to allow them to be used for motions
- v65: * Browser functions now use NetOptionSave/Restore; in particular,
- netrw now works around the report setting
- v64: * Bugfix - browsing a "/" directory (Unix) yielded buffers
- named "[Scratch]" instead of "/"
- * Bugfix - remote browsing with ftp was omitting the ./ and ../
- v63: * netrw now takes advantage of autoload (and requires 7.0)
- * Bugfix - using r (to reverse sort) working again
- v62: * Bugfix - spaces allowed again in directory names with
- g:netrw_keepdir=0. In fact, I've tested netrw (again)
- with most ANSI punctuation marks for directory names.
- * Bugfix - NetrwSettings gave errors when g:netrw_silent
- had not be set.
- v61: * document upgrade -- netrw variable-based settings all should
- have tags. Supports NetrwSettings command.
- * several important variables are window-oriented. Netrw has
- to transfer these across a window split. See s:BufWinVars()
- and s:UseBufWinVars().
- v60: * when using the i map to switch between long and short listings,
- netrw will now keep cursor on same line
- * "Match # of #" now uses status line
- * :Explore **/*.c will now work from a non-netrw-browser window
- * :Explore **/patterns can now be run in separate browser windows
- * active banner (hit <cr> will cause various things to happen)
- v59: * bugfix -- another keepalt work-around installed (for vim6.3)
- * "Match # of #" for Explore **/pattern matches
- v58: * Explore and relatives can now handle **/somefilepattern (v7)
- * Nexplore and Pexplore introduced (v7). shift-down and shift-up
- cursor keys will invoke Nexplore and Pexplore, respectively.
- * bug fixed with o and v
- * autochdir only worked around for vim when it has been
- compiled with either |+netbeans_intg| or |+sun_workshop|
- * Under Windows, all directories and files were being preceded
- with a "/" when local browsing. Fixed.
- * When: syntax highlighting is off, laststatus=2, and remote
- browsing is used, sometimes the laststatus highlighting
- bleeds into the entire display. Work around - do an extra
- redraw in that case.
- * Bugfix: when g:netrw_keepdir=0, due to re-use of buffers,
- netrw didn't change the directory when it should've
- * Bugfix: D and R commands work again
- v57: * Explore and relatives can now handle RO files
- * reverse sort restored with vim7's sort command
- * g:netrw_keepdir now being used to keep the current directory
- unchanged as intended (sense change)
- * vim 6.3 still supported
- v56: * LocalBrowse now saves autochdir setting, unsets it, and
- restores it before returning.
- * using vim's rename() instead of system + local_rename variable
- * avoids changing directory when g:netrw_keepdir is false
- v55: * -bar used with :Explore :Sexplore etc to allow multiple
- commands to be separated by |s
- * browser listings now use the "nowrap" option
- * browser: some unuseful error messages now suppressed
- v54: * For backwards compatibility, Explore and Sexplore have been
- implemented. In addition, Hexplore and Vexplore commands
- are available, too.
- * <amatch> used instead of <afile> in the transparency
- support (BufReadCmd, FileReadCmd, FileWriteCmd)
- * ***netrw*** prepended to various error messages netrw may emit
- * g:netrw_port used instead of b:netrw_port for scp
- * any leading [:#] is removed from port numbers
- v53: * backslashes as well as slashes placed in various patterns
- (ex. g:netrw_sort_sequence) to better support Windows
- v52: * nonumber'ing now set for browsing buffers
- * when the hiding list hid all files, error messages ensued. Fixed
- * when browsing, swf is set, but directory is not set, when netrw
- was attempting to restore options, vim wanted to save a swapfile
- to a local directory using an url-style path. Fixed
- v51: * cygwin detection now automated (using windows and &shell is bash)
- * customizable browser "file" rejection patterns
- * directory history
- * :[range]w url now supported (ie. netrw has a FileWriteCmd event)
- * error messages have a "Press <cr> to continue" to allow them
- to be seen
- * directory browser displays no longer bother the swapfile
- * u/U commands to go up and down the history stack
- * history stack may be saved with viminfo with its "!" option
- * bugfixes associated with unwanted [No Files] entries
- v50: * directories now displayed using buftype=nofile; should keep the
- directory names as-is
- * attempts to remove empty "[No File]" buffers leftover
- from :file ..name.. commands
- * bugfix: a "caps-lock" editing difficulty left in v49 was fixed
- * syntax highlighting for "Showing:" the hiding list included
- * bookmarks can now be retained if "!" is in the viminfo option
- v49: * will use ftp for http://.../ browsing v48:
- * One may use ftp to do remote host file browsing
- * (windows and !cygwin) remote browsing with ftp can now use
- the "dir" command internally to provide listings
- * g:netrw_keepdir now allows one to keep the initial current
- directory as the current directory (normally the local file
- browser makes the currently viewed directory the current
- directory)
- * g:netrw_alto and g:netrw_altv now support alternate placement
- of windows started with o or v
- * Nread ? and Nwrite ? now uses echomsg (instead of echo) so
- :messages can repeat showing the help
- * bugfix: avoids problems with partial matches of directory names
- to prior buffers with longer names
- * one can suppress error messages with g:netrw_quiet ctrl-h used
- * instead of <Leader>h for editing hiding list one may edit the
- * sorting sequence with the S map now allows confirmation of
- * deletion with [y(es) n(o) a(ll) q(uit)] the "x" map now handles
- * special file viewing with:
- (windows) rundll32 url.dll (gnome) gnome-open (kde)
- kfmclient If none of these are on the executable path, then
- netrwFileHandlers.vim is used.
- * directory bookmarking during both local and remote browsing
- implemented
- * one may view all, use the hiding list to suppress, or use the
- hiding list to show-only remote and local file/directory
- listings
- * improved unusual file and directory name handling preview
- * window support
- v47: * now handles local directory browsing.
- v46: * now handles remote directory browsing
- * g:netrw_silent (if 1) will cause all transfers to be silent
- v45: * made the [user@]hostname:path form a bit more restrictive to
- better handle errors in using protocols (e.g. scp:usr@host:file
- was being recognized as an rcp request) v44: * changed from
- "rsync -a" to just "rsync"
- * somehow an editing error messed up the test to recognize
- use of the fetch method for NetRead.
- * more debugging statements included
- v43: * moved "Explanation" comments to <pi_netrw.txt> help file as
- "Network Reference" (|netrw-ref|)
- * <netrw.vim> now uses Dfunc() Decho() and Dret() for debugging
- * removed superfluous NetRestorePosn() calls
- v42: * now does BufReadPre and BufReadPost events on file:///* and
- file://localhost/* v41: * installed file:///* and
- file://localhost/* handling v40: * prevents redraw when a
- protocol error occurs so that the user may see it v39: * sftp
- support v38: * Now uses NetRestorePosn() calls with
- Nread/Nwrite commands
- * Temporary files now removed via bwipe! instead of bwipe
- (thanks to Dave Roberts) v37: * Claar's modifications which
- test if ftp is successful, otherwise give an error message
- * After a read, the alternate file was pointing to the temp file.
- The temp file buffer is now wiped out.
- * removed silent from transfer methods so user can see what's
- happening
+ v96: * bugfix - the |'acd'| option is not always defined
+ but is now bypassed only when it is
+ v95: * bugfix - Hiding mode worked correctly (don't show
+ any file matching any of the g:netrw_hide
+ patterns), but showing mode was showing only those
+ files that didn't match any of the g:netrw_hide
+ patterns. Instead, it now shows all files that
+ match any of the g:netrw_hide patterns (the
+ difference between a logical and and logical or).
+ v94: * bugfix - a Decho() had a missing quote; only
+ affects things when debugging was enabled.
+ v93: * bugfix - removed FocusGained event from causing a
+ slow-browser refresh for Windows
+ v92: * :Explore **//pattern implemented
+ (**/filepattern was already taken)
+ 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.
+ * <s-down> and <s-up> 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 <s-down>, <s-up>, :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 given by
+ g:NetrwMenuPriority.
+ * Changed filetype for browser displays from
+ netrwlist to netrw.
+ v87: * bug fix -- menus were partially disappearing
+ v85: * bug fix -- missing an endif
+ * bug fix -- handles spaces in names and directories
+ when using ftp-based browsing
+ v83: * disabled stop-acd handling; the change in directory
+ handling may allow acd to be used again.
+ * D was refusing to delete remote files/directories
+ in wide listing mode.
+ v81: * FocusGained also used to refresh/wipe local browser
+ directory buffers
+ * (bugfix) netrw was leaving [Scratch] buffers behind
+ when the user had the "hidden" option set. The
+ 'hidden' option is now bypassed.
+ v80: * ShellCmdPost event used in conjunction with
+ g:netrw_fastbrowse to refresh/wipe local browser
+ directory buffers.
+ v79: * directories are now displayed with nowrap
+ * (bugfix) if the column width was smaller than the
+ largest file's name, then netrw would hang when
+ using wide-listing mode - fixed
+ * g:netrw_fastbrowse introduced
+ v78: * progress has been made on allowing spaces inside
+ directory names for remote work (reading, writing,
+ browsing). (scp)
+ v77: * Mikolaj Machowski fixed a bug in a substitute cmd
+ * g:netrw_browsex_viewer implemented
+ * Mikolaj Machowski pointed out that gnome-open is
+ often executable under KDE systems, although it is
+ effectively not functional. NetBrowseX now looks
+ for "kicker" as a running process to determine if
+ KDE is actually running.
+ * Explorer's O functionality was inadvertently left
+ out. Netrw now does the same thing, but with the
+ "P" key.
+ * added g:netrw_browse_split option
+ * fixed a bug where the directory contained a "." but
+ the file didn't (was treating the dirname from "."
+ onwards as a suffix)
+ v76: * "directory is missing" error message now restores
+ echo highlighting
+ v75: * file://... now conforms to RFC2396 (thanks to
+ S. Zacchiroli)
+ * if the binary option is set, then NetWrite() will
+ only write the whole file (line numbers don't make
+ sense with this). Supports writing of tar and zip
+ files.
+ v74: * bugfix (vim, then :Explore) now works
+ * ctrl-L keeps cursor at same screen location (both
+ local and remote browsing)
+ * netrw now can read remote zip and tar files
+ * Obtain now uses WinXP ftp+.netrc successfully
+ v73: * bugfix -- scp://host/path/file was getting named
+ incorrectly
+ * netrw detects use of earlier-than-7.0 version of
+ vim and issues a pertinent error message.
+ * netrwSettings.vim is now uses autoloading. Only
+ <netrwPlugin.vim> is needed as a pure plugin
+ (ie. always loaded).
+ v72: * bugfix -- formerly, one could prevent the loading
+ of netrw by "let g:loaded_netrw=1"; when
+ autoloading became supported, this feature was
+ lost. It is now restored.
+ v71: * bugfix -- made some "set nomodifiable"s into
+ setlocal variants (allows :e somenewfile to be
+ modifiable as usual)
+ * NetrwSettings calls a netrw function, thereby
+ assuring that netrw has loaded. However, if netrw
+ does not load for whatever reason, then
+ NetrwSettings will now issue a warning message.
+ * For what reason I don't recall, when wget and fetch
+ are both not present, and an attempt to read a
+ http://... url is made, netrw exited. It now only
+ returns.
+ * When ch=1, on the second and subsequent uses of
+ browsing Netrw would issue a blank line to clear
+ the echo'd messages. This caused an annoying
+ "Hit-Enter" prompt; now a blank line message
+ is echo'd only if &ch>1.
+ v70: * when using |netrw-O|, the "Obtaining filename"
+ message is now shown using |hl-User9|. If User9
+ has not been defined, netrw itself will define it.
+ v69: * Bugfix: win95/98 machines were experiencing a
+ "E121: Undefined variable: g:netrw_win95ftp"
+ message
+ v68: * double-click-leftmouse selects word under mouse
+ v67: * Passwords which contain blanks will now be
+ surrounded by double-quotes automatically (Yongwei)
+ v66: * Netrw now seems to work with a few more Windows
+ situations
+ * O now obtains a file: remote browsing
+ file -> local copy, locally browsing
+ file -> current directory (see :pwd)
+ * i now cycles between thin, long, and wide listing
+ styles
+ * NB and Nb are maps that are always available;
+ corresponding B and b maps are only available when
+ not using wide listing in order to allow them to
+ be used for motions
+ v65: * Browser functions now use NetOptionSave/Restore; in
+ particular, netrw now works around the report
+ setting
+ v64: * Bugfix - browsing a "/" directory (Unix) yielded
+ buffers named "[Scratch]" instead of "/"
+ * Bugfix - remote browsing with ftp was omitting
+ the ./ and ../
+ v63: * netrw now takes advantage of autoload (needs 7.0)
+ * Bugfix - using r (to reverse sort) working again
+ v62: * Bugfix - spaces allowed again in directory names
+ with g:netrw_keepdir=0. In fact, I've tested netrw
+ with most ANSI punctuation marks for directory
+ names.
+ * Bugfix - NetrwSettings gave errors when
+ g:netrw_silent had not be set.
+ v61: * Document upgrade -- netrw variable-based settings
+ all should have tags. Supports NetrwSettings cmd.
+ * Several important variables are window-oriented.
+ Netrw has to transfer these across a window split.
+ See s:BufWinVars() and s:UseBufWinVars().
+ v60: * When using the i map to switch between long and
+ short listings, netrw will now keep cursor on same
+ line
+ * "Match # of #" now uses status line
+ * :Explore **/*.c will now work from a
+ non-netrw-browser window
+ * :Explore **/patterns can now be run in separate
+ browser windows
+ * active banner (hit <cr> will cause various things
+ to happen)
+ v59: * bugfix -- another keepalt work-around installed
+ (for vim6.3)
+ * "Match # of #" for Explore **/pattern matches
+ v58: * Explore and relatives can now handle
+ **/somefilepattern (v7)
+ * Nexplore and Pexplore introduced (v7). shift-down
+ and shift-up cursor keys will invoke Nexplore and
+ Pexplore, respectively.
+ * bug fixed with o and v
+ * autochdir only worked around for vim when it has
+ been compiled with either
+ |+netbeans_intg| or |+sun_workshop|
+ * Under Windows, all directories and files were
+ being preceded with a "/" when local browsing.
+ Fixed.
+ * When: syntax highlighting is off, laststatus=2, and
+ remote browsing is used, sometimes the laststatus
+ highlighting bleeds into the entire display. Work
+ around - do an extra redraw in that case.
+ * Bugfix: when g:netrw_keepdir=0, due to re-use of
+ buffers, netrw didn't change the directory when it
+ should've
+ * Bugfix: D and R commands work again
+ v57: * Explore and relatives can now handle RO files
+ * reverse sort restored with vim7's sort command
+ * g:netrw_keepdir now being used to keep the current
+ directory unchanged as intended (sense change)
+ * vim 6.3 still supported
+ v56: * LocalBrowse now saves autochdir setting, unsets it,
+ and restores it before returning.
+ * using vim's rename() instead of system +
+ local_rename variable
+ * avoids changing directory when g:netrw_keepdir is
+ false
+ v55: * -bar used with :Explore :Sexplore etc to allow
+ multiple commands to be separated by |s
+ * browser listings now use the "nowrap" option
+ * browser: some unuseful error messages now
+ suppressed
+ v54: * For backwards compatibility, Explore and Sexplore
+ have been implemented. In addition, Hexplore and
+ Vexplore commands are available, too.
+ * <amatch> used instead of <afile> in the
+ transparency support (BufReadCmd, FileReadCmd,
+ FileWriteCmd)
+ * ***netrw*** prepended to various error messages
+ netrw may emit
+ * g:netrw_port used instead of b:netrw_port for scp
+ * any leading [:#] is removed from port numbers
+ v53: * backslashes as well as slashes placed in various
+ patterns (ex. g:netrw_sort_sequence) to better
+ support Windows
+ v52: * nonumber'ing now set for browsing buffers
+ * when the hiding list hid all files, error messages
+ ensued. Fixed
+ * when browsing, swf is set, but directory is not
+ set, when netrw was attempting to restore options,
+ vim wanted to save a swapfile to a local directory
+ using an url-style path. Fixed
+ v51: * cygwin detection now automated
+ (using windows and &shell is bash)
+ * customizable browser "file" rejection patterns
+ * directory history
+ * :[range]w url now supported (ie. netrw uses a
+ FileWriteCmd event)
+ * error messages have a "Press <cr> to continue" to
+ allow them to be seen
+ * directory browser displays no longer bother the
+ swapfile
+ * u/U commands to go up and down the history stack
+ * history stack may be saved with viminfo with it's
+ "!" option
+ * bugfixes associated with unwanted [No Files]
+ entries
+ v50: * directories now displayed using buftype=nofile;
+ should keep the directory names as-is
+ * attempts to remove empty "[No File]" buffers
+ leftover from :file ..name.. commands
+ * bugfix: a "caps-lock" editing difficulty left in
+ v49 was fixed
+ * syntax highlighting for "Showing:" the hiding list
+ included
+ * bookmarks can now be retained if "!" is in the
+ viminfo option
+ v49: * will use ftp for http://.../ browsing
+ v48: * One may use ftp to do remote host file browsing
+ * (windows and !cygwin) remote browsing with ftp can
+ now use the "dir" command internally to provide
+ listings
+ * g:netrw_keepdir now allows one to keep the initial
+ current directory as the current directory
+ (normally the local file browser makes the
+ currently viewed directory the current directory)
+ * g:netrw_alto and g:netrw_altv now support
+ alternate placement of windows started with o or v
+ * Nread ? and Nwrite ? now uses echomsg (instead of
+ echo) so :messages can repeat showing the help
+ * bugfix: avoids problems with partial matches of
+ directory names to prior buffers with longer names
+ * one can suppress error messages with g:netrw_quiet
+ ctrl-h used
+ * instead of <Leader>h for editing hiding list one
+ may edit the sorting sequence with the S map, which
+ now allows confirmation of deletion with
+ [y(es) n(o) a(ll) q(uit)]
+ * the "x" map now handles special file viewing with:
+ (windows) rundll32 url.dll (gnome) gnome-open (kde)
+ kfmclient If none of these are on the executable
+ path, then netrwFileHandlers.vim is used.
+ * directory bookmarking during both local and remote
+ browsing implemented
+ * one may view all, use the hiding list to suppress,
+ or use the hiding list to show-only remote and
+ local file/directory listings
+ * improved unusual file and directory name handling
+ preview window support
+ v47: * now handles local browsing.
+ v46: * now handles remote browsing
+ * g:netrw_silent (if 1) will cause all transfers to
+ be silent
+ v45: * made the [user@]hostname:path form a bit more
+ restrictive to better handle errors in using
+ protocols (e.g. scp:usr@host:file was being
+ recognized as an rcp request)
+ v44: * changed from "rsync -a" to just "rsync"
+ * somehow an editing error messed up the test to
+ recognize use of the fetch method for NetRead.
+ * more debugging statements included
+ v43: * moved "Explanation" comments to <pi_netrw.txt> help
+ file as "Network Reference" (|netrw-ref|)
+ * <netrw.vim> now uses Dfunc() Decho() and Dret() for
+ debugging
+ * removed superfluous NetRestorePosn() calls
+ v42: * now does BufReadPre and BufReadPost events on
+ file:///* and file://localhost/*
+ v41: * installed file:///* and file://localhost/* handling
+ v40: * prevents redraw when a protocol error occurs so
+ that the user may see it
+ v39: * sftp support
+ v38: * Now uses NetRestorePosn() calls with Nread/Nwrite
+ commands
+ * Temporary files now removed via bwipe! instead of
+ bwipe (thanks to Dave Roberts)
+ v37: * Claar's modifications which test if ftp is
+ successful, otherwise give an error message
+ * After a read, the alternate file was pointing to
+ the temp file. The temp file buffer is now wiped
+ out.
+ * removed silent from transfer methods so user can
+ see what's happening
==============================================================================
@@ -2157,4 +3054,5 @@ which is loaded automatically at startup (assuming :set nocp).
operation
==============================================================================
+Modelines: {{{1
vim:tw=78:ts=8:ft=help:norl:fdm=marker
diff --git a/runtime/doc/pi_paren.txt b/runtime/doc/pi_paren.txt
index 53239f74..81053279 100644
--- a/runtime/doc/pi_paren.txt
+++ b/runtime/doc/pi_paren.txt
@@ -1,4 +1,4 @@
-*pi_paren.txt* For Vim version 7.1. Last change: 2006 Jun 14
+*pi_paren.txt* For Vim version 7.2a. Last change: 2008 Jun 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -15,6 +15,7 @@ You can avoid loading this plugin by setting the "loaded_matchparen" variable: >
The plugin installs CursorMoved, CursorMovedI and WinEnter autocommands to
redefine the match highlighting.
+ *:NoMatchParen* *:DoMatchParen*
To disable the plugin after it was loaded use this command: >
:NoMatchParen
@@ -46,5 +47,11 @@ are:
- 'synmaxcol' times 2 bytes before or after the cursor to avoid a delay
in a long line with syntax highlighting.
+
+If you would like the |%| command to work better, the matchit plugin can be
+used, see |matchit-install|. This plugin also helps to skip matches in
+comments. This is unrelated to the matchparen highlighting, they use a
+different mechanism.
+
==============================================================================
vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/doc/quotes.txt b/runtime/doc/quotes.txt
index 2c5f13b6..07b21261 100644
--- a/runtime/doc/quotes.txt
+++ b/runtime/doc/quotes.txt
@@ -1,4 +1,4 @@
-*quotes.txt* For Vim version 7.1. Last change: 2006 Apr 24
+*quotes.txt* For Vim version 7.2a. Last change: 2006 Apr 24
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/recover.txt b/runtime/doc/recover.txt
index 063a0d55..578c8011 100644
--- a/runtime/doc/recover.txt
+++ b/runtime/doc/recover.txt
@@ -1,4 +1,4 @@
-*recover.txt* For Vim version 7.1. Last change: 2006 Apr 24
+*recover.txt* For Vim version 7.2a. Last change: 2006 Apr 24
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/rileft.txt b/runtime/doc/rileft.txt
index efe80c13..d270740e 100644
--- a/runtime/doc/rileft.txt
+++ b/runtime/doc/rileft.txt
@@ -1,4 +1,4 @@
-*rileft.txt* For Vim version 7.1. Last change: 2006 Apr 24
+*rileft.txt* For Vim version 7.2a. Last change: 2006 Apr 24
VIM REFERENCE MANUAL by Avner Lottem
diff --git a/runtime/doc/russian.txt b/runtime/doc/russian.txt
index 6887bc65..dabca428 100644
--- a/runtime/doc/russian.txt
+++ b/runtime/doc/russian.txt
@@ -1,4 +1,4 @@
-*russian.txt* For Vim version 7.1. Last change: 2006 Apr 24
+*russian.txt* For Vim version 7.2a. Last change: 2006 Apr 24
VIM REFERENCE MANUAL by Vassily Ragosin
diff --git a/runtime/doc/sign.txt b/runtime/doc/sign.txt
index b926136a..5434279e 100644
--- a/runtime/doc/sign.txt
+++ b/runtime/doc/sign.txt
@@ -1,4 +1,4 @@
-*sign.txt* For Vim version 7.1. Last change: 2006 Apr 24
+*sign.txt* For Vim version 7.2a. Last change: 2006 Apr 24
VIM REFERENCE MANUAL by Gordon Prieur
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 73930066..4f94fe53 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -702,8 +702,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'qe' options.txt /*'qe'*
'quote motion.txt /*'quote*
'quoteescape' options.txt /*'quoteescape'*
+'rdt' options.txt /*'rdt'*
'readonly' options.txt /*'readonly'*
'redraw' vi_diff.txt /*'redraw'*
+'redrawtime' options.txt /*'redrawtime'*
'remap' options.txt /*'remap'*
'report' options.txt /*'report'*
'restorescreen' options.txt /*'restorescreen'*
@@ -1114,6 +1116,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
+feature-list various.txt /*+feature-list*
+file_in_path various.txt /*+file_in_path*
+find_in_path various.txt /*+find_in_path*
++float various.txt /*+float*
+folding various.txt /*+folding*
+footer various.txt /*+footer*
+fork various.txt /*+fork*
@@ -1138,6 +1141,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
+mouse_gpm various.txt /*+mouse_gpm*
+mouse_netterm various.txt /*+mouse_netterm*
+mouse_pterm various.txt /*+mouse_pterm*
++mouse_sysmouse various.txt /*+mouse_sysmouse*
+mouse_xterm various.txt /*+mouse_xterm*
+mouseshape various.txt /*+mouseshape*
+multi_byte various.txt /*+multi_byte*
@@ -1227,6 +1231,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
--servername remote.txt /*--servername*
--socketid starting.txt /*--socketid*
--version starting.txt /*--version*
+--windowid starting.txt /*--windowid*
-A starting.txt /*-A*
-C starting.txt /*-C*
-D starting.txt /*-D*
@@ -1317,6 +1322,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
/ pattern.txt /*\/*
/$ pattern.txt /*\/$*
/. pattern.txt /*\/.*
+// version7.txt /*\/\/*
//; pattern.txt /*\/\/;*
/<CR> pattern.txt /*\/<CR>*
/[[. pattern.txt /*\/[[.*
@@ -1734,29 +1740,33 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:@ repeat.txt /*:@*
:@: repeat.txt /*:@:*
:@@ repeat.txt /*:@@*
-:AdaLines ada.txt /*:AdaLines*
-:AdaRainbow ada.txt /*:AdaRainbow*
-:AdaSpaces ada.txt /*:AdaSpaces*
-:AdaTagDir ada.txt /*:AdaTagDir*
-:AdaTagFile ada.txt /*:AdaTagFile*
-:AdaTypes ada.txt /*:AdaTypes*
+:AdaLines ft_ada.txt /*:AdaLines*
+:AdaRainbow ft_ada.txt /*:AdaRainbow*
+:AdaSpaces ft_ada.txt /*:AdaSpaces*
+:AdaTagDir ft_ada.txt /*:AdaTagDir*
+:AdaTagFile ft_ada.txt /*:AdaTagFile*
+:AdaTypes ft_ada.txt /*:AdaTypes*
:CompilerSet usr_41.txt /*:CompilerSet*
:DiffOrig diff.txt /*:DiffOrig*
+:DoMatchParen pi_paren.txt /*:DoMatchParen*
:Explore pi_netrw.txt /*:Explore*
:GLVS pi_getscript.txt /*:GLVS*
:GetLatestVimScripts_dat pi_getscript.txt /*:GetLatestVimScripts_dat*
-:GnatFind ada.txt /*:GnatFind*
-:GnatPretty ada.txt /*:GnatPretty*
-:GnatTags ada.txt /*:GnatTags*
+:GnatFind ft_ada.txt /*:GnatFind*
+:GnatPretty ft_ada.txt /*:GnatPretty*
+:GnatTags ft_ada.txt /*:GnatTags*
:Hexplore pi_netrw.txt /*:Hexplore*
:Man filetype.txt /*:Man*
:MkVimball pi_vimball.txt /*:MkVimball*
:N editing.txt /*:N*
+:NetrwClean pi_netrw.txt /*:NetrwClean*
:Nexplore pi_netrw.txt /*:Nexplore*
:Next editing.txt /*:Next*
+:NoMatchParen pi_paren.txt /*:NoMatchParen*
:P various.txt /*:P*
:Pexplore pi_netrw.txt /*:Pexplore*
:Print various.txt /*:Print*
+:Rexplore pi_netrw.txt /*:Rexplore*
:RmVimball pi_vimball.txt /*:RmVimball*
:Sexplore pi_netrw.txt /*:Sexplore*
:TOhtml syntax.txt /*:TOhtml*
@@ -2153,6 +2163,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:highlight-link syntax.txt /*:highlight-link*
:highlight-normal syntax.txt /*:highlight-normal*
:highlight-verbose syntax.txt /*:highlight-verbose*
+:his cmdline.txt /*:his*
:history cmdline.txt /*:history*
:history-indexing cmdline.txt /*:history-indexing*
:i insert.txt /*:i*
@@ -4079,8 +4090,18 @@ E794 eval.txt /*E794*
E795 eval.txt /*E795*
E796 editing.txt /*E796*
E797 spell.txt /*E797*
+E798 eval.txt /*E798*
+E799 eval.txt /*E799*
E80 message.txt /*E80*
E800 arabic.txt /*E800*
+E801 eval.txt /*E801*
+E802 eval.txt /*E802*
+E803 eval.txt /*E803*
+E804 eval.txt /*E804*
+E805 eval.txt /*E805*
+E806 eval.txt /*E806*
+E807 eval.txt /*E807*
+E808 eval.txt /*E808*
E81 map.txt /*E81*
E82 message.txt /*E82*
E83 message.txt /*E83*
@@ -4129,6 +4150,7 @@ FilterReadPost autocmd.txt /*FilterReadPost*
FilterReadPre autocmd.txt /*FilterReadPre*
FilterWritePost autocmd.txt /*FilterWritePost*
FilterWritePre autocmd.txt /*FilterWritePre*
+Float eval.txt /*Float*
FocusGained autocmd.txt /*FocusGained*
FocusLost autocmd.txt /*FocusLost*
Folding fold.txt /*Folding*
@@ -4161,6 +4183,7 @@ Japanese mbyte.txt /*Japanese*
K various.txt /*K*
KDE gui_x11.txt /*KDE*
KVim gui_x11.txt /*KVim*
+Kibaale uganda.txt /*Kibaale*
Korean mbyte.txt /*Korean*
L motion.txt /*L*
Linux-backspace options.txt /*Linux-backspace*
@@ -4195,6 +4218,7 @@ Normal intro.txt /*Normal*
Normal-mode intro.txt /*Normal-mode*
Nread pi_netrw.txt /*Nread*
Nsource pi_netrw.txt /*Nsource*
+Number eval.txt /*Number*
Nvi intro.txt /*Nvi*
Nwrite pi_netrw.txt /*Nwrite*
O insert.txt /*O*
@@ -4266,6 +4290,7 @@ Q_vm quickref.txt /*Q_vm*
Q_wi quickref.txt /*Q_wi*
Q_wq quickref.txt /*Q_wq*
QuickFixCmdPost autocmd.txt /*QuickFixCmdPost*
+QuickFixCmdPost-example quickfix.txt /*QuickFixCmdPost-example*
QuickFixCmdPre autocmd.txt /*QuickFixCmdPre*
Quickfix quickfix.txt /*Quickfix*
R change.txt /*R*
@@ -4279,7 +4304,7 @@ Ruby if_ruby.txt /*Ruby*
Russian russian.txt /*Russian*
S change.txt /*S*
SHELL starting.txt /*SHELL*
-SQLSetType sql.txt /*SQLSetType*
+SQLSetType ft_sql.txt /*SQLSetType*
Select visual.txt /*Select*
Select-mode visual.txt /*Select-mode*
Select-mode-mapping visual.txt /*Select-mode-mapping*
@@ -4298,7 +4323,7 @@ Syntax autocmd.txt /*Syntax*
T motion.txt /*T*
TCL if_tcl.txt /*TCL*
TERM starting.txt /*TERM*
-TSQL sql.txt /*TSQL*
+TSQL ft_sql.txt /*TSQL*
TTpro-telnet syntax.txt /*TTpro-telnet*
Tab intro.txt /*Tab*
TabEnter autocmd.txt /*TabEnter*
@@ -4306,7 +4331,7 @@ TabLeave autocmd.txt /*TabLeave*
Tcl if_tcl.txt /*Tcl*
TermChanged autocmd.txt /*TermChanged*
TermResponse autocmd.txt /*TermResponse*
-Transact-SQL sql.txt /*Transact-SQL*
+Transact-SQL ft_sql.txt /*Transact-SQL*
U undo.txt /*U*
UTF-8 mbyte.txt /*UTF-8*
UTF8-xterm mbyte.txt /*UTF8-xterm*
@@ -4484,18 +4509,18 @@ ab motion.txt /*ab*
abandon editing.txt /*abandon*
abbreviations map.txt /*abbreviations*
abel.vim syntax.txt /*abel.vim*
+abs() eval.txt /*abs()*
active-buffer windows.txt /*active-buffer*
-ada#Create_Tags() ada.txt /*ada#Create_Tags()*
-ada#Jump_Tag() ada.txt /*ada#Jump_Tag()*
-ada#Listtags() ada.txt /*ada#Listtags()*
-ada#Switch_Syntax_Option() ada.txt /*ada#Switch_Syntax_Option()*
-ada#Word() ada.txt /*ada#Word()*
-ada-compiler ada.txt /*ada-compiler*
-ada-ctags ada.txt /*ada-ctags*
-ada-extra-plugins ada.txt /*ada-extra-plugins*
-ada-reference ada.txt /*ada-reference*
-ada.txt ada.txt /*ada.txt*
-ada.vim ada.txt /*ada.vim*
+ada#Create_Tags() ft_ada.txt /*ada#Create_Tags()*
+ada#Jump_Tag() ft_ada.txt /*ada#Jump_Tag()*
+ada#Listtags() ft_ada.txt /*ada#Listtags()*
+ada#Switch_Syntax_Option() ft_ada.txt /*ada#Switch_Syntax_Option()*
+ada#Word() ft_ada.txt /*ada#Word()*
+ada-compiler ft_ada.txt /*ada-compiler*
+ada-ctags ft_ada.txt /*ada-ctags*
+ada-extra-plugins ft_ada.txt /*ada-extra-plugins*
+ada-reference ft_ada.txt /*ada-reference*
+ada.vim ft_ada.txt /*ada.vim*
add() eval.txt /*add()*
add-filetype-plugin usr_05.txt /*add-filetype-plugin*
add-global-plugin usr_05.txt /*add-global-plugin*
@@ -4515,6 +4540,7 @@ added-6.2 version6.txt /*added-6.2*
added-6.3 version6.txt /*added-6.3*
added-6.4 version6.txt /*added-6.4*
added-7.1 version7.txt /*added-7.1*
+added-7.2 version7.txt /*added-7.2*
added-BeOS version5.txt /*added-BeOS*
added-Mac version5.txt /*added-Mac*
added-VMS version5.txt /*added-VMS*
@@ -4551,6 +4577,7 @@ asm.vim syntax.txt /*asm.vim*
asm68k syntax.txt /*asm68k*
asmh8300.vim syntax.txt /*asmh8300.vim*
at motion.txt /*at*
+atan() eval.txt /*atan()*
athena-intellimouse gui.txt /*athena-intellimouse*
attr-list syntax.txt /*attr-list*
author intro.txt /*author*
@@ -4742,6 +4769,7 @@ catch-interrupt eval.txt /*catch-interrupt*
catch-order eval.txt /*catch-order*
catch-text eval.txt /*catch-text*
cc change.txt /*cc*
+ceil() eval.txt /*ceil()*
ch.vim syntax.txt /*ch.vim*
change-list-jumps motion.txt /*change-list-jumps*
change-tabs change.txt /*change-tabs*
@@ -4759,6 +4787,7 @@ changed-6.2 version6.txt /*changed-6.2*
changed-6.3 version6.txt /*changed-6.3*
changed-6.4 version6.txt /*changed-6.4*
changed-7.1 version7.txt /*changed-7.1*
+changed-7.2 version7.txt /*changed-7.2*
changelist motion.txt /*changelist*
changelog.vim syntax.txt /*changelog.vim*
changenr() eval.txt /*changenr()*
@@ -4771,12 +4800,14 @@ characterwise-register change.txt /*characterwise-register*
characterwise-visual visual.txt /*characterwise-visual*
charconvert_from-variable eval.txt /*charconvert_from-variable*
charconvert_to-variable eval.txt /*charconvert_to-variable*
+charity uganda.txt /*charity*
charset mbyte.txt /*charset*
charset-conversion mbyte.txt /*charset-conversion*
chill.vim syntax.txt /*chill.vim*
cindent() eval.txt /*cindent()*
cinkeys-format indent.txt /*cinkeys-format*
cinoptions-values indent.txt /*cinoptions-values*
+clearmatches() eval.txt /*clearmatches()*
client-server remote.txt /*client-server*
clientserver remote.txt /*clientserver*
clipboard gui.txt /*clipboard*
@@ -4809,16 +4840,17 @@ compatible-default starting.txt /*compatible-default*
compile-changes-5 version5.txt /*compile-changes-5*
compile-changes-6 version6.txt /*compile-changes-6*
compile-changes-7 version7.txt /*compile-changes-7*
-compiler-compaqada ada.txt /*compiler-compaqada*
-compiler-decada ada.txt /*compiler-decada*
+compiler-compaqada ft_ada.txt /*compiler-compaqada*
+compiler-decada ft_ada.txt /*compiler-decada*
compiler-gcc quickfix.txt /*compiler-gcc*
-compiler-gnat ada.txt /*compiler-gnat*
-compiler-hpada ada.txt /*compiler-hpada*
+compiler-gnat ft_ada.txt /*compiler-gnat*
+compiler-hpada ft_ada.txt /*compiler-hpada*
compiler-manx quickfix.txt /*compiler-manx*
+compiler-perl quickfix.txt /*compiler-perl*
compiler-pyunit quickfix.txt /*compiler-pyunit*
compiler-select quickfix.txt /*compiler-select*
compiler-tex quickfix.txt /*compiler-tex*
-compiler-vaxada ada.txt /*compiler-vaxada*
+compiler-vaxada ft_ada.txt /*compiler-vaxada*
compl-current insert.txt /*compl-current*
compl-define insert.txt /*compl-define*
compl-dictionary insert.txt /*compl-dictionary*
@@ -4855,6 +4887,7 @@ copy-diffs diff.txt /*copy-diffs*
copy-move change.txt /*copy-move*
copying uganda.txt /*copying*
copyright uganda.txt /*copyright*
+cos() eval.txt /*cos()*
count intro.txt /*count*
count() eval.txt /*count()*
count-bytes tips.txt /*count-bytes*
@@ -4983,6 +5016,7 @@ dab motion.txt /*dab*
dap motion.txt /*dap*
das motion.txt /*das*
dav pi_netrw.txt /*dav*
+davs pi_netrw.txt /*davs*
daw motion.txt /*daw*
dd change.txt /*dd*
debug-gcc debug.txt /*debug-gcc*
@@ -5002,7 +5036,7 @@ debugger-integration debugger.txt /*debugger-integration*
debugger-support debugger.txt /*debugger-support*
debugger.txt debugger.txt /*debugger.txt*
dec-mouse options.txt /*dec-mouse*
-decada_members ada.txt /*decada_members*
+decada_members ft_ada.txt /*decada_members*
deepcopy() eval.txt /*deepcopy()*
definition-search tagsrch.txt /*definition-search*
definitions intro.txt /*definitions*
@@ -5132,6 +5166,7 @@ errorformat-javac quickfix.txt /*errorformat-javac*
errorformat-multi-line quickfix.txt /*errorformat-multi-line*
errorformat-separate-filename quickfix.txt /*errorformat-separate-filename*
errorformats quickfix.txt /*errorformats*
+errors message.txt /*errors*
escape intro.txt /*escape*
escape() eval.txt /*escape()*
escape-bar version4.txt /*escape-bar*
@@ -5292,11 +5327,17 @@ fixed-6.2 version6.txt /*fixed-6.2*
fixed-6.3 version6.txt /*fixed-6.3*
fixed-6.4 version6.txt /*fixed-6.4*
fixed-7.1 version7.txt /*fixed-7.1*
+fixed-7.2 version7.txt /*fixed-7.2*
flexwiki.vim syntax.txt /*flexwiki.vim*
+float2nr() eval.txt /*float2nr()*
+floating-point-format eval.txt /*floating-point-format*
+floating-point-precision eval.txt /*floating-point-precision*
+floor() eval.txt /*floor()*
fname_diff-variable eval.txt /*fname_diff-variable*
fname_in-variable eval.txt /*fname_in-variable*
fname_new-variable eval.txt /*fname_new-variable*
fname_out-variable eval.txt /*fname_out-variable*
+fnameescape() eval.txt /*fnameescape()*
fnamemodify() eval.txt /*fnamemodify()*
fo-table change.txt /*fo-table*
fold-behavior fold.txt /*fold-behavior*
@@ -5336,18 +5377,17 @@ format-comments change.txt /*format-comments*
formatting change.txt /*formatting*
formfeed intro.txt /*formfeed*
fortran.vim syntax.txt /*fortran.vim*
-french-maillist intro.txt /*french-maillist*
frombook usr_01.txt /*frombook*
ft-abel-syntax syntax.txt /*ft-abel-syntax*
-ft-ada-commands ada.txt /*ft-ada-commands*
-ft-ada-constants ada.txt /*ft-ada-constants*
-ft-ada-functions ada.txt /*ft-ada-functions*
-ft-ada-indent ada.txt /*ft-ada-indent*
-ft-ada-omni ada.txt /*ft-ada-omni*
-ft-ada-options ada.txt /*ft-ada-options*
-ft-ada-plugin ada.txt /*ft-ada-plugin*
-ft-ada-syntax ada.txt /*ft-ada-syntax*
-ft-ada-variables ada.txt /*ft-ada-variables*
+ft-ada-commands ft_ada.txt /*ft-ada-commands*
+ft-ada-constants ft_ada.txt /*ft-ada-constants*
+ft-ada-functions ft_ada.txt /*ft-ada-functions*
+ft-ada-indent ft_ada.txt /*ft-ada-indent*
+ft-ada-omni ft_ada.txt /*ft-ada-omni*
+ft-ada-options ft_ada.txt /*ft-ada-options*
+ft-ada-plugin ft_ada.txt /*ft-ada-plugin*
+ft-ada-syntax ft_ada.txt /*ft-ada-syntax*
+ft-ada-variables ft_ada.txt /*ft-ada-variables*
ft-ant-syntax syntax.txt /*ft-ant-syntax*
ft-apache-syntax syntax.txt /*ft-apache-syntax*
ft-asm-syntax syntax.txt /*ft-asm-syntax*
@@ -5384,6 +5424,7 @@ ft-fortran-indent indent.txt /*ft-fortran-indent*
ft-fortran-plugin filetype.txt /*ft-fortran-plugin*
ft-fortran-syntax syntax.txt /*ft-fortran-syntax*
ft-fvwm-syntax syntax.txt /*ft-fvwm-syntax*
+ft-gitcommit-plugin filetype.txt /*ft-gitcommit-plugin*
ft-groff-syntax syntax.txt /*ft-groff-syntax*
ft-gsp-syntax syntax.txt /*ft-gsp-syntax*
ft-haskell-syntax syntax.txt /*ft-haskell-syntax*
@@ -5417,6 +5458,7 @@ ft-nroff-syntax syntax.txt /*ft-nroff-syntax*
ft-ocaml-syntax syntax.txt /*ft-ocaml-syntax*
ft-papp-syntax syntax.txt /*ft-papp-syntax*
ft-pascal-syntax syntax.txt /*ft-pascal-syntax*
+ft-pdf-plugin filetype.txt /*ft-pdf-plugin*
ft-perl-syntax syntax.txt /*ft-perl-syntax*
ft-php-omni insert.txt /*ft-php-omni*
ft-php-syntax syntax.txt /*ft-php-syntax*
@@ -5456,6 +5498,7 @@ ft-tex-syntax syntax.txt /*ft-tex-syntax*
ft-tf-syntax syntax.txt /*ft-tf-syntax*
ft-vb-syntax syntax.txt /*ft-vb-syntax*
ft-verilog-indent indent.txt /*ft-verilog-indent*
+ft-vhdl-indent indent.txt /*ft-vhdl-indent*
ft-vim-indent indent.txt /*ft-vim-indent*
ft-vim-syntax syntax.txt /*ft-vim-syntax*
ft-xf86conf-syntax syntax.txt /*ft-xf86conf-syntax*
@@ -5463,6 +5506,8 @@ ft-xhtml-omni insert.txt /*ft-xhtml-omni*
ft-xml-omni insert.txt /*ft-xml-omni*
ft-xml-syntax syntax.txt /*ft-xml-syntax*
ft-xpm-syntax syntax.txt /*ft-xpm-syntax*
+ft_ada.txt ft_ada.txt /*ft_ada.txt*
+ft_sql.txt ft_sql.txt /*ft_sql.txt*
ftdetect filetype.txt /*ftdetect*
ftp pi_netrw.txt /*ftp*
ftplugin usr_41.txt /*ftplugin*
@@ -5476,6 +5521,7 @@ function-argument eval.txt /*function-argument*
function-key intro.txt /*function-key*
function-list usr_41.txt /*function-list*
function-range-example eval.txt /*function-range-example*
+function-search-undo eval.txt /*function-search-undo*
function_key intro.txt /*function_key*
functions eval.txt /*functions*
fvwm.vim syntax.txt /*fvwm.vim*
@@ -5493,54 +5539,59 @@ g- undo.txt /*g-*
g0 motion.txt /*g0*
g8 various.txt /*g8*
g:NetrwTopLvlMenu pi_netrw.txt /*g:NetrwTopLvlMenu*
-g:ada#Comment ada.txt /*g:ada#Comment*
-g:ada#Ctags_Kinds ada.txt /*g:ada#Ctags_Kinds*
-g:ada#DotWordRegex ada.txt /*g:ada#DotWordRegex*
-g:ada#Keywords ada.txt /*g:ada#Keywords*
-g:ada#WordRegex ada.txt /*g:ada#WordRegex*
-g:ada_abbrev ada.txt /*g:ada_abbrev*
-g:ada_all_tab_usage ada.txt /*g:ada_all_tab_usage*
-g:ada_begin_preproc ada.txt /*g:ada_begin_preproc*
-g:ada_default_compiler ada.txt /*g:ada_default_compiler*
-g:ada_extended_completion ada.txt /*g:ada_extended_completion*
-g:ada_extended_tagging ada.txt /*g:ada_extended_tagging*
-g:ada_folding ada.txt /*g:ada_folding*
-g:ada_gnat_extensions ada.txt /*g:ada_gnat_extensions*
-g:ada_line_errors ada.txt /*g:ada_line_errors*
-g:ada_no_tab_space_error ada.txt /*g:ada_no_tab_space_error*
-g:ada_no_trail_space_error ada.txt /*g:ada_no_trail_space_error*
-g:ada_omni_with_keywords ada.txt /*g:ada_omni_with_keywords*
-g:ada_rainbow_color ada.txt /*g:ada_rainbow_color*
-g:ada_space_errors ada.txt /*g:ada_space_errors*
-g:ada_standard_types ada.txt /*g:ada_standard_types*
-g:ada_with_gnat_project_files ada.txt /*g:ada_with_gnat_project_files*
-g:ada_withuse_ordinary ada.txt /*g:ada_withuse_ordinary*
-g:decada ada.txt /*g:decada*
-g:decada.Error_Format ada.txt /*g:decada.Error_Format*
-g:decada.Make() ada.txt /*g:decada.Make()*
-g:decada.Make_Command ada.txt /*g:decada.Make_Command*
-g:decada.Unit_Name() ada.txt /*g:decada.Unit_Name()*
-g:gnat ada.txt /*g:gnat*
-g:gnat.Error_Format ada.txt /*g:gnat.Error_Format*
-g:gnat.Find() ada.txt /*g:gnat.Find()*
-g:gnat.Find_Program ada.txt /*g:gnat.Find_Program*
-g:gnat.Make() ada.txt /*g:gnat.Make()*
-g:gnat.Make_Command ada.txt /*g:gnat.Make_Command*
-g:gnat.Pretty() ada.txt /*g:gnat.Pretty()*
-g:gnat.Pretty_Program ada.txt /*g:gnat.Pretty_Program*
-g:gnat.Project_File ada.txt /*g:gnat.Project_File*
-g:gnat.Set_Project_File() ada.txt /*g:gnat.Set_Project_File()*
-g:gnat.Tags() ada.txt /*g:gnat.Tags()*
-g:gnat.Tags_Command ada.txt /*g:gnat.Tags_Command*
+g:ada#Comment ft_ada.txt /*g:ada#Comment*
+g:ada#Ctags_Kinds ft_ada.txt /*g:ada#Ctags_Kinds*
+g:ada#DotWordRegex ft_ada.txt /*g:ada#DotWordRegex*
+g:ada#Keywords ft_ada.txt /*g:ada#Keywords*
+g:ada#WordRegex ft_ada.txt /*g:ada#WordRegex*
+g:ada_abbrev ft_ada.txt /*g:ada_abbrev*
+g:ada_all_tab_usage ft_ada.txt /*g:ada_all_tab_usage*
+g:ada_begin_preproc ft_ada.txt /*g:ada_begin_preproc*
+g:ada_default_compiler ft_ada.txt /*g:ada_default_compiler*
+g:ada_extended_completion ft_ada.txt /*g:ada_extended_completion*
+g:ada_extended_tagging ft_ada.txt /*g:ada_extended_tagging*
+g:ada_folding ft_ada.txt /*g:ada_folding*
+g:ada_gnat_extensions ft_ada.txt /*g:ada_gnat_extensions*
+g:ada_line_errors ft_ada.txt /*g:ada_line_errors*
+g:ada_no_tab_space_error ft_ada.txt /*g:ada_no_tab_space_error*
+g:ada_no_trail_space_error ft_ada.txt /*g:ada_no_trail_space_error*
+g:ada_omni_with_keywords ft_ada.txt /*g:ada_omni_with_keywords*
+g:ada_rainbow_color ft_ada.txt /*g:ada_rainbow_color*
+g:ada_space_errors ft_ada.txt /*g:ada_space_errors*
+g:ada_standard_types ft_ada.txt /*g:ada_standard_types*
+g:ada_with_gnat_project_files ft_ada.txt /*g:ada_with_gnat_project_files*
+g:ada_withuse_ordinary ft_ada.txt /*g:ada_withuse_ordinary*
+g:colors_name options.txt /*g:colors_name*
+g:decada ft_ada.txt /*g:decada*
+g:decada.Error_Format ft_ada.txt /*g:decada.Error_Format*
+g:decada.Make() ft_ada.txt /*g:decada.Make()*
+g:decada.Make_Command ft_ada.txt /*g:decada.Make_Command*
+g:decada.Unit_Name() ft_ada.txt /*g:decada.Unit_Name()*
+g:gnat ft_ada.txt /*g:gnat*
+g:gnat.Error_Format ft_ada.txt /*g:gnat.Error_Format*
+g:gnat.Find() ft_ada.txt /*g:gnat.Find()*
+g:gnat.Find_Program ft_ada.txt /*g:gnat.Find_Program*
+g:gnat.Make() ft_ada.txt /*g:gnat.Make()*
+g:gnat.Make_Command ft_ada.txt /*g:gnat.Make_Command*
+g:gnat.Pretty() ft_ada.txt /*g:gnat.Pretty()*
+g:gnat.Pretty_Program ft_ada.txt /*g:gnat.Pretty_Program*
+g:gnat.Project_File ft_ada.txt /*g:gnat.Project_File*
+g:gnat.Set_Project_File() ft_ada.txt /*g:gnat.Set_Project_File()*
+g:gnat.Tags() ft_ada.txt /*g:gnat.Tags()*
+g:gnat.Tags_Command ft_ada.txt /*g:gnat.Tags_Command*
g:netrw_alto pi_netrw.txt /*g:netrw_alto*
g:netrw_altv pi_netrw.txt /*g:netrw_altv*
g:netrw_browse_split pi_netrw.txt /*g:netrw_browse_split*
g:netrw_browsex_viewer pi_netrw.txt /*g:netrw_browsex_viewer*
+g:netrw_cd_escape pi_netrw.txt /*g:netrw_cd_escape*
+g:netrw_compress pi_netrw.txt /*g:netrw_compress*
g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin*
g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd*
+g:netrw_decompress pi_netrw.txt /*g:netrw_decompress*
g:netrw_extracmd pi_netrw.txt /*g:netrw_extracmd*
g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse*
g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd*
+g:netrw_fname_escape pi_netrw.txt /*g:netrw_fname_escape*
g:netrw_ftp pi_netrw.txt /*g:netrw_ftp*
g:netrw_ftp_browse_reject pi_netrw.txt /*g:netrw_ftp_browse_reject*
g:netrw_ftp_cmd pi_netrw.txt /*g:netrw_ftp_cmd*
@@ -5548,6 +5599,7 @@ g:netrw_ftp_list_cmd pi_netrw.txt /*g:netrw_ftp_list_cmd*
g:netrw_ftp_sizelist_cmd pi_netrw.txt /*g:netrw_ftp_sizelist_cmd*
g:netrw_ftp_timelist_cmd pi_netrw.txt /*g:netrw_ftp_timelist_cmd*
g:netrw_ftpmode pi_netrw.txt /*g:netrw_ftpmode*
+g:netrw_glob_escape pi_netrw.txt /*g:netrw_glob_escape*
g:netrw_hide pi_netrw.txt /*g:netrw_hide*
g:netrw_http_cmd pi_netrw.txt /*g:netrw_http_cmd*
g:netrw_ignorenetrc pi_netrw.txt /*g:netrw_ignorenetrc*
@@ -5557,12 +5609,15 @@ g:netrw_list_hide pi_netrw.txt /*g:netrw_list_hide*
g:netrw_liststyle pi_netrw.txt /*g:netrw_liststyle*
g:netrw_local_mkdir pi_netrw.txt /*g:netrw_local_mkdir*
g:netrw_local_rmdir pi_netrw.txt /*g:netrw_local_rmdir*
+g:netrw_localcopycmd pi_netrw.txt /*g:netrw_localcopycmd*
+g:netrw_localmovecmd pi_netrw.txt /*g:netrw_localmovecmd*
g:netrw_maxfilenamelen pi_netrw.txt /*g:netrw_maxfilenamelen*
g:netrw_menu pi_netrw.txt /*g:netrw_menu*
g:netrw_mkdir_cmd pi_netrw.txt /*g:netrw_mkdir_cmd*
g:netrw_nogx pi_netrw.txt /*g:netrw_nogx*
-g:netrw_passwd pi_netrw.txt /*g:netrw_passwd*
+g:netrw_preview pi_netrw.txt /*g:netrw_preview*
g:netrw_rcp_cmd pi_netrw.txt /*g:netrw_rcp_cmd*
+g:netrw_retmap pi_netrw.txt /*g:netrw_retmap*
g:netrw_rm_cmd pi_netrw.txt /*g:netrw_rm_cmd*
g:netrw_rmdir_cmd pi_netrw.txt /*g:netrw_rmdir_cmd*
g:netrw_rmf_cmd pi_netrw.txt /*g:netrw_rmf_cmd*
@@ -5571,25 +5626,39 @@ g:netrw_scp_cmd pi_netrw.txt /*g:netrw_scp_cmd*
g:netrw_scpport pi_netrw.txt /*g:netrw_scpport*
g:netrw_sftp_cmd pi_netrw.txt /*g:netrw_sftp_cmd*
g:netrw_shq pi_netrw.txt /*g:netrw_shq*
+g:netrw_silent pi_netrw.txt /*g:netrw_silent*
g:netrw_sort_by pi_netrw.txt /*g:netrw_sort_by*
g:netrw_sort_direction pi_netrw.txt /*g:netrw_sort_direction*
g:netrw_sort_sequence pi_netrw.txt /*g:netrw_sort_sequence*
+g:netrw_special_syntax pi_netrw.txt /*g:netrw_special_syntax*
g:netrw_ssh_browse_reject pi_netrw.txt /*g:netrw_ssh_browse_reject*
g:netrw_ssh_cmd pi_netrw.txt /*g:netrw_ssh_cmd*
g:netrw_sshport pi_netrw.txt /*g:netrw_sshport*
g:netrw_timefmt pi_netrw.txt /*g:netrw_timefmt*
+g:netrw_tmpfile_escape pi_netrw.txt /*g:netrw_tmpfile_escape*
g:netrw_uid pi_netrw.txt /*g:netrw_uid*
g:netrw_use_errorwindow pi_netrw.txt /*g:netrw_use_errorwindow*
g:netrw_use_noswf pi_netrw.txt /*g:netrw_use_noswf*
g:netrw_use_nt_rcp pi_netrw.txt /*g:netrw_use_nt_rcp*
g:netrw_win95ftp pi_netrw.txt /*g:netrw_win95ftp*
g:netrw_winsize pi_netrw.txt /*g:netrw_winsize*
+g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen*
g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions*
g:tar_cmd pi_tar.txt /*g:tar_cmd*
+g:tar_nomax pi_tar.txt /*g:tar_nomax*
g:tar_readoptions pi_tar.txt /*g:tar_readoptions*
g:tar_writeoptions pi_tar.txt /*g:tar_writeoptions*
g:var eval.txt /*g:var*
g:vimball_home pi_vimball.txt /*g:vimball_home*
+g:vimball_mkdir pi_vimball.txt /*g:vimball_mkdir*
+g:vimball_path_escape pi_vimball.txt /*g:vimball_path_escape*
+g:vimsyn_embed syntax.txt /*g:vimsyn_embed*
+g:vimsyn_folding syntax.txt /*g:vimsyn_folding*
+g:vimsyn_maxlines syntax.txt /*g:vimsyn_maxlines*
+g:vimsyn_minlines syntax.txt /*g:vimsyn_minlines*
+g:vimsyn_noerror syntax.txt /*g:vimsyn_noerror*
+g:zip_nomax pi_zip.txt /*g:zip_nomax*
+g:zip_shq pi_zip.txt /*g:zip_shq*
g:zip_unzipcmd pi_zip.txt /*g:zip_unzipcmd*
g:zip_zipcmd pi_zip.txt /*g:zip_zipcmd*
g; motion.txt /*g;*
@@ -5649,6 +5718,8 @@ getftype() eval.txt /*getftype()*
getlatestvimscripts-install pi_getscript.txt /*getlatestvimscripts-install*
getline() eval.txt /*getline()*
getloclist() eval.txt /*getloclist()*
+getmatches() eval.txt /*getmatches()*
+getpid() eval.txt /*getpid()*
getpos() eval.txt /*getpos()*
getqflist() eval.txt /*getqflist()*
getreg() eval.txt /*getreg()*
@@ -5674,6 +5745,7 @@ glob() eval.txt /*glob()*
global-ime mbyte.txt /*global-ime*
global-local options.txt /*global-local*
global-variable eval.txt /*global-variable*
+global_markfilelist pi_netrw.txt /*global_markfilelist*
globpath() eval.txt /*globpath()*
glvs pi_getscript.txt /*glvs*
glvs-alg pi_getscript.txt /*glvs-alg*
@@ -5689,10 +5761,10 @@ glvs-options pi_getscript.txt /*glvs-options*
glvs-plugins pi_getscript.txt /*glvs-plugins*
glvs-usage pi_getscript.txt /*glvs-usage*
gm motion.txt /*gm*
-gnat#Insert_Tags_Header() ada.txt /*gnat#Insert_Tags_Header()*
-gnat#New() ada.txt /*gnat#New()*
-gnat-xref ada.txt /*gnat-xref*
-gnat_members ada.txt /*gnat_members*
+gnat#Insert_Tags_Header() ft_ada.txt /*gnat#Insert_Tags_Header()*
+gnat#New() ft_ada.txt /*gnat#New()*
+gnat-xref ft_ada.txt /*gnat-xref*
+gnat_members ft_ada.txt /*gnat_members*
gnome-session gui_x11.txt /*gnome-session*
go motion.txt /*go*
gp change.txt /*gp*
@@ -5752,6 +5824,7 @@ gui-w32-dialogs gui_w32.txt /*gui-w32-dialogs*
gui-w32-printing gui_w32.txt /*gui-w32-printing*
gui-w32-start gui_w32.txt /*gui-w32-start*
gui-w32-various gui_w32.txt /*gui-w32-various*
+gui-w32-windowid gui_w32.txt /*gui-w32-windowid*
gui-w32s gui_w32.txt /*gui-w32s*
gui-win32-maximized gui_w32.txt /*gui-win32-maximized*
gui-x11 gui_x11.txt /*gui-x11*
@@ -5828,7 +5901,6 @@ highlight-stop syntax.txt /*highlight-stop*
highlight-term syntax.txt /*highlight-term*
highlightID() eval.txt /*highlightID()*
highlight_exists() eval.txt /*highlight_exists()*
-his cmdline.txt /*his*
hist-names eval.txt /*hist-names*
histadd() eval.txt /*histadd()*
histdel() eval.txt /*histdel()*
@@ -6062,7 +6134,7 @@ index() eval.txt /*index()*
index.txt index.txt /*index.txt*
info-message starting.txt /*info-message*
inform.vim syntax.txt /*inform.vim*
-informix sql.txt /*informix*
+informix ft_sql.txt /*informix*
initialization starting.txt /*initialization*
input() eval.txt /*input()*
inputdialog() eval.txt /*inputdialog()*
@@ -6191,11 +6263,13 @@ local-function eval.txt /*local-function*
local-options options.txt /*local-options*
local-variable eval.txt /*local-variable*
local-variables eval.txt /*local-variables*
+local_markfilelist pi_netrw.txt /*local_markfilelist*
locale mbyte.txt /*locale*
locale-name mbyte.txt /*locale-name*
localtime() eval.txt /*localtime()*
location-list quickfix.txt /*location-list*
location-list-window quickfix.txt /*location-list-window*
+log10() eval.txt /*log10()*
long-lines version5.txt /*long-lines*
lowercase change.txt /*lowercase*
lpc.vim syntax.txt /*lpc.vim*
@@ -6260,11 +6334,14 @@ mapmode-x map.txt /*mapmode-x*
mapping map.txt /*mapping*
mark motion.txt /*mark*
mark-motions motion.txt /*mark-motions*
+markfilelist pi_netrw.txt /*markfilelist*
masm.vim syntax.txt /*masm.vim*
match() eval.txt /*match()*
match-highlight pattern.txt /*match-highlight*
match-parens tips.txt /*match-parens*
+matchadd() eval.txt /*matchadd()*
matcharg() eval.txt /*matcharg()*
+matchdelete() eval.txt /*matchdelete()*
matchend() eval.txt /*matchend()*
matchit-install usr_05.txt /*matchit-install*
matchlist() eval.txt /*matchlist()*
@@ -6355,7 +6432,7 @@ multilang-messages mlang.txt /*multilang-messages*
multilang-scripts mlang.txt /*multilang-scripts*
myfiletypefile syntax.txt /*myfiletypefile*
myscriptsfile syntax.txt /*myscriptsfile*
-mysql sql.txt /*mysql*
+mysql ft_sql.txt /*mysql*
mysyntaxfile syntax.txt /*mysyntaxfile*
mysyntaxfile-add syntax.txt /*mysyntaxfile-add*
mysyntaxfile-replace syntax.txt /*mysyntaxfile-replace*
@@ -6376,14 +6453,17 @@ nb-commands netbeans.txt /*nb-commands*
nb-events netbeans.txt /*nb-events*
nb-functions netbeans.txt /*nb-functions*
nb-messages netbeans.txt /*nb-messages*
+nb-protocol_errors netbeans.txt /*nb-protocol_errors*
nb-special netbeans.txt /*nb-special*
nb-terms netbeans.txt /*nb-terms*
ncf.vim syntax.txt /*ncf.vim*
netbeans netbeans.txt /*netbeans*
-netbeans-commands netbeans.txt /*netbeans-commands*
netbeans-configure netbeans.txt /*netbeans-configure*
+netbeans-debugging netbeans.txt /*netbeans-debugging*
netbeans-download netbeans.txt /*netbeans-download*
+netbeans-integration netbeans.txt /*netbeans-integration*
netbeans-intro netbeans.txt /*netbeans-intro*
+netbeans-key netbeans.txt /*netbeans-key*
netbeans-keybindings netbeans.txt /*netbeans-keybindings*
netbeans-messages netbeans.txt /*netbeans-messages*
netbeans-preparation netbeans.txt /*netbeans-preparation*
@@ -6408,17 +6488,20 @@ netrw-bookmark pi_netrw.txt /*netrw-bookmark*
netrw-bookmarks pi_netrw.txt /*netrw-bookmarks*
netrw-browse pi_netrw.txt /*netrw-browse*
netrw-browse-cmds pi_netrw.txt /*netrw-browse-cmds*
-netrw-browse-intro pi_netrw.txt /*netrw-browse-intro*
-netrw-browse-var pi_netrw.txt /*netrw-browse-var*
+netrw-browse-maps pi_netrw.txt /*netrw-browse-maps*
+netrw-browser pi_netrw.txt /*netrw-browser*
+netrw-browser-options pi_netrw.txt /*netrw-browser-options*
+netrw-browser-var pi_netrw.txt /*netrw-browser-var*
+netrw-browsing pi_netrw.txt /*netrw-browsing*
netrw-c pi_netrw.txt /*netrw-c*
netrw-cadaver pi_netrw.txt /*netrw-cadaver*
netrw-chgup pi_netrw.txt /*netrw-chgup*
+netrw-clean pi_netrw.txt /*netrw-clean*
netrw-contents pi_netrw.txt /*netrw-contents*
netrw-cr pi_netrw.txt /*netrw-cr*
netrw-credits pi_netrw.txt /*netrw-credits*
netrw-ctrl-h pi_netrw.txt /*netrw-ctrl-h*
netrw-ctrl-l pi_netrw.txt /*netrw-ctrl-l*
-netrw-ctrl_h pi_netrw.txt /*netrw-ctrl_h*
netrw-ctrl_l pi_netrw.txt /*netrw-ctrl_l*
netrw-curdir pi_netrw.txt /*netrw-curdir*
netrw-d pi_netrw.txt /*netrw-d*
@@ -6437,23 +6520,40 @@ netrw-file pi_netrw.txt /*netrw-file*
netrw-fixup pi_netrw.txt /*netrw-fixup*
netrw-ftp pi_netrw.txt /*netrw-ftp*
netrw-gb pi_netrw.txt /*netrw-gb*
+netrw-gh pi_netrw.txt /*netrw-gh*
netrw-gx pi_netrw.txt /*netrw-gx*
netrw-handler pi_netrw.txt /*netrw-handler*
netrw-help pi_netrw.txt /*netrw-help*
netrw-hexplore pi_netrw.txt /*netrw-hexplore*
+netrw-hide pi_netrw.txt /*netrw-hide*
netrw-hiding pi_netrw.txt /*netrw-hiding*
netrw-history pi_netrw.txt /*netrw-history*
netrw-horiz pi_netrw.txt /*netrw-horiz*
netrw-i pi_netrw.txt /*netrw-i*
netrw-incompatible pi_netrw.txt /*netrw-incompatible*
+netrw-intro-browse pi_netrw.txt /*netrw-intro-browse*
netrw-list pi_netrw.txt /*netrw-list*
netrw-listbookmark pi_netrw.txt /*netrw-listbookmark*
netrw-listhack pi_netrw.txt /*netrw-listhack*
netrw-login pi_netrw.txt /*netrw-login*
-netrw-maps pi_netrw.txt /*netrw-maps*
+netrw-mT pi_netrw.txt /*netrw-mT*
netrw-mb pi_netrw.txt /*netrw-mb*
+netrw-mc pi_netrw.txt /*netrw-mc*
+netrw-md pi_netrw.txt /*netrw-md*
+netrw-me pi_netrw.txt /*netrw-me*
+netrw-mf pi_netrw.txt /*netrw-mf*
+netrw-mg pi_netrw.txt /*netrw-mg*
+netrw-mh pi_netrw.txt /*netrw-mh*
netrw-ml_get pi_netrw.txt /*netrw-ml_get*
+netrw-mm pi_netrw.txt /*netrw-mm*
netrw-move pi_netrw.txt /*netrw-move*
+netrw-mp pi_netrw.txt /*netrw-mp*
+netrw-mr pi_netrw.txt /*netrw-mr*
+netrw-ms pi_netrw.txt /*netrw-ms*
+netrw-mt pi_netrw.txt /*netrw-mt*
+netrw-mu pi_netrw.txt /*netrw-mu*
+netrw-mx pi_netrw.txt /*netrw-mx*
+netrw-mz pi_netrw.txt /*netrw-mz*
netrw-netrc pi_netrw.txt /*netrw-netrc*
netrw-nexplore pi_netrw.txt /*netrw-nexplore*
netrw-nread pi_netrw.txt /*netrw-nread*
@@ -6462,6 +6562,8 @@ netrw-o pi_netrw.txt /*netrw-o*
netrw-options pi_netrw.txt /*netrw-options*
netrw-p pi_netrw.txt /*netrw-p*
netrw-p1 pi_netrw.txt /*netrw-p1*
+netrw-p10 pi_netrw.txt /*netrw-p10*
+netrw-p11 pi_netrw.txt /*netrw-p11*
netrw-p2 pi_netrw.txt /*netrw-p2*
netrw-p3 pi_netrw.txt /*netrw-p3*
netrw-p4 pi_netrw.txt /*netrw-p4*
@@ -6481,18 +6583,27 @@ netrw-prvwin pi_netrw.txt /*netrw-prvwin*
netrw-pscp pi_netrw.txt /*netrw-pscp*
netrw-psftp pi_netrw.txt /*netrw-psftp*
netrw-putty pi_netrw.txt /*netrw-putty*
-netrw-q pi_netrw.txt /*netrw-q*
+netrw-qb pi_netrw.txt /*netrw-qb*
+netrw-qf pi_netrw.txt /*netrw-qf*
+netrw-quickcom pi_netrw.txt /*netrw-quickcom*
+netrw-quickcoms pi_netrw.txt /*netrw-quickcoms*
+netrw-quickhelp pi_netrw.txt /*netrw-quickhelp*
+netrw-quickmap pi_netrw.txt /*netrw-quickmap*
+netrw-quickmaps pi_netrw.txt /*netrw-quickmaps*
netrw-r pi_netrw.txt /*netrw-r*
netrw-read pi_netrw.txt /*netrw-read*
netrw-ref pi_netrw.txt /*netrw-ref*
netrw-rename pi_netrw.txt /*netrw-rename*
netrw-reverse pi_netrw.txt /*netrw-reverse*
+netrw-rexplore pi_netrw.txt /*netrw-rexplore*
netrw-s pi_netrw.txt /*netrw-s*
netrw-settings pi_netrw.txt /*netrw-settings*
netrw-sexplore pi_netrw.txt /*netrw-sexplore*
netrw-sort pi_netrw.txt /*netrw-sort*
netrw-sortsequence pi_netrw.txt /*netrw-sortsequence*
netrw-source pi_netrw.txt /*netrw-source*
+netrw-ssh-hack pi_netrw.txt /*netrw-ssh-hack*
+netrw-star pi_netrw.txt /*netrw-star*
netrw-starpat pi_netrw.txt /*netrw-starpat*
netrw-starstar pi_netrw.txt /*netrw-starstar*
netrw-starstarpat pi_netrw.txt /*netrw-starstarpat*
@@ -6622,17 +6733,19 @@ ole-normal if_ole.txt /*ole-normal*
ole-registration if_ole.txt /*ole-registration*
ole-sendkeys if_ole.txt /*ole-sendkeys*
ole-setforeground if_ole.txt /*ole-setforeground*
-omni-sql-completion sql.txt /*omni-sql-completion*
+omap-info map.txt /*omap-info*
+omni-sql-completion ft_sql.txt /*omni-sql-completion*
online-help various.txt /*online-help*
opening-window windows.txt /*opening-window*
operator motion.txt /*operator*
+operator-variable eval.txt /*operator-variable*
option-backslash options.txt /*option-backslash*
option-list quickref.txt /*option-list*
option-summary options.txt /*option-summary*
options options.txt /*options*
options-changed version5.txt /*options-changed*
options.txt options.txt /*options.txt*
-oracle sql.txt /*oracle*
+oracle ft_sql.txt /*oracle*
os2 os_os2.txt /*os2*
os2ansi os_os2.txt /*os2ansi*
os390 os_390.txt /*os390*
@@ -6711,7 +6824,7 @@ pi_tar.txt pi_tar.txt /*pi_tar.txt*
pi_vimball.txt pi_vimball.txt /*pi_vimball.txt*
pi_zip.txt pi_zip.txt /*pi_zip.txt*
plaintex.vim syntax.txt /*plaintex.vim*
-plsql sql.txt /*plsql*
+plsql ft_sql.txt /*plsql*
plugin usr_05.txt /*plugin*
plugin-details filetype.txt /*plugin-details*
plugin-filetype usr_41.txt /*plugin-filetype*
@@ -6728,13 +6841,14 @@ ports-6 version6.txt /*ports-6*
posix vi_diff.txt /*posix*
posix-compliance vi_diff.txt /*posix-compliance*
posix-screen-size vi_diff.txt /*posix-screen-size*
-postgres sql.txt /*postgres*
+postgres ft_sql.txt /*postgres*
postscr.vim syntax.txt /*postscr.vim*
postscript-cjk-printing print.txt /*postscript-cjk-printing*
postscript-print-encoding print.txt /*postscript-print-encoding*
postscript-print-trouble print.txt /*postscript-print-trouble*
postscript-print-util print.txt /*postscript-print-util*
postscript-printing print.txt /*postscript-printing*
+pow() eval.txt /*pow()*
ppwiz.vim syntax.txt /*ppwiz.vim*
press-enter message.txt /*press-enter*
press-return message.txt /*press-return*
@@ -6745,6 +6859,18 @@ print-intro print.txt /*print-intro*
print-options print.txt /*print-options*
print.txt print.txt /*print.txt*
printf() eval.txt /*printf()*
+printf-% eval.txt /*printf-%*
+printf-E eval.txt /*printf-E*
+printf-G eval.txt /*printf-G*
+printf-X eval.txt /*printf-X*
+printf-c eval.txt /*printf-c*
+printf-d eval.txt /*printf-d*
+printf-e eval.txt /*printf-e*
+printf-f eval.txt /*printf-f*
+printf-g eval.txt /*printf-g*
+printf-o eval.txt /*printf-o*
+printf-s eval.txt /*printf-s*
+printf-x eval.txt /*printf-x*
printing print.txt /*printing*
printing-formfeed print.txt /*printing-formfeed*
profile repeat.txt /*profile*
@@ -6752,7 +6878,7 @@ profiling repeat.txt /*profiling*
profiling-variable eval.txt /*profiling-variable*
progname-variable eval.txt /*progname-variable*
progress.vim syntax.txt /*progress.vim*
-psql sql.txt /*psql*
+psql ft_sql.txt /*psql*
ptcap.vim syntax.txt /*ptcap.vim*
pterm-mouse options.txt /*pterm-mouse*
pumvisible() eval.txt /*pumvisible()*
@@ -6790,6 +6916,7 @@ quickfix-directory-stack quickfix.txt /*quickfix-directory-stack*
quickfix-error-lists quickfix.txt /*quickfix-error-lists*
quickfix-gcc quickfix.txt /*quickfix-gcc*
quickfix-manx quickfix.txt /*quickfix-manx*
+quickfix-perl quickfix.txt /*quickfix-perl*
quickfix-valid quickfix.txt /*quickfix-valid*
quickfix-window quickfix.txt /*quickfix-window*
quickfix.txt quickfix.txt /*quickfix.txt*
@@ -6901,6 +7028,7 @@ riscos-remote os_risc.txt /*riscos-remote*
riscos-shell os_risc.txt /*riscos-shell*
riscos-temp-files os_risc.txt /*riscos-temp-files*
rot13 change.txt /*rot13*
+round() eval.txt /*round()*
rsync pi_netrw.txt /*rsync*
ruby if_ruby.txt /*ruby*
ruby-buffer if_ruby.txt /*ruby-buffer*
@@ -6943,6 +7071,7 @@ s/\r change.txt /*s\/\\r*
s/\t change.txt /*s\/\\t*
s/\u change.txt /*s\/\\u*
s/\~ change.txt /*s\/\\~*
+s:netrw_passwd pi_netrw.txt /*s:netrw_passwd*
s:var eval.txt /*s:var*
s<CR> change.txt /*s<CR>*
sandbox eval.txt /*sandbox*
@@ -6980,6 +7109,7 @@ search-pattern pattern.txt /*search-pattern*
search-range pattern.txt /*search-range*
search-replace change.txt /*search-replace*
searchdecl() eval.txt /*searchdecl()*
+searchforward-variable eval.txt /*searchforward-variable*
searchpair() eval.txt /*searchpair()*
searchpairpos() eval.txt /*searchpairpos()*
searchpos() eval.txt /*searchpos()*
@@ -7000,6 +7130,7 @@ setbufvar() eval.txt /*setbufvar()*
setcmdpos() eval.txt /*setcmdpos()*
setline() eval.txt /*setline()*
setloclist() eval.txt /*setloclist()*
+setmatches() eval.txt /*setmatches()*
setpos() eval.txt /*setpos()*
setqflist() eval.txt /*setqflist()*
setreg() eval.txt /*setreg()*
@@ -7026,6 +7157,7 @@ signs sign.txt /*signs*
simple-change change.txt /*simple-change*
simplify() eval.txt /*simplify()*
simulated-command vi_diff.txt /*simulated-command*
+sin() eval.txt /*sin()*
single-repeat repeat.txt /*single-repeat*
skeleton autocmd.txt /*skeleton*
slow-fast-terminal term.txt /*slow-fast-terminal*
@@ -7035,6 +7167,7 @@ sniff if_sniff.txt /*sniff*
sniff-commands if_sniff.txt /*sniff-commands*
sniff-compiling if_sniff.txt /*sniff-compiling*
sniff-intro if_sniff.txt /*sniff-intro*
+socket-interface netbeans.txt /*socket-interface*
sort() eval.txt /*sort()*
sorting change.txt /*sorting*
soundfold() eval.txt /*soundfold()*
@@ -7147,34 +7280,34 @@ sponsor-faq sponsor.txt /*sponsor-faq*
sponsor.txt sponsor.txt /*sponsor.txt*
spoon os_unix.txt /*spoon*
spup.vim syntax.txt /*spup.vim*
-sql-adding-dialects sql.txt /*sql-adding-dialects*
-sql-completion sql.txt /*sql-completion*
-sql-completion-columns sql.txt /*sql-completion-columns*
-sql-completion-customization sql.txt /*sql-completion-customization*
-sql-completion-dynamic sql.txt /*sql-completion-dynamic*
-sql-completion-filetypes sql.txt /*sql-completion-filetypes*
-sql-completion-maps sql.txt /*sql-completion-maps*
-sql-completion-procedures sql.txt /*sql-completion-procedures*
-sql-completion-static sql.txt /*sql-completion-static*
-sql-completion-tables sql.txt /*sql-completion-tables*
-sql-completion-tutorial sql.txt /*sql-completion-tutorial*
-sql-completion-views sql.txt /*sql-completion-views*
-sql-dialects sql.txt /*sql-dialects*
-sql-macros sql.txt /*sql-macros*
-sql-matchit sql.txt /*sql-matchit*
-sql-navigation sql.txt /*sql-navigation*
-sql-object-motions sql.txt /*sql-object-motions*
-sql-predefined-objects sql.txt /*sql-predefined-objects*
-sql-type-default sql.txt /*sql-type-default*
-sql-types sql.txt /*sql-types*
-sql.txt sql.txt /*sql.txt*
+sql-adding-dialects ft_sql.txt /*sql-adding-dialects*
+sql-completion ft_sql.txt /*sql-completion*
+sql-completion-columns ft_sql.txt /*sql-completion-columns*
+sql-completion-customization ft_sql.txt /*sql-completion-customization*
+sql-completion-dynamic ft_sql.txt /*sql-completion-dynamic*
+sql-completion-filetypes ft_sql.txt /*sql-completion-filetypes*
+sql-completion-maps ft_sql.txt /*sql-completion-maps*
+sql-completion-procedures ft_sql.txt /*sql-completion-procedures*
+sql-completion-static ft_sql.txt /*sql-completion-static*
+sql-completion-tables ft_sql.txt /*sql-completion-tables*
+sql-completion-tutorial ft_sql.txt /*sql-completion-tutorial*
+sql-completion-views ft_sql.txt /*sql-completion-views*
+sql-dialects ft_sql.txt /*sql-dialects*
+sql-macros ft_sql.txt /*sql-macros*
+sql-matchit ft_sql.txt /*sql-matchit*
+sql-navigation ft_sql.txt /*sql-navigation*
+sql-object-motions ft_sql.txt /*sql-object-motions*
+sql-predefined-objects ft_sql.txt /*sql-predefined-objects*
+sql-type-default ft_sql.txt /*sql-type-default*
+sql-types ft_sql.txt /*sql-types*
sql.vim syntax.txt /*sql.vim*
-sqlanywhere sql.txt /*sqlanywhere*
+sqlanywhere ft_sql.txt /*sqlanywhere*
sqlanywhere.vim syntax.txt /*sqlanywhere.vim*
sqlinformix.vim syntax.txt /*sqlinformix.vim*
-sqlj sql.txt /*sqlj*
-sqlserver sql.txt /*sqlserver*
-sqlsettype sql.txt /*sqlsettype*
+sqlj ft_sql.txt /*sqlj*
+sqlserver ft_sql.txt /*sqlserver*
+sqlsettype ft_sql.txt /*sqlsettype*
+sqrt() eval.txt /*sqrt()*
sscanf eval.txt /*sscanf*
standard-plugin usr_05.txt /*standard-plugin*
standard-plugin-list help.txt /*standard-plugin-list*
@@ -7192,6 +7325,8 @@ startup-terminal term.txt /*startup-terminal*
static-tag tagsrch.txt /*static-tag*
status-line windows.txt /*status-line*
statusmsg-variable eval.txt /*statusmsg-variable*
+sticky-type-checking eval.txt /*sticky-type-checking*
+str2float() eval.txt /*str2float()*
str2nr() eval.txt /*str2nr()*
strcasestr() eval.txt /*strcasestr()*
strchr() eval.txt /*strchr()*
@@ -7229,7 +7364,7 @@ swapchoice-variable eval.txt /*swapchoice-variable*
swapcommand-variable eval.txt /*swapcommand-variable*
swapfile-changed version4.txt /*swapfile-changed*
swapname-variable eval.txt /*swapname-variable*
-sybase sql.txt /*sybase*
+sybase ft_sql.txt /*sybase*
syn-sync-grouphere syntax.txt /*syn-sync-grouphere*
syn-sync-groupthere syntax.txt /*syn-sync-groupthere*
syn-sync-linecont syntax.txt /*syn-sync-linecont*
@@ -7244,6 +7379,7 @@ synload-3 syntax.txt /*synload-3*
synload-4 syntax.txt /*synload-4*
synload-5 syntax.txt /*synload-5*
synload-6 syntax.txt /*synload-6*
+synstack() eval.txt /*synstack()*
syntax syntax.txt /*syntax*
syntax-highlighting syntax.txt /*syntax-highlighting*
syntax-loading syntax.txt /*syntax-loading*
@@ -7251,6 +7387,7 @@ syntax-printing usr_06.txt /*syntax-printing*
syntax.txt syntax.txt /*syntax.txt*
syntax_cmd syntax.txt /*syntax_cmd*
sys-file-list help.txt /*sys-file-list*
+sysmouse term.txt /*sysmouse*
system() eval.txt /*system()*
system-vimrc starting.txt /*system-vimrc*
s~ change.txt /*s~*
@@ -7523,6 +7660,7 @@ tex-error syntax.txt /*tex-error*
tex-folding syntax.txt /*tex-folding*
tex-math syntax.txt /*tex-math*
tex-morecommands syntax.txt /*tex-morecommands*
+tex-nospell syntax.txt /*tex-nospell*
tex-package syntax.txt /*tex-package*
tex-runon syntax.txt /*tex-runon*
tex-slow syntax.txt /*tex-slow*
@@ -7551,6 +7689,7 @@ toolbar-icon gui.txt /*toolbar-icon*
toupper() eval.txt /*toupper()*
tr() eval.txt /*tr()*
trojan-horse starting.txt /*trojan-horse*
+trunc() eval.txt /*trunc()*
try-conditionals eval.txt /*try-conditionals*
try-echoerr eval.txt /*try-echoerr*
try-finally eval.txt /*try-finally*
@@ -7668,11 +7807,13 @@ v:lnum eval.txt /*v:lnum*
v:mouse_col eval.txt /*v:mouse_col*
v:mouse_lnum eval.txt /*v:mouse_lnum*
v:mouse_win eval.txt /*v:mouse_win*
+v:operator eval.txt /*v:operator*
v:prevcount eval.txt /*v:prevcount*
v:profiling eval.txt /*v:profiling*
v:progname eval.txt /*v:progname*
v:register eval.txt /*v:register*
v:scrollstart eval.txt /*v:scrollstart*
+v:searchforward eval.txt /*v:searchforward*
v:servername eval.txt /*v:servername*
v:shell_error eval.txt /*v:shell_error*
v:statusmsg eval.txt /*v:statusmsg*
@@ -7812,6 +7953,7 @@ version-6.2 version6.txt /*version-6.2*
version-6.3 version6.txt /*version-6.3*
version-6.4 version6.txt /*version-6.4*
version-7.1 version7.txt /*version-7.1*
+version-7.2 version7.txt /*version-7.2*
version-variable eval.txt /*version-variable*
version4.txt version4.txt /*version4.txt*
version5.txt version5.txt /*version5.txt*
@@ -7843,6 +7985,7 @@ vimball pi_vimball.txt /*vimball*
vimball-contents pi_vimball.txt /*vimball-contents*
vimball-extract pi_vimball.txt /*vimball-extract*
vimball-history pi_vimball.txt /*vimball-history*
+vimball-intro pi_vimball.txt /*vimball-intro*
vimball-manual pi_vimball.txt /*vimball-manual*
vimdev intro.txt /*vimdev*
vimdiff diff.txt /*vimdiff*
@@ -8074,7 +8217,6 @@ zip-extension pi_zip.txt /*zip-extension*
zip-history pi_zip.txt /*zip-history*
zip-manual pi_zip.txt /*zip-manual*
zip-usage pi_zip.txt /*zip-usage*
-zip_shq pi_zip.txt /*zip_shq*
zj fold.txt /*zj*
zk fold.txt /*zk*
zl scroll.txt /*zl*
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index e562d4d9..55a9ae10 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -1,4 +1,4 @@
-*term.txt* For Vim version 7.1. Last change: 2007 Feb 28
+*term.txt* For Vim version 7.2a. Last change: 2008 Jun 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -139,7 +139,7 @@ want in either case you could use these settings: >
:set notimeout " don't timeout on mappings
:set ttimeout " do timeout on terminal key codes
:set timeoutlen=100 " timeout after 100 msec
-This requires the key-codes to be sent within 100msec in order to recognize
+This requires the key-codes to be sent within 100 msec in order to recognize
them as a cursor key. When you type you normally are not that fast, so they
are recognized as individual typed commands, even though Vim receives the same
sequence of bytes.
@@ -583,8 +583,9 @@ Don't forget to enable the mouse with this commands: >
:set mouse=a
Otherwise Vim won't recognize the mouse in all modes (See 'mouse').
-Currently the mouse is supported for Unix in an xterm window, in a Linux
-console (with GPM |gpm-mouse|), for MS-DOS and in a Windows console.
+Currently the mouse is supported for Unix in an xterm window, in a *BSD
+console with |sysmouse|, in a Linux console (with GPM |gpm-mouse|), for
+MS-DOS and in a Windows console.
Mouse clicks can be used to position the cursor, select an area and paste.
These characters in the 'mouse' option tell in which situations the mouse will
@@ -788,6 +789,10 @@ In Insert mode, when a selection is started, Vim goes into Normal mode
temporarily. When Visual or Select mode ends, it returns to Insert mode.
This is like using CTRL-O in Insert mode. Select mode is used when the
'selectmode' option contains "mouse".
+ *sysmouse*
+The sysmouse is only supported when the |+mouse_sysmouse| feature was enabled
+at compile time. The sysmouse driver (*BSD console) does not support keyboard
+modifiers.
*drag-status-line*
When working with several windows, the size of the windows can be changed by
diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt
index 0a4d845e..0bdcfa07 100644
--- a/runtime/doc/tips.txt
+++ b/runtime/doc/tips.txt
@@ -1,4 +1,4 @@
-*tips.txt* For Vim version 7.1. Last change: 2006 Jul 24
+*tips.txt* For Vim version 7.2a. Last change: 2006 Jul 24
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/undo.txt b/runtime/doc/undo.txt
index f996d0bd..33d4e317 100644
--- a/runtime/doc/undo.txt
+++ b/runtime/doc/undo.txt
@@ -1,4 +1,4 @@
-*undo.txt* For Vim version 7.1. Last change: 2006 Apr 30
+*undo.txt* For Vim version 7.2a. Last change: 2006 Apr 30
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/usr_10.txt b/runtime/doc/usr_10.txt
index 28726fa7..168b089b 100644
--- a/runtime/doc/usr_10.txt
+++ b/runtime/doc/usr_10.txt
@@ -1,4 +1,4 @@
-*usr_10.txt* For Vim version 7.1. Last change: 2006 Nov 05
+*usr_10.txt* For Vim version 7.2a. Last change: 2006 Nov 05
VIM USER MANUAL - by Bram Moolenaar
diff --git a/runtime/doc/usr_21.txt b/runtime/doc/usr_21.txt
index b68ab5e0..3eabb686 100644
--- a/runtime/doc/usr_21.txt
+++ b/runtime/doc/usr_21.txt
@@ -1,4 +1,4 @@
-*usr_21.txt* For Vim version 7.1. Last change: 2007 May 01
+*usr_21.txt* For Vim version 7.2a. Last change: 2007 May 01
VIM USER MANUAL - by Bram Moolenaar
diff --git a/runtime/doc/usr_24.txt b/runtime/doc/usr_24.txt
index 4b638fc5..35911bde 100644
--- a/runtime/doc/usr_24.txt
+++ b/runtime/doc/usr_24.txt
@@ -1,4 +1,4 @@
-*usr_24.txt* For Vim version 7.1. Last change: 2006 Jul 23
+*usr_24.txt* For Vim version 7.2a. Last change: 2006 Jul 23
VIM USER MANUAL - by Bram Moolenaar
diff --git a/runtime/doc/usr_25.txt b/runtime/doc/usr_25.txt
index d6d58156..63378714 100644
--- a/runtime/doc/usr_25.txt
+++ b/runtime/doc/usr_25.txt
@@ -1,4 +1,4 @@
-*usr_25.txt* For Vim version 7.1. Last change: 2007 May 11
+*usr_25.txt* For Vim version 7.2a. Last change: 2007 May 11
VIM USER MANUAL - by Bram Moolenaar
diff --git a/runtime/doc/usr_26.txt b/runtime/doc/usr_26.txt
index baeeb371..0c9f2c8c 100644
--- a/runtime/doc/usr_26.txt
+++ b/runtime/doc/usr_26.txt
@@ -1,4 +1,4 @@
-*usr_26.txt* For Vim version 7.1. Last change: 2006 Apr 24
+*usr_26.txt* For Vim version 7.2a. Last change: 2006 Apr 24
VIM USER MANUAL - by Bram Moolenaar
diff --git a/runtime/doc/usr_29.txt b/runtime/doc/usr_29.txt
index 40ea33c6..a314256c 100644
--- a/runtime/doc/usr_29.txt
+++ b/runtime/doc/usr_29.txt
@@ -1,4 +1,4 @@
-*usr_29.txt* For Vim version 7.1. Last change: 2006 Apr 24
+*usr_29.txt* For Vim version 7.2a. Last change: 2007 Nov 10
VIM USER MANUAL - by Bram Moolenaar
@@ -384,7 +384,7 @@ pairs of {} at the same level. "]}" jumps to the end.
When writing C++ or Java, the outer {} block is for the class. The next level
of {} is for a method. When somewhere inside a class use "[m" to find the
-previous start of a method. "]m" finds the next end of a method.
+previous start of a method. "]m" finds the next start of a method.
Additionally, "[]" moves backward to the end of a function and "]]" moves
forward to the start of the next function. The end of a function is defined
@@ -497,7 +497,7 @@ use: >
:set path+=/usr/local/X11
-When there are many subdirectories, you an use the "*" wildcard. Example: >
+When there are many subdirectories, you can use the "*" wildcard. Example: >
:set path+=/usr/*/include
diff --git a/runtime/doc/usr_31.txt b/runtime/doc/usr_31.txt
index 10794d5b..941ab689 100644
--- a/runtime/doc/usr_31.txt
+++ b/runtime/doc/usr_31.txt
@@ -1,4 +1,4 @@
-*usr_31.txt* For Vim version 7.1. Last change: 2007 May 08
+*usr_31.txt* For Vim version 7.2a. Last change: 2007 May 08
VIM USER MANUAL - by Bram Moolenaar
diff --git a/runtime/doc/usr_32.txt b/runtime/doc/usr_32.txt
index 528e7b73..ed95a0d1 100644
--- a/runtime/doc/usr_32.txt
+++ b/runtime/doc/usr_32.txt
@@ -1,4 +1,4 @@
-*usr_32.txt* For Vim version 7.1. Last change: 2006 Apr 30
+*usr_32.txt* For Vim version 7.2a. Last change: 2006 Apr 30
VIM USER MANUAL - by Bram Moolenaar
diff --git a/runtime/doc/usr_toc.txt b/runtime/doc/usr_toc.txt
index 29e856bb..d649aca9 100644
--- a/runtime/doc/usr_toc.txt
+++ b/runtime/doc/usr_toc.txt
@@ -1,4 +1,4 @@
-*usr_toc.txt* For Vim version 7.1. Last change: 2006 Apr 24
+*usr_toc.txt* For Vim version 7.2a. Last change: 2006 Apr 24
VIM USER MANUAL - by Bram Moolenaar
diff --git a/runtime/doc/version6.txt b/runtime/doc/version6.txt
index 0aafae76..1f3699c1 100644
--- a/runtime/doc/version6.txt
+++ b/runtime/doc/version6.txt
@@ -1,4 +1,4 @@
-*version6.txt* For Vim version 7.1. Last change: 2007 May 11
+*version6.txt* For Vim version 7.2a. Last change: 2007 May 11
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/vimtutor.man b/runtime/doc/vimtutor.man
index 8bc4a80c..6399d23b 100644
--- a/runtime/doc/vimtutor.man
+++ b/runtime/doc/vimtutor.man
@@ -6,7 +6,7 @@ NAME
vimtutor - the Vim tutor
SYNOPSIS
- vimtutor [language]
+ vimtutor [-g] [language]
DESCRIPTION
Vimtutor starts the Vim tutor. It copies the tutor file first, so that
@@ -15,6 +15,10 @@ DESCRIPTION
The Vimtutor is useful for people that want to learn their first Vim
commands.
+ The optional argument -g starts vimtutor with gvim rather than vim, if
+ the GUI version of vim is available, or falls back to Vim if gvim is
+ not found.
+
The optional [language] argument is the two-letter name of a language,
like "it" or "es". If the [language] argument is missing, the language
of the current locale will be used. If a tutor in this language is
diff --git a/runtime/ftplugin/c.vim b/runtime/ftplugin/c.vim
index 48055b0a..162205bc 100644
--- a/runtime/ftplugin/c.vim
+++ b/runtime/ftplugin/c.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2005 Sep 01
+" Last Change: 2007 Sep 25
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -34,6 +34,11 @@ if has("vms")
setlocal iskeyword+=$
endif
+" When the matchit plugin is loaded, this makes the % command skip parens and
+" braces in comments.
+let b:match_words = &matchpairs
+let b:match_skip = 's:comment\|string\|character'
+
" Win32 can filter files in the browse dialog
if has("gui_win32") && !exists("b:browsefilter")
if &ft == "cpp"
diff --git a/runtime/ftplugin/changelog.vim b/runtime/ftplugin/changelog.vim
index e9ec4d42..924d35da 100644
--- a/runtime/ftplugin/changelog.vim
+++ b/runtime/ftplugin/changelog.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: generic Changelog file
" Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2007-05-06
+" Latest Revision: 2007-05-21
" Variables:
" g:changelog_timeformat (deprecated: use g:changelog_dateformat instead) -
" description: the timeformat used in ChangeLog entries.
@@ -131,7 +131,7 @@ if &filetype == 'changelog'
" Regular expression used to find the end of a date entry
if !exists('g:changelog_date_end_entry_search')
- let g:changelog_date_entry_search = '^\s*$'
+ let g:changelog_date_end_entry_search = '^\s*$'
endif
diff --git a/runtime/ftplugin/hostconf.vim b/runtime/ftplugin/hostconf.vim
new file mode 100644
index 00000000..86796eb8
--- /dev/null
+++ b/runtime/ftplugin/hostconf.vim
@@ -0,0 +1,18 @@
+" Vim filetype plugin file
+" Maintainer: Nikolai Weibull <now@bitwi.se>
+" Latest Revision: 2007-09-18
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+let b:undo_ftplugin = "setl com< cms< fo<"
+
+setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
+
+let s:cpo_save = &cpo
+set cpo&vim
diff --git a/runtime/ftplugin/lua.vim b/runtime/ftplugin/lua.vim
index 3bc640f3..297833f4 100644
--- a/runtime/ftplugin/lua.vim
+++ b/runtime/ftplugin/lua.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file.
" Language: Lua 4.0+
" Maintainer: Max Ischenko <mfi@ukr.net>
-" Last Change: 2001 Sep 17
+" Last Change: 2008 Mar 25
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -16,7 +16,7 @@ let b:did_ftplugin = 1
setlocal fo-=t fo+=croql
setlocal com=:--
-setlocal cms="--%s"
+setlocal cms=--%s
setlocal suffixesadd=.lua
diff --git a/runtime/ftplugin/pdf.vim b/runtime/ftplugin/pdf.vim
new file mode 100644
index 00000000..1ed99117
--- /dev/null
+++ b/runtime/ftplugin/pdf.vim
@@ -0,0 +1,89 @@
+" Vim filetype plugin file
+" Language: PDF
+" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
+" Last Change: 2007 Dec 16
+
+if exists("b:did_ftplugin")
+ finish
+endif
+let b:did_ftplugin = 1
+
+setlocal commentstring=%%s
+setlocal comments=:%
+let b:undo_ftplugin = "setlocal cms< com< | unlet! b:match_words"
+
+if exists("g:loaded_matchit")
+ let b:match_words = '\<\%(\d\+\s\+\d\+\s\+\)obj\>:\<endobj\>,\<stream$:\<endstream\>,\<xref\>:\<trailer\>,<<:>>'
+endif
+
+if exists("g:no_plugin_maps") || exists("g:no_pdf_maps") || v:version < 700
+ finish
+endif
+
+if !exists("b:pdf_tagstack")
+ let b:pdf_tagstack = []
+endif
+
+let b:undo_ftplugin .= " | silent! nunmap <buffer> <C-]> | silent! nunmap <buffer> <C-T>"
+nnoremap <silent><buffer> <C-]> :call <SID>Tag()<CR>
+" Inline, so the error from an empty tag stack will be simple.
+nnoremap <silent><buffer> <C-T> :if len(b:pdf_tagstack) > 0 <Bar> call setpos('.',remove(b:pdf_tagstack, -1)) <Bar> else <Bar> exe "norm! \<Lt>C-T>" <Bar> endif<CR>
+
+function! s:Tag()
+ call add(b:pdf_tagstack,getpos('.'))
+ if getline('.') =~ '^\d\+$' && getline(line('.')-1) == 'startxref'
+ return s:dodigits(getline('.'))
+ elseif getline('.') =~ '/Prev\s\+\d\+\>\%(\s\+\d\)\@!' && expand("<cword>") =~ '^\d\+$'
+ return s:dodigits(expand("<cword>"))
+ elseif getline('.') =~ '^\d\{10\} \d\{5\} '
+ return s:dodigits(matchstr(getline('.'),'^\d\+'))
+ else
+ let line = getline(".")
+ let lastend = 0
+ let pat = '\<\d\+\s\+\d\+\s\+R\>'
+ while lastend >= 0
+ let beg = match(line,'\C'.pat,lastend)
+ let end = matchend(line,'\C'.pat,lastend)
+ if beg < col(".") && end >= col(".")
+ return s:doobject(matchstr(line,'\C'.pat,lastend))
+ endif
+ let lastend = end
+ endwhile
+ return s:notag()
+ endif
+endfunction
+
+function! s:doobject(string)
+ let first = matchstr(a:string,'^\s*\zs\d\+')
+ let second = matchstr(a:string,'^\s*\d\+\s\+\zs\d\+')
+ norm! m'
+ if first != '' && second != ''
+ let oldline = line('.')
+ let oldcol = col('.')
+ 1
+ if !search('^\s*'.first.'\s\+'.second.'\s\+obj\>')
+ exe oldline
+ exe 'norm! '.oldcol.'|'
+ return s:notag()
+ endif
+ endif
+endfunction
+
+function! s:dodigits(digits)
+ let digits = 0 + substitute(a:digits,'^0*','','')
+ norm! m'
+ if digits <= 0
+ norm! 1go
+ else
+ " Go one character before the destination and advance. This method
+ " lands us after a newline rather than before, if that is our target.
+ exe "goto ".(digits)."|norm! 1 "
+ endif
+endfunction
+
+function! s:notag()
+ silent! call remove(b:pdf_tagstack,-1)
+ echohl ErrorMsg
+ echo "E426: tag not found"
+ echohl NONE
+endfunction
diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim
index b3078005..3f3e570b 100644
--- a/runtime/ftplugin/perl.vim
+++ b/runtime/ftplugin/perl.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Perl
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
-" Last Change: 2005 Dec 16
+" Last Change: 2007 Nov 30
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
if exists("b:did_ftplugin") | finish | endif
@@ -42,12 +42,16 @@ set isfname+=:
" Set this once, globally.
if !exists("perlpath")
if executable("perl")
+ try
if &shellxquote != '"'
let perlpath = system('perl -e "print join(q/,/,@INC)"')
else
let perlpath = system("perl -e 'print join(q/,/,@INC)'")
endif
let perlpath = substitute(perlpath,',.$',',,','')
+ catch /E145:/
+ let perlpath = ".,,"
+ endtry
else
" If we can't call perl to get its path, just default to using the
" current directory and the directory of the current file.
diff --git a/runtime/ftplugin/reva.vim b/runtime/ftplugin/reva.vim
new file mode 100644
index 00000000..05c8bc32
--- /dev/null
+++ b/runtime/ftplugin/reva.vim
@@ -0,0 +1,25 @@
+" Vim ftplugin file
+" Language: Reva Forth
+" Version: 7.1
+" Last Change: 2008/01/11
+" Maintainer: Ron Aaron <ron@ronware.org>
+" URL: http://ronware.org/reva/
+" Filetypes: *.rf *.frt
+" NOTE: Forth allows any non-whitespace in a name, so you need to do:
+" setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
+"
+" This goes with the syntax/reva.vim file.
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+setlocal sts=4 sw=4
+setlocal com=s1:/*,mb:*,ex:*/,:\|,:\\
+setlocal fo=tcrqol
+setlocal matchpairs+=\::;
+setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
diff --git a/runtime/ftplugin/ruby.vim b/runtime/ftplugin/ruby.vim
index 694a6fd9..1d4347a9 100644
--- a/runtime/ftplugin/ruby.vim
+++ b/runtime/ftplugin/ruby.vim
@@ -227,4 +227,4 @@ endfunction
" differs on Windows. Email gsinclair@soyabean.com.au if you need help.
"
-" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
+" vim: nowrap sw=2 sts=2 ts=8:
diff --git a/runtime/indent/cmake.vim b/runtime/indent/cmake.vim
index 46184c68..b54a8d87 100644
--- a/runtime/indent/cmake.vim
+++ b/runtime/indent/cmake.vim
@@ -1,11 +1,11 @@
" =============================================================================
-"
+"
" Program: CMake - Cross-Platform Makefile Generator
" Module: $RCSfile$
" Language: VIM
" Date: $Date$
" Version: $Revision$
-"
+"
" =============================================================================
" Vim indent file
@@ -65,8 +65,8 @@ fun! CMakeGetIndent(lnum)
\ ')\s*' .
\ '\(' . cmake_regex_comment . '\)\?$'
- let cmake_indent_begin_regex = '^\s*\(IF\|MACRO\|FOREACH\|ELSE\|WHILE\)\s*('
- let cmake_indent_end_regex = '^\s*\(ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\|ENDWHILE\)\s*('
+ let cmake_indent_begin_regex = '^\s*\(IF\|MACRO\|FOREACH\|ELSE\|ELSEIF\|WHILE\)\s*('
+ let cmake_indent_end_regex = '^\s*\(ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\|ELSEIF\|ENDWHILE\)\s*('
" Add
if previous_line =~? cmake_indent_comment_line " Handle comments
diff --git a/runtime/indent/dtrace.vim b/runtime/indent/dtrace.vim
new file mode 100644
index 00000000..e41d398e
--- /dev/null
+++ b/runtime/indent/dtrace.vim
@@ -0,0 +1,17 @@
+" Vim indent file
+" Language: D script as described in "Solaris Dynamic Tracing Guide",
+" http://docs.sun.com/app/docs/doc/817-6223
+" Last Change: 2008/03/20
+" Version: 1.2
+" Maintainer: Nicolas Weber <nicolasweber@gmx.de>
+
+" Only load this indent file when no other was loaded.
+if exists("b:did_indent")
+ finish
+endif
+let b:did_indent = 1
+
+" Built-in C indenting works nicely for dtrace.
+setlocal cindent
+
+let b:undo_indent = "setl cin<"
diff --git a/runtime/indent/ruby.vim b/runtime/indent/ruby.vim
index f6d79566..0f2de567 100644
--- a/runtime/indent/ruby.vim
+++ b/runtime/indent/ruby.vim
@@ -370,4 +370,4 @@ endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
-" vim:set sw=2 sts=2 ts=8 noet ff=unix:
+" vim:set sw=2 sts=2 ts=8 noet:
diff --git a/runtime/keymap/croatian_utf-8.vim b/runtime/keymap/croatian_utf-8.vim
new file mode 100644
index 00000000..11c005f0
--- /dev/null
+++ b/runtime/keymap/croatian_utf-8.vim
@@ -0,0 +1,68 @@
+" Vim Keymap file for Croatian characters, classical variant, UTF-8 encoding
+"
+" Maintainer: Paul B. Mahol <onemda@gmail.com>
+" Last Changed: 2007 Oct 14
+
+scriptencoding UTF-8
+
+let b:keymap_name = "croatian-UTF-8"
+" Uncomment line below if you prefer short name
+"let b:keymap_name = "hr-UTF-8"
+
+loadkeymap
+z y
+Z Y
+y z
+Y Z
+[ š
+{ Š
+] đ
+} Đ
+; č
+: Č
+' ć
+" Ć
+\ ž
+| Ž
+@ "
+^ &
+& /
+* (
+( )
+) =
+_ ?
++ *
+= +
+- '
+æ [
+ç ]
+â {
+î }
+< ;
+> :
+/ -
+? _
+ö @
+ñ \
+÷ |
+å €
+¬ <
+® >
+± ~
+² ˇ
+³ ^
+´ ˘
+µ °
+· `
+¹ ´
+í §
+Û ÷
+Ü ¤
+Ý ×
+§ ß
+ì ł
+Ì Ł
+° ˝
+` ¸
+½ ¸
+­ ¨
diff --git a/runtime/lang/menu_eo.utf-8.vim b/runtime/lang/menu_eo.utf-8.vim
new file mode 100644
index 00000000..761ae0b8
--- /dev/null
+++ b/runtime/lang/menu_eo.utf-8.vim
@@ -0,0 +1,457 @@
+" Menu Translations: Esperanto
+" Maintainer: Dominique PELLE <dominique.pelle@free.fr>
+" Last Change: 2008 Mar 01
+"
+" Quit when menu translations have already been done.
+if exists("did_menu_trans")
+ finish
+endif
+let did_menu_trans = 1
+
+scriptencoding utf-8
+
+menutrans &Help &Helpo
+
+menutrans &Overview<Tab><F1> &Enhavtabelo<Tab><F1>
+menutrans &User\ Manual &Uzula\ manlibro
+menutrans &How-to\ links &Kiel\ fari
+menutrans &Find\.\.\. T&rovi\.\.\.
+" -sep1-
+menutrans &Credits &Dankoj
+menutrans Co&pying &Permisilo
+menutrans &Sponsor/Register &Subteni/Registriĝi
+menutrans O&rphans &Orfoj
+" -sep2-
+menutrans &Version &Versio
+menutrans &About Pri\ &Vim
+
+let g:menutrans_help_dialog = "Tajpu komandon aŭ serĉendan vorton en la helparo.\n\nAldonu i_ por la komandoj de la enmeta reĝimo (ekz: i_CTRL-X)\nAldonu c_ por redakto de la komanda linio (ekz: c_<Del>)\nĈirkaŭi la opciojn per apostrofoj (ekz: 'shiftwidth')"
+
+menutrans &File &Dosiero
+
+menutrans &Open\.\.\.<Tab>:e &Malfermi\.\.\.<Tab>:e
+menutrans Sp&lit-Open\.\.\.<Tab>:sp Malfermi\ &divide\.\.\.<Tab>:sp
+menutrans Open\ Tab\.\.\.<Tab>:tabnew Malfermi\ &langeton\.\.\.<Tab>:tabnew
+menutrans &New<Tab>:enew &Nova<Tab>:enew
+menutrans &Close<Tab>:close &Fermi<Tab>:close
+" -SEP1-
+menutrans &Save<Tab>:w &Konservi<Tab>:w
+menutrans Save\ &As\.\.\.<Tab>:sav Konservi\ ki&el\.\.\.<Tab>:sav
+" -SEP2-
+menutrans Split\ &Diff\ with\.\.\. Kom&pari\ divide\.\.\.
+menutrans Split\ Patched\ &By\.\.\. &Testi\ flikaĵon\.\.\.
+" -SEP3-
+menutrans &Print &Presi
+" -SEP4-
+menutrans Sa&ve-Exit<Tab>:wqa Konservi\ kaj\ eli&ri<Tab>:wqa
+menutrans E&xit<Tab>:qa &Eliri<Tab>:qa
+
+
+menutrans &Edit &Redakti
+
+menutrans &Undo<Tab>u &Malfari<Tab>u
+menutrans &Redo<Tab>^R Re&fari<Tab>^R
+menutrans Rep&eat<Tab>\. R&ipeti<Tab>\.
+" -SEP1-
+menutrans Cu&t<Tab>"+x &Tondi<Tab>"+x
+menutrans &Copy<Tab>"+y &Kopii<Tab>"+y
+menutrans &Paste<Tab>"+gP Al&glui<Tab>"+gP
+menutrans Put\ &Before<Tab>[p Enmeti\ &antaŭ<Tab>[p
+menutrans Put\ &After<Tab>]p Enmeti\ ma&lantaŭ<Tab>]p
+menutrans &Delete<Tab>x &Forviŝi<Tab>x
+menutrans &Select\ All<Tab>ggVG A&partigi\ ĉion<Tab>ggVG
+" -SEP2-
+menutrans &Find\.\.\. &Trovi\.\.\.
+menutrans Find\ and\ Rep&lace\.\.\. Trovi\ kaj\ a&nstataŭigi\.\.\.
+menutrans &Find<Tab>/ &Trovi<Tab>/
+menutrans Find\ and\ Rep&lace<Tab>:%s Trovi\ kaj\ ansta&taŭigi<Tab>:%s
+menutrans Find\ and\ Rep&lace<Tab>:s Trovi\ kaj\ ansta&taŭigi<Tab>:s
+" -SEP3-
+menutrans Settings\ &Window Fenestro\ de\ a&gordoj
+menutrans Startup\ &Settings Agordoj\ de\ prav&aloroj
+menutrans &Global\ Settings Mallo&kaj\ agordoj
+
+menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Baskuli\ emfazon\ de\ ŝa&blono<Tab>:set\ hls!
+menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Baskuli\ kongruon\ de\ uskle&co<Tab>:set\ ic!
+menutrans Toggle\ &Showmatch<Tab>:set\ sm! Baskuli\ kongruon\ de\ kram&poj<Tab>:set\ sm!
+
+menutrans &Context\ lines Linioj\ de\ &kunteksto
+
+menutrans &Virtual\ Edit &Virtuala\ redakto
+menutrans Never &Neniam
+menutrans Block\ Selection &Bloka\ apartigo
+menutrans Insert\ mode &Enmeta\ reĝimo
+menutrans Block\ and\ Insert Blo&ko\ kaj\ enmeto
+menutrans Always Ĉia&m
+
+menutrans Toggle\ Insert\ &Mode<Tab>:set\ im! Baskuli\ &enmetan\ reĝimon<Tab>:set\ im!
+menutrans Toggle\ Vi\ C&ompatible<Tab>:set\ cp! Baskuli\ kongruon\ kun\ &Vi<Tab>:set\ cp!
+menutrans Search\ &Path\.\.\. &Serĉvojo\ de\ dosieroj\.\.\.
+menutrans Ta&g\ Files\.\.\. Dosiero\ de\ etike&doj\.\.\.
+" -SEP1-
+menutrans Toggle\ &Toolbar Baskuli\ &ilobreton
+menutrans Toggle\ &Bottom\ Scrollbar Baskuli\ su&ban\ rulumskalon
+menutrans Toggle\ &Left\ Scrollbar Baskuli\ &maldekstran\ rulumskalon
+menutrans Toggle\ &Right\ Scrollbar Baskuli\ &dekstran\ rulumskalon
+
+let g:menutrans_path_dialog = "Tajpu la vojon de serĉo de dosieroj.\nDisigu la dosierujojn per komoj."
+let g:menutrans_tags_dialog = "Tajpu la nomojn de dosieroj de etikedoj.\nDisigu la nomojn per komoj."
+
+menutrans F&ile\ Settings A&gordoj\ de\ dosiero
+
+menutrans Toggle\ Line\ &Numbering<Tab>:set\ nu! Baskuli\ &numerojn\ de\ linioj<Tab>:set\ nu!
+menutrans Toggle\ &List\ Mode<Tab>:set\ list! Baskuli\ &listan\ reĝimon<Tab>:set\ list!
+menutrans Toggle\ Line\ &Wrap<Tab>:set\ wrap! Baskuli\ linifal&don<Tab>:set\ wrap!
+menutrans Toggle\ W&rap\ at\ word<Tab>:set\ lbr! Baskuli\ &vortofaldon<Tab>:set\ lbr!
+menutrans Toggle\ &expand-tab<Tab>:set\ et! Baskuli\ ekspansio\ de\ &taboj<Tab>:set\ et!
+menutrans Toggle\ &auto-indent<Tab>:set\ ai! Baskuli\ &aŭtokrommarĝenon<Tab>:set\ ai!
+menutrans Toggle\ &C-indenting<Tab>:set\ cin! Baskuli\ &C-krommarĝenon<Tab>:set\ cin!
+" -SEP2-
+menutrans &Shiftwidth &Larĝo\ de\ krommarĝeno
+menutrans Soft\ &Tabstop &Malm&olaj\ taboj
+menutrans Te&xt\ Width\.\.\. Larĝo\ de\ te&ksto\.\.\.
+menutrans &File\ Format\.\.\. &Formato\ de\ &dosiero\.\.\.
+
+let g:menutrans_textwidth_dialog = "Tajpu la novan larĝon de teksto\n(0 por malŝalti formatigon)."
+let g:menutrans_fileformat_dialog = "Elektu la formaton de la skribonta dosiero."
+let g:menutrans_fileformat_choices = " &Unikso \n &Dos \n &Mak \n &Rezigni "
+
+menutrans C&olor\ Scheme &Koloraro
+menutrans &Keymap Klavo&mapo
+menutrans None (nenio)
+menutrans Select\ Fo&nt\.\.\. Elekti\ &tiparon\.\.\.
+
+
+menutrans &Tools &Iloj
+
+menutrans &Jump\ to\ this\ tag<Tab>g^] &Aliri\ al\ tiu\ etikedo<Tab>g^]
+menutrans Jump\ &back<Tab>^T &Retroiri<Tab>^T
+menutrans Build\ &Tags\ File Krei\ &etikedan\ dosieron
+
+" -SEP1-
+menutrans &Spelling &Literumilo
+menutrans &Spell\ Check\ On Ŝal&ti\ literumilon
+menutrans Spell\ Check\ &Off &Malŝalti\ literumilon
+menutrans To\ &Next\ error<Tab>]s Al\ sek&vonta\ eraro<Tab>]s
+menutrans To\ &Previous\ error<Tab>[s Al\ an&taŭa\ eraro<Tab>[s
+menutrans Suggest\ &Corrections<Tab>z= &Sugesti\ korektojn<Tab>z=
+menutrans &Repeat\ correction<Tab>:spellrepall R&ipeti\ korekton<Tab>:spellrepall
+
+menutrans Set\ language\ to\ "en" Angla
+menutrans Set\ language\ to\ "en_au" Angla\ (Aŭstralio)
+menutrans Set\ language\ to\ "en_ca" Angla\ (Kanado)
+menutrans Set\ language\ to\ "en_gb" Angla\ (Britio)
+menutrans Set\ language\ to\ "en_nz" Angla\ (Novzelando)
+menutrans Set\ language\ to\ "en_us" Angla\ (Usono)
+
+menutrans &Find\ More\ Languages &Trovi\ pli\ da\ lingvoj
+
+
+menutrans &Folding &Faldo
+
+menutrans &Enable/Disable\ folds<Tab>zi &Baskuli\ faldojn<Tab>zi
+menutrans &View\ Cursor\ Line<Tab>zv &Vidi\ linion\ de\ kursoro<Tab>zv
+menutrans Vie&w\ Cursor\ Line\ only<Tab>zMzx Vidi\ nur\ &kursoran\ linion<Tab>zMzx
+menutrans C&lose\ more\ folds<Tab>zm F&ermi\ pli\ da\ faldoj<Tab>zm
+menutrans &Close\ all\ folds<Tab>zM Fermi\ ĉiu&jn\ faldojn<Tab>zM
+menutrans O&pen\ more\ folds<Tab>zr &Malfermi\ pli\ da\ faldoj<Tab>zr
+menutrans &Open\ all\ folds<Tab>zR Malfermi\ ĉiuj&n\ faldojn<Tab>zR
+" -SEP1-
+menutrans Fold\ Met&hod &Metodo\ de\ faldo
+
+menutrans M&anual &Permana\ metodo
+menutrans I&ndent &Krommarĝeno
+menutrans E&xpression &Esprimo
+menutrans S&yntax &Sintakso
+menutrans &Diff &Komparo
+menutrans Ma&rker Ma&rko
+
+menutrans Create\ &Fold<Tab>zf &Krei\ faldon<Tab>zf
+menutrans &Delete\ Fold<Tab>zd Forv&iŝi\ faldon<Tab>zd
+menutrans Delete\ &All\ Folds<Tab>zD Forviŝi\ ĉiu&jn\ faldojn<Tab>zD
+" -SEP2-
+menutrans Fold\ col&umn\ width &Larĝo\ de\ falda\ kolumno
+
+menutrans &Diff Kom&pari
+
+menutrans &Update Ĝis&datigi
+menutrans &Get\ Block &Akiri\ blokon
+menutrans &Put\ Block Enme&ti\ blokon
+
+" -SEP2-
+menutrans &Make<Tab>:make Lanĉi\ ma&ke<Tab>:make
+menutrans &List\ Errors<Tab>:cl Listigi\ &erarojn<Tab>:cl
+menutrans L&ist\ Messages<Tab>:cl! Listigi\ &mesaĝojn<Tab>:cl!
+menutrans &Next\ Error<Tab>:cn Sek&vanta\ eraro<Tab>:cn
+menutrans &Previous\ Error<Tab>:cp An&taŭa\ eraro<Tab>:cp
+menutrans &Older\ List<Tab>:cold Pli\ ma&lnova\ listo<Tab>:cold
+menutrans N&ewer\ List<Tab>:cnew Pli\ nova\ listo<Tab>:cnew
+
+menutrans Error\ &Window &Fenestro\ de\ eraroj
+
+menutrans &Update<Tab>:cwin Ĝis&datigi<Tab>:cwin
+menutrans &Open<Tab>:copen &Malfermi<Tab>:copen
+menutrans &Close<Tab>:cclose &Fermi<Tab>:cclose
+
+" -SEP3-
+menutrans &Convert\ to\ HEX<Tab>:%!xxd Konverti\ al\ deksesuma<Tab>:%!xxd
+menutrans Conve&rt\ back<Tab>:%!xxd\ -r Retrokonverti<Tab>:%!xxd\ -r
+
+menutrans Se&T\ Compiler &Elekti\ kompililon
+
+
+menutrans &Buffers &Bufroj
+
+menutrans Dummy Fikcia
+menutrans &Refresh\ menu Ĝis&datigi\ menuon
+menutrans &Delete &Forviŝi
+menutrans &Alternate &Alterni
+menutrans &Next &Sekvanta
+menutrans &Previous An&taŭa
+" -SEP-
+
+menutrans &others a&liaj
+menutrans &u-z &u-z
+let g:menutrans_no_file = "[Neniu dosiero]"
+
+
+menutrans &Window Fene&stro
+
+menutrans &New<Tab>^Wn &Nova<Tab>^Wn
+menutrans S&plit<Tab>^Ws Di&vidi<Tab>^Ws
+menutrans Sp&lit\ To\ #<Tab>^W^^ Dividi\ &al\ #<Tab>^W^^
+menutrans Split\ &Vertically<Tab>^Wv Dividi\ &vertikale<Tab>^Wv
+menutrans Split\ File\ E&xplorer Dividi\ &dosierfoliumilo
+" -SEP1-
+menutrans &Close<Tab>^Wc &Fermi<Tab>^Wc
+menutrans Close\ &Other(s)<Tab>^Wo Fermi\ &aliajn<Tab>^Wo
+" -SEP2-
+menutrans Move\ &To &Movu\ al
+
+menutrans &Top<Tab>^WK Su&pro<Tab>^WK
+menutrans &Bottom<Tab>^WJ Su&bo<Tab>^WJ
+menutrans &Left\ side<Tab>^WH Maldekstra\ &flanko<Tab>^WH
+menutrans &Right\ side<Tab>^WL Dekstra\ f&lanko<Tab>^WL
+
+menutrans Rotate\ &Up<Tab>^WR Rota&cii\ supre<Tab>^WR
+menutrans Rotate\ &Down<Tab>^Wr Rotac&ii\ sube<Tab>^Wr
+" -SEP3-
+menutrans &Equal\ Size<Tab>^W= &Egala\ grando<Tab>^W=
+menutrans &Max\ Height<Tab>^W_ Ma&ksimuma\ alto<Tab>^W_
+menutrans M&in\ Height<Tab>^W1_ Mi&nimuma\ alto<Tab>^W1_
+menutrans Max\ &Width<Tab>^W\| Maksimuma\ &larĝo<Tab>^W\|
+menutrans Min\ Widt&h<Tab>^W1\| Minimuma\ lar&ĝo<Tab>^W1\|
+
+
+" PopUp
+
+menutrans &Undo &Malfari
+" -SEP1-
+menutrans Cu&t &Tondi
+menutrans &Copy &Kopii
+menutrans &Paste &Al&glui
+" &Buffers.&Delete overwrites this one
+menutrans &Delete &Forviŝi
+" -SEP2-
+menutrans Select\ Blockwise Apartigi\ &bloke
+menutrans Select\ &Word Apartigi\ &vorton
+menutrans Select\ &Line Apartigi\ &linion
+menutrans Select\ &Block Apartigi\ blo&kon
+menutrans Select\ &All Apartigi\ ĉi&on
+
+
+" ToolBar
+
+menutrans Open Malfermi
+menutrans Save Konservi
+menutrans SaveAll Konservi\ ĉion
+menutrans Print Presi
+" -sep1-
+menutrans Undo Rezigni
+menutrans Redo Refari
+" -sep2-
+menutrans Cut Tondi
+menutrans Copy Kopii
+menutrans Paste Alglui
+" -sep3-
+menutrans Find Trovi
+menutrans FindNext Trovi\ sekvanten
+menutrans FindPrev Trovi\ antaŭen
+menutrans Replace Anstataŭigi
+" -sep4-
+menutrans New Nova
+menutrans WinSplit DividFen
+menutrans WinMax MaksFen
+menutrans WinMin MinFen
+menutrans WinVSplit VDividFen
+menutrans WinMaxWidth MaksLarĝFen
+menutrans WinMinWidth MinLarĝFen
+menutrans WinClose FermFen
+" -sep5-
+menutrans LoadSesn ŜargSeanc
+menutrans SaveSesn KonsSeanc
+menutrans RunScript LanĉSkript
+" -sep6-
+menutrans Make Make
+menutrans RunCtags KreiEtik
+menutrans TagJump IriAlEtik
+" -sep7-
+menutrans Help Helpo
+menutrans FindHelp SerĉHelp
+
+fun! Do_toolbar_tmenu()
+ let did_toolbar_tmenu = 1
+ tmenu ToolBar.Open Malfermi dosieron
+ tmenu ToolBar.Save Konservi aktualan dosieron
+ tmenu ToolBar.SaveAll Konservi ĉiujn dosierojn
+ tmenu ToolBar.Print Presi
+ tmenu ToolBar.Undo Rezigni
+ tmenu ToolBar.Redo Refari
+ tmenu ToolBar.Cut Tondi
+ tmenu ToolBar.Copy Kopii
+ tmenu ToolBar.Paste Alglui
+ if !has("gui_athena")
+ tmenu ToolBar.Find Trovi
+ tmenu ToolBar.FindNext Trovi sekvanten
+ tmenu ToolBar.FindPrev Trovi antaŭen
+ tmenu ToolBar.Replace Anstataŭigi
+ endif
+ if 0 " disabled; These are in the Windows menu
+ tmenu ToolBar.New Nova fenestro
+ tmenu ToolBar.WinSplit Dividi fenestron
+ tmenu ToolBar.WinMax Maksimumi fenestron
+ tmenu ToolBar.WinMin Minimumi fenestron
+ tmenu ToolBar.WinVSplit Dividi vertikale
+ tmenu ToolBar.WinMaxWidth Maksimumi larĝon de fenestro
+ tmenu ToolBar.WinMinWidth Minimumi larĝon de fenestro
+ tmenu ToolBar.WinClose Fermi fenestron
+ endif
+ tmenu ToolBar.LoadSesn Malfermi seancon
+ tmenu ToolBar.SaveSesn Konservi aktualan seancon
+ tmenu ToolBar.RunScript Ruli skripton Vim
+ tmenu ToolBar.Make Lanĉi make
+ tmenu ToolBar.RunCtags Krei etikedojn
+ tmenu ToolBar.TagJump Atingi tiun etikedon
+ tmenu ToolBar.Help Helpo de Vim
+ tmenu ToolBar.FindHelp Serĉo en helparo
+endfun
+
+
+menutrans &Syntax &Sintakso
+
+menutrans &Off &Malŝalti
+menutrans &Manual &Permana
+menutrans A&utomatic &Aŭtomata
+menutrans on/off\ for\ &This\ file Ŝalti/Malŝalti\ por\ &tiu\ dosiero
+
+" The Start Of The Syntax Menu
+menutrans ABC\ music\ notation ABC\ (muzika\ notacio)
+menutrans AceDB\ model Modelo\ AceDB
+menutrans Apache\ config Konfiguro\ de\ Apache
+menutrans Apache-style\ config Konfiguro\ de\ stilo\ Apache
+menutrans ASP\ with\ VBScript ASP\ kun\ VBScript
+menutrans ASP\ with\ Perl ASP\ kun\ Perl
+menutrans Assembly Asemblilo
+menutrans BC\ calculator Kalkulilo\ BC
+menutrans BDF\ font Tiparo\ BDF
+menutrans BIND\ config Konfiguro\ de\ BIND
+menutrans BIND\ zone Zone\ BIND
+menutrans Cascading\ Style\ Sheets CSS
+menutrans Cfg\ Config\ file Konfigura\ dosiero\ \.cfg
+menutrans Cheetah\ template Ŝablono\ Cheetah
+menutrans commit\ file Dosiero\ commit
+menutrans Generic\ Config\ file Dosiero\ de\ ĝenerala\ konfiguro
+menutrans Digital\ Command\ Lang DCL
+menutrans DNS/BIND\ zone Regiono\ BIND/DNS
+menutrans Dylan\ interface Interfaco\ Dylan
+menutrans Dylan\ lid Dylan\ lid
+menutrans Elm\ filter\ rules Reguloj\ de\ filtrado\ Elm
+menutrans ERicsson\ LANGuage Erlang\ (Lingvo\ de\ Ericsson)
+menutrans Essbase\ script Skripto\ Essbase
+menutrans Eterm\ config Konfiguro\ de\ Eterm
+menutrans Exim\ conf Konfiguro\ de\ Exim
+menutrans Fvwm\ configuration Konfiguro\ de\ Fvwm
+menutrans Fvwm2\ configuration Konfiguro\ de\ Fvwm2
+menutrans Fvwm2\ configuration\ with\ M4 Konfiguro\ de\ Fvwm2\ kun\ M4
+menutrans GDB\ command\ file Komanda\ dosiero\ de\ GDB
+menutrans HTML\ with\ M4 HTML\ kun\ M4
+menutrans Cheetah\ HTML\ template Ŝablono\ Cheetah\ HTML
+menutrans IDL\Generic\ IDL Ĝenerala\ IDL\IDL
+menutrans IDL\Microsoft\ IDL IDL\IDL\ Mikrosofto
+menutrans Indent\ profile Profilo\ Indent
+menutrans Inno\ setup Konfiguro\ de\ Inno
+menutrans InstallShield\ script Skripto\ InstallShield
+menutrans KDE\ script Skripto\ KDE
+menutrans LFTP\ config Konfiguro\ de\ LFTP
+menutrans LifeLines\ script Skripto\ LifeLines
+menutrans Lynx\ Style Stilo\ de\ Lynx
+menutrans Lynx\ config Konfiguro\ de\ Lynx
+menutrans Man\ page Manlibra\ paĝo
+menutrans MEL\ (for\ Maya) MEL\ (por\ Maya)
+menutrans 4DOS\ \.bat\ file Dosiero\ \.bat\ 4DOS
+menutrans \.bat\/\.cmd\ file Dosiero\ \.bat\/\.cmd
+menutrans \.ini\ file Dosiero\ \.ini
+menutrans Module\ Definition Difino\ de\ modulo
+menutrans Registry Registraro
+menutrans Resource\ file Dosiero\ de\ rimedoj
+menutrans Novell\ NCF\ batch Staplo\ Novell\ NCF
+menutrans NSIS\ script Skripto\ NSIS
+menutrans Oracle\ config Konfiguro\ de\ Oracle
+menutrans Palm\ resource\ compiler Tradukilo\ de\ rimedoj\ Palm
+menutrans PHP\ 3-4 PHP\ 3\ et\ 4
+menutrans Postfix\ main\ config Ĉefa\ konfiguro\ de\ Postfix
+menutrans Povray\ scene\ descr Scenejo\ Povray
+menutrans Povray\ configuration Konfiguro\ de\ Povray
+menutrans Purify\ log Protokolo\ de\ Purify
+menutrans Readline\ config Konfiguro\ de\ Readline
+menutrans RCS\ log\ output Protokola\ eligo\ de\ RCS
+menutrans RCS\ file Dosiero\ RCS
+menutrans RockLinux\ package\ desc\. Priskribo\ de\ pakaĵoj\ RockLinux
+menutrans Samba\ config Konfiguro\ de\ Samba
+menutrans SGML\ catalog Katalogo\ SGML
+menutrans SGML\ DTD DTD\ SGML
+menutrans SGML\ Declaration Deklaracio\ SGML
+menutrans Shell\ script Skripto-ŝelo
+menutrans sh\ and\ ksh sh\ kaj\ ksh
+menutrans Sinda\ compare Komparo\ Sinda
+menutrans Sinda\ input Enigo\ Sinda
+menutrans Sinda\ output Eligo\ Sinda
+menutrans SKILL\ for\ Diva SKILL\ por\ Diva
+menutrans Smarty\ Templates Ŝablono\ Smarty
+menutrans SNNS\ network Reto\ SNNS
+menutrans SNNS\ pattern Ŝablono\ SNNS
+menutrans SNNS\ result Rezulto\ SNNS
+menutrans Snort\ Configuration Konfiguro\ de\ Snort
+menutrans Squid\ config Konfiguro\ de\ Squid
+menutrans Subversion\ commit Commit\ Subversion
+menutrans TAK\ compare Komparo\ TAK
+menutrans TAK\ input Enigo\ TAK
+menutrans TAK\ output Eligo\ TAK
+menutrans TeX\ configuration Konfiguro\ de\ TeX
+menutrans TF\ mud\ client TF\ (client\ MUD)
+menutrans Tidy\ configuration Konfiguro\ de\ Tidy
+menutrans Trasys\ input Enigo\ Trasys
+menutrans Command\ Line Komanda\ linio
+menutrans Geometry Geometrio
+menutrans Optics Optiko
+menutrans Vim\ help\ file Helpa\ dosiero\ de\ Vim
+menutrans Vim\ script Skripto\ Vim
+menutrans Viminfo\ file Dosiero\ Viminfo
+menutrans Virata\ config Konfiguro\ de\ Virata
+menutrans Wget\ config Konfiguro\ de\ wget
+menutrans Whitespace\ (add) Spacetoj
+menutrans WildPackets\ EtherPeek\ Decoder Malkodilo\ WildPackets\ EtherPeek
+menutrans X\ resources Rimedoj\ X
+menutrans XXD\ hex\ dump Eligo\ deksesuma\.\ de\ xxd
+menutrans XFree86\ Config Konfiguro\ de\ XFree86
+" The End Of The Syntax Menu
+
+menutrans &Show\ filetypes\ in\ menu &Montri\ dosiertipojn\ en\ menuo
+" -SEP1-
+menutrans Set\ '&syntax'\ only Ŝalti\ nur\ '&syntax'
+menutrans Set\ '&filetype'\ too Ŝalti\ ankaŭ\ '&filetype'
+menutrans &Off M&alŝaltita
+" -SEP3-
+menutrans Co&lor\ test Testo\ de\ &koloroj
+menutrans &Highlight\ test Testo\ de\ &emfazo
+menutrans &Convert\ to\ HTML Konverti\ al\ &HTML
diff --git a/runtime/lang/menu_eo_xx.utf-8.vim b/runtime/lang/menu_eo_xx.utf-8.vim
new file mode 100644
index 00000000..7a2b9ee9
--- /dev/null
+++ b/runtime/lang/menu_eo_xx.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Esperanto for UTF-8 encoding
+
+source <sfile>:p:h/menu_eo.utf-8.vim
diff --git a/runtime/lang/menu_fi.utf-8.vim b/runtime/lang/menu_fi.utf-8.vim
new file mode 100644
index 00000000..b33639cd
--- /dev/null
+++ b/runtime/lang/menu_fi.utf-8.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Finnish for UTF-8 encoding
+
+source <sfile>:p:h/menu_fi_fi.latin1.vim
diff --git a/runtime/lang/menu_finnish_finland.1252.vim b/runtime/lang/menu_finnish_finland.1252.vim
new file mode 100644
index 00000000..ad62e032
--- /dev/null
+++ b/runtime/lang/menu_finnish_finland.1252.vim
@@ -0,0 +1,3 @@
+" Menu Translations: Finnish for Windows CodePage 1252 encoding
+
+source <sfile>:p:h/menu_fi_fi.latin1.vim
diff --git a/runtime/macros/matchit.txt b/runtime/macros/matchit.txt
index 57373fe5..8a3a96e2 100644
--- a/runtime/macros/matchit.txt
+++ b/runtime/macros/matchit.txt
@@ -4,7 +4,7 @@ For instructions on installing this file, type
:help matchit-install
inside Vim.
-For Vim version 6.3. Last change: 2006 Feb 23
+For Vim version 6.3. Last change: 2007 Aug 29
VIM REFERENCE MANUAL by Benji Fisher
@@ -34,7 +34,7 @@ in your |vimrc| file: >
*g%* *v_g%* *o_g%*
g% Cycle backwards through matching groups, as specified by
- |b:match_words|. For example, go from "endif" to "else" to "if".
+ |b:match_words|. For example, go from "if" to "endif" to "else".
*[%* *v_[%* *o_[%*
[% Go to [count] previous unmatched group, as specified by
@@ -64,9 +64,9 @@ option. The matchit plugin extends this in several ways:
By default, words inside comments and strings are ignored, unless
the cursor is inside a comment or string when you type "%". If the
only thing you want to do is modify the behavior of "%" so that it
- behaves this way, you can >
- :let b:match_words = &matchpairs
-<
+ behaves this way, you do not have to define |b:match_words|, since the
+ script uses the 'matchpairs' option as well as this variable.
+
See |matchit-details| for details on what the script does, and |b:match_words|
for how to specify matching patterns.
@@ -84,7 +84,7 @@ LANGUAGES: *matchit-languages*
Currently, the following languages are supported: Ada, ASP with VBS, Csh,
DTD, Entity, Essbase, Fortran, HTML, JSP (same as HTML), LaTeX, Lua, Pascal,
SGML, Shell, Tcsh, Vim, XML. Other languages may already have support via
-|filetype-plugin|s.
+the default |filetype-plugin|s in the standard vim distribution.
To support a new language, see |matchit-newlang| below.
@@ -109,7 +109,6 @@ The script follows these rules:
Prefer a match that includes the cursor position (that is, one that
starts on or before the cursor).
Prefer a match that starts as close to the cursor as possible.
- Prefer a match in |b:match_words| to a match in 'matchpairs'.
If more than one pattern in |b:match_words| matches, choose the one
that is listed first.
@@ -131,9 +130,10 @@ Examples:
cursor starts on the "end " then "end if" is chosen. (You can avoid
this problem by using a more complicated pattern.)
-If there is no match, the script falls back on the usual behavior of |%|. If
-debugging is turned on, the matched bit of text is saved as |b:match_match|
-and the cursor column of the start of the match is saved as |b:match_col|.
+If there is no match, the cursor does not move. (Before version 1.13 of the
+script, it would fall back on the usual behavior of |%|). If debugging is
+turned on, the matched bit of text is saved as |b:match_match| and the cursor
+column of the start of the match is saved as |b:match_col|.
Next, the script looks through |b:match_words| (original and parsed versions)
for the group and pattern that match. If debugging is turned on, the group is
@@ -160,11 +160,13 @@ or >
:runtime macros/matchit.vim
Either way, the script should start working the next time you start up Vim.
-The script does nothing unless it finds a |buffer-variable| named
-|b:match_words|. The script contains autocommands that set this variable for
-various file types: see |matchit-languages| above. For a new language, you
-can add autocommands to the script or to your vimrc file, but the recommended
-method is to add a line such as >
+(Earlier versions of the script did nothing unless a |buffer-variable| named
+|b:match_words| was defined. Even earlier versions contained autocommands
+that set this variable for various file types. Now, |b:match_words| is
+defined in many of the default |filetype-plugin|s instead.)
+
+For a new language, you can add autocommands to the script or to your vimrc
+file, but the recommended method is to add a line such as >
let b:match_words = '\<foo\>:\<bar\>'
to the |filetype-plugin| for your language. See |b:match_words| below for how
this variable is interpreted.
diff --git a/runtime/syntax/2html.vim b/runtime/syntax/2html.vim
index 8f443272..bd401661 100644
--- a/runtime/syntax/2html.vim
+++ b/runtime/syntax/2html.vim
@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2007 Mar 10
+" Last Change: 2007 Aug 31
" (modified by David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>)
" (XHTML support by Panagiotis Issaris <takis@lumumba.luc.ac.be>)
" (made w3 compliant by Edd Barrett <vext01@gmail.com>)
@@ -162,9 +162,9 @@ else
let s:html_encoding = 'iso-8859-1'
elseif s:vim_encoding =~ "^cp12"
let s:html_encoding = substitute(s:vim_encoding, 'cp', 'windows-', '')
- elseif s:vim_encoding == 'sjis'
+ elseif s:vim_encoding == 'sjis' || s:vim_encoding == 'cp932'
let s:html_encoding = 'Shift_JIS'
- elseif s:vim_encoding == 'big5'
+ elseif s:vim_encoding == 'big5' || s:vim_encoding == 'cp950'
let s:html_encoding = "Big5"
elseif s:vim_encoding == 'euc-cn'
let s:html_encoding = 'GB_2312-80'
diff --git a/runtime/syntax/colortest.vim b/runtime/syntax/colortest.vim
index 377eba98..58de7aaf 100644
--- a/runtime/syntax/colortest.vim
+++ b/runtime/syntax/colortest.vim
@@ -1,7 +1,7 @@
" Vim script for testing colors
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Contributors: Rafael Garcia-Suarez, Charles Campbell
-" Last Change: 2006 Feb 20
+" Last Change: 2008 Jun 04
" edit this file, then do ":source %", and check if the colors match
@@ -55,11 +55,18 @@
" Open this file in a window if it isn't edited yet.
" Use the current window if it's empty.
if expand('%:p') != expand('<sfile>:p')
+ let s:fname = expand('<sfile>')
+ if exists('*fnameescape')
+ let s:fname = fnameescape(s:fname)
+ else
+ let s:fname = escape(s:fname, ' \|')
+ endif
if &mod || line('$') != 1 || getline(1) != ''
- exe "new " . expand('<sfile>')
+ exe "new " . s:fname
else
- exe "edit " . expand('<sfile>')
+ exe "edit " . s:fname
endif
+ unlet s:fname
endif
syn clear
diff --git a/runtime/syntax/def.vim b/runtime/syntax/def.vim
index a360022b..48518d74 100644
--- a/runtime/syntax/def.vim
+++ b/runtime/syntax/def.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: Microsoft Module-Definition (.def) File
-" Maintainer: Rob Brady <robb@datatone.com>
+" Orig Author: Rob Brady <robb@datatone.com>
+" Maintainer: Wu Yongwei <wuyongwei@gmail.com>
" Last Change: $Date$
-" URL: http://www.datatone.com/~robb/vim/syntax/def.vim
" $Revision$
" For version 5.x: Clear all syntax items
@@ -23,7 +23,7 @@ syn keyword defKeyword HEAPSIZE DATA
syn keyword defStorage LOADONCALL MOVEABLE DISCARDABLE SINGLE
syn keyword defStorage FIXED PRELOAD
-syn match defOrdinal "@\d\+"
+syn match defOrdinal "\s\+@\d\+"
syn region defString start=+'+ end=+'+
diff --git a/runtime/syntax/dtrace.vim b/runtime/syntax/dtrace.vim
new file mode 100644
index 00000000..2f2d6e2c
--- /dev/null
+++ b/runtime/syntax/dtrace.vim
@@ -0,0 +1,150 @@
+" DTrace D script syntax file. To avoid confusion with the D programming
+" language, I call this script dtrace.vim instead of d.vim.
+" Language: D script as described in "Solaris Dynamic Tracing Guide",
+" http://docs.sun.com/app/docs/doc/817-6223
+" Version: 1.5
+" Last Change: 2008/04/05
+" Maintainer: Nicolas Weber <nicolasweber@gmx.de>
+
+" dtrace lexer and parser are at
+" http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libdtrace/common/dt_lex.l
+" http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libdtrace/common/dt_grammar.y
+
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" Read the C syntax to start with
+if version < 600
+ so <sfile>:p:h/c.vim
+else
+ runtime! syntax/c.vim
+ unlet b:current_syntax
+endif
+
+syn clear cCommentL " dtrace doesn't support // style comments
+
+" First line may start with #!, also make sure a '-s' flag is somewhere in
+" that line.
+syn match dtraceComment "\%^#!.*-s.*"
+
+" Probe descriptors need explicit matches, so that keywords in probe
+" descriptors don't show up as errors. Note that this regex detects probes
+" as "something with three ':' in it". This works in practice, but it's not
+" really correct. Also add special case code for BEGIN, END and ERROR, since
+" they are common.
+" Be careful not to detect '/*some:::node*/\n/**/' as probe, as it's
+" commented out.
+" XXX: This allows a probe description to end with ',', even if it's not
+" followed by another probe.
+" XXX: This doesn't work if followed by a comment.
+let s:oneProbe = '\%(BEGIN\|END\|ERROR\|\S\{-}:\S\{-}:\S\{-}:\S\{-}\)\_s*'
+exec 'syn match dtraceProbe "'.s:oneProbe.'\%(,\_s*'.s:oneProbe.'\)*\ze\_s\%({\|\/[^*]\|\%$\)"'
+
+" Note: We have to be careful to not make this match /* */ comments.
+" Also be careful not to eat `c = a / b; b = a / 2;`. We use the same
+" technique as the dtrace lexer: a predicate has to be followed by {, ;, or
+" EOF. Also note that dtrace doesn't allow an empty predicate // (we do).
+" This regex doesn't allow a divison operator in the predicate.
+" Make sure that this matches the empty predicate as well.
+" XXX: This doesn't work if followed by a comment.
+syn match dtracePredicate "/\*\@!\_[^/]*/\ze\_s*\%({\|;\|\%$\)"
+ "contains=ALLBUT,dtraceOption " this lets the region contain too much stuff
+
+" Pragmas.
+" dtrace seems not to support whitespace before or after the '='. dtrace
+" supports only one option per #pragma, and no continuations of #pragma over
+" several lines with '\'.
+" Note that dtrace treats units (Hz etc) as case-insenstive, we allow only
+" sane unit capitalization in this script (ie 'ns', 'us', 'ms', 's' have to be
+" small, Hertz can be 'Hz' or 'hz')
+" XXX: "cpu" is always highlighted as builtin var, not as option
+
+" auto or manual: bufresize
+syn match dtraceOption contained "bufresize=\%(auto\|manual\)\s*$"
+
+" scalar: cpu jstackframes jstackstrsize nspec stackframes stackindent ustackframes
+syn match dtraceOption contained "\%(cpu\|jstackframes\|jstackstrsize\|nspec\|stackframes\|stackindent\|ustackframes\)=\d\+\s*$"
+
+" size: aggsize bufsize dynvarsize specsize strsize
+" size defaults to something if no unit is given (ie., having no unit is ok)
+syn match dtraceOption contained "\%(aggsize\|bufsize\|dynvarsize\|specsize\|strsize\)=\d\+\%(k\|m\|g\|t\|K\|M\|G\|T\)\=\s*$"
+
+" time: aggrate cleanrate statusrate switchrate
+" time defaults to hz if no unit is given
+syn match dtraceOption contained "\%(aggrate\|cleanrate\|statusrate\|switchrate\)=\d\+\%(hz\|Hz\|ns\|us\|ms\|s\)\=\s*$"
+
+" No type: defaultargs destructive flowindent grabanon quiet rawbytes
+syn match dtraceOption contained "\%(defaultargs\|destructive\|flowindent\|grabanon\|quiet\|rawbytes\)\s*$"
+
+
+" Turn reserved but unspecified keywords into errors
+syn keyword dtraceReservedKeyword auto break case continue counter default do
+syn keyword dtraceReservedKeyword else for goto if import probe provider
+syn keyword dtraceReservedKeyword register restrict return static switch while
+
+" Add dtrace-specific stuff
+syn keyword dtraceOperator sizeof offsetof stringof xlate
+syn keyword dtraceStatement self inline xlate this translator
+
+" Builtin variables
+syn keyword dtraceIdentifier arg0 arg1 arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9
+syn keyword dtraceIdentifier args caller chip cpu curcpu curlwpsinfo curpsinfo
+syn keyword dtraceIdentifier curthread cwd epid errno execname gid id ipl lgrp
+syn keyword dtraceIdentifier pid ppid probefunc probemod probename probeprov
+syn keyword dtraceIdentifier pset root stackdepth tid timestamp uid uregs
+syn keyword dtraceIdentifier vtimestamp walltimestamp
+syn keyword dtraceIdentifier ustackdepth
+
+" Macro Variables
+syn match dtraceConstant "$[0-9]\+"
+syn match dtraceConstant "$\(egid\|euid\|gid\|pgid\|ppid\)"
+syn match dtraceConstant "$\(projid\|sid\|target\|taskid\|uid\)"
+
+" Data Recording Actions
+syn keyword dtraceFunction trace tracemem printf printa stack ustack jstack
+
+" Process Destructive Actions
+syn keyword dtraceFunction stop raise copyout copyoutstr system
+
+" Kernel Destructive Actions
+syn keyword dtraceFunction breakpoint panic chill
+
+" Special Actions
+syn keyword dtraceFunction speculate commit discard exit
+
+" Subroutines
+syn keyword dtraceFunction alloca basename bcopy cleanpath copyin copyinstr
+syn keyword dtraceFunction copyinto dirname msgdsize msgsize mutex_owned
+syn keyword dtraceFunction mutex_owner mutex_type_adaptive progenyof
+syn keyword dtraceFunction rand rw_iswriter rw_write_held speculation
+syn keyword dtraceFunction strjoin strlen
+
+" Aggregating Functions
+syn keyword dtraceAggregatingFunction count sum avg min max lquantize quantize
+
+syn keyword dtraceType int8_t int16_t int32_t int64_t intptr_t
+syn keyword dtraceType uint8_t uint16_t uint32_t uint64_t uintptr_t
+syn keyword dtraceType string
+syn keyword dtraceType pid_t id_t
+
+
+" Define the default highlighting.
+" We use `hi def link` directly, this requires 5.8.
+hi def link dtraceReservedKeyword Error
+hi def link dtracePredicate String
+hi def link dtraceProbe dtraceStatement
+hi def link dtraceStatement Statement
+hi def link dtraceConstant Constant
+hi def link dtraceIdentifier Identifier
+hi def link dtraceAggregatingFunction dtraceFunction
+hi def link dtraceFunction Function
+hi def link dtraceType Type
+hi def link dtraceOperator Operator
+hi def link dtraceComment Comment
+hi def link dtraceNumber Number
+hi def link dtraceOption Identifier
+
+let b:current_syntax = "dtrace"
diff --git a/runtime/syntax/erlang.vim b/runtime/syntax/erlang.vim
index a8ffb393..e3d68363 100644
--- a/runtime/syntax/erlang.vim
+++ b/runtime/syntax/erlang.vim
@@ -1,11 +1,11 @@
" Vim syntax file
" Language: erlang (ERicsson LANGuage)
-" http://www.erlang.se
-" http://www.erlang.org
-" Maintainer: Kreimir Mari (Kresimir Marzic) <kmarzic@fly.srk.fer.hr>
-" Last update: Fri, 15-Feb-2002
+" http://www.erlang.se
+" http://www.erlang.org
+" Maintainer: Csaba Hoch <csaba.hoch@gmail.com>
+" Former Maintainer: Kreąimir Marľić (Kresimir Marzic) <kmarzic@fly.srk.fer.hr>
+" Last update: 12-Mar-2008
" Filenames: .erl
-" URL: http://www.srk.fer.hr/~kmarzic/vim/syntax/erlang.vim
" There are three sets of highlighting in here:
@@ -24,9 +24,9 @@
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
- syntax clear
+ syntax clear
elseif exists ("b:current_syntax")
- finish
+ finish
endif
@@ -35,136 +35,140 @@ syn case match
if ! exists ("erlang_characters")
- " Basic elements
- syn match erlangComment +%.*$+
- syn match erlangModifier "\~\a\|\\\a" contained
- syn match erlangSpecialCharacter ":\|_\|@\|\\\|\"\|\."
- syn match erlangSeparator "(\|)\|{\|}\|\[\|]\||\|||\|;\|,\|?\|->\|#" contained
- syn region erlangString start=+"+ skip=+\\"+ end=+"+ contains=erlangModifier
- syn region erlangAtom start=+'+ skip=+\\'+ end=+'+
-
- " Operators
- syn match erlangOperator "+\|-\|\*\|\/"
- syn keyword erlangOperator div rem or xor bor bxor bsl bsr
- syn keyword erlangOperator and band not bnot
- syn match erlangOperator "==\|/=\|=:=\|=/=\|<\|=<\|>\|>="
- syn match erlangOperator "++\|--\|=\|!\|<-"
-
- " Numbers
- syn match erlangNumberInteger "[+-]\=\d\+" contains=erlangSeparator
- syn match erlangNumberFloat1 "[+-]\=\d\+.\d\+" contains=erlangSeparator
- syn match erlangNumberFloat2 "[+-]\=\d\+\(.\d\+\)\=[eE][+-]\=\d\+\(.\d\+\)\=" contains=erlangSeparator
- syn match erlangNumberFloat3 "[+-]\=\d\+[#]\x\+" contains=erlangSeparator
- syn match erlangNumberFloat4 "[+-]\=[eE][+-]\=\d\+" contains=erlangSeparator
- syn match erlangNumberHex "$\x\+" contains=erlangSeparator
-
- " Ignore '_' and '-' in words
- syn match erlangWord "\w\+[_-]\+\w\+"
-
- " Ignore numbers in words
- syn match erlangWord "\w\+\d\+\(\(.\d\+\)\=\(\w\+\)\=\)\="
+
+ " Basic elements
+ syn match erlangComment "%.*$" contains=erlangAnnotation,erlangTodo
+ syn match erlangAnnotation " \@<=@\%(clear\|docfile\|end\|headerfile\|todo\|TODO\|type\|author\|copyright\|doc\|reference\|see\|since\|title\|version\|deprecated\|hidden\|private\|equiv\|spec\|throws\)" contained
+ syn match erlangAnnotation "`[^']*'" contained
+ syn keyword erlangTodo TODO FIXME XXX contained
+ syn match erlangModifier "\~\a\|\\\a\|\\\\" contained
+ syn match erlangSpecialCharacter ":\|_\|@\|\\\|\"\|\."
+ syn match erlangSeparator "(\|)\|{\|}\|\[\|]\||\|||\|;\|,\|?\|->\|#" contained
+ syn region erlangString start=+"+ skip=+\\.+ end=+"+ contains=erlangModifier
+ syn region erlangAtom start=+'+ skip=+\\'+ end=+'+
+
+ " Operators
+ syn match erlangOperator "+\|-\|\*\|\/"
+ syn keyword erlangOperator div rem or xor bor bxor bsl bsr
+ syn keyword erlangOperator and band not bnot
+ syn match erlangOperator "==\|/=\|=:=\|=/=\|<\|=<\|>\|>="
+ syn match erlangOperator "++\|--\|=\|!\|<-"
+
+ " Numbers
+ syn match erlangNumberInteger "\d\+" contains=erlangSeparator
+ syn match erlangNumberFloat1 "\d\+\.\d\+" contains=erlangSeparator
+ syn match erlangNumberFloat2 "\d\+\(\.\d\+\)\=[eE][+-]\=\d\+\(\.\d\+\)\=" contains=erlangSeparator
+ syn match erlangNumberFloat3 "\d\+[#]\x\+" contains=erlangSeparator
+ syn match erlangNumberHex "$\x\+" contains=erlangSeparator
+
+ " Ignore '_' and '-' in words
+ syn match erlangWord "\h\+\w*"
+
+ syn match erlangChar /\$./
endif
if ! exists ("erlang_functions")
- " Functions call
- syn match erlangFCall "\w\+\(\s\+\)\=[:@]\(\s\+\)\=\w\+" contains=ALLBUT,erlangFunction,erlangBIF,erlangWord
-
- " build-in-functions (BIFs)
- syn keyword erlangBIF abs alive apply atom_to_list
- syn keyword erlangBIF binary_to_list binary_to_term
- syn keyword erlangBIF concat_binary
- syn keyword erlangBIF date disconnect_node
- syn keyword erlangBIF element erase exit
- syn keyword erlangBIF float float_to_list
- syn keyword erlangBIF get get_keys group_leader
- syn keyword erlangBIF halt hd
- syn keyword erlangBIF integer_to_list is_alive
- syn keyword erlangBIF length link list_to_atom list_to_binary
- syn keyword erlangBIF list_to_float list_to_integer list_to_pid
- syn keyword erlangBIF list_to_tuple load_module
- syn keyword erlangBIF make_ref monitor_node
- syn keyword erlangBIF node nodes now
- syn keyword erlangBIF open_port
- syn keyword erlangBIF pid_to_list process_flag
- syn keyword erlangBIF process_info process put
- syn keyword erlangBIF register registered round
- syn keyword erlangBIF self setelement size spawn
- syn keyword erlangBIF spawn_link split_binary statistics
- syn keyword erlangBIF term_to_binary throw time tl trunc
- syn keyword erlangBIF tuple_to_list
- syn keyword erlangBIF unlink unregister
- syn keyword erlangBIF whereis
-
- " Other BIFs
- syn keyword erlangBIF atom binary constant function integer
- syn keyword erlangBIF list number pid ports port_close port_info
- syn keyword erlangBIF reference record
-
- " erlang:BIFs
- syn keyword erlangBIF check_process_code delete_module
- syn keyword erlangBIF get_cookie hash math module_loaded
- syn keyword erlangBIF preloaded processes purge_module set_cookie
- syn keyword erlangBIF set_node
-
- " functions of math library
- syn keyword erlangFunction acos asin atan atan2 cos cosh exp
- syn keyword erlangFunction log log10 pi pow power sin sinh sqrt
- syn keyword erlangFunction tan tanh
-
- " Other functions
- syn keyword erlangFunction call module_info parse_transform
- syn keyword erlangFunction undefined_function
-
- " Modules
- syn keyword erlangModule error_handler
+ " Functions call
+ syn match erlangFCall "\%(\w\+\s*\.\s*\)*\w\+\s*[:@]\s*\w\+"
+
+ " build-in-functions (BIFs)
+ syn keyword erlangBIF abs alive apply atom_to_list
+ syn keyword erlangBIF binary_to_list binary_to_term
+ syn keyword erlangBIF concat_binary
+ syn keyword erlangBIF date disconnect_node
+ syn keyword erlangBIF element erase exit
+ syn keyword erlangBIF float float_to_list
+ syn keyword erlangBIF get get_keys group_leader
+ syn keyword erlangBIF halt hd
+ syn keyword erlangBIF integer_to_list is_alive
+ syn keyword erlangBIF length link list_to_atom list_to_binary
+ syn keyword erlangBIF list_to_float list_to_integer list_to_pid
+ syn keyword erlangBIF list_to_tuple load_module
+ syn keyword erlangBIF make_ref monitor_node
+ syn keyword erlangBIF node nodes now
+ syn keyword erlangBIF open_port
+ syn keyword erlangBIF pid_to_list process_flag
+ syn keyword erlangBIF process_info process put
+ syn keyword erlangBIF register registered round
+ syn keyword erlangBIF self setelement size spawn
+ syn keyword erlangBIF spawn_link split_binary statistics
+ syn keyword erlangBIF term_to_binary throw time tl trunc
+ syn keyword erlangBIF tuple_to_list
+ syn keyword erlangBIF unlink unregister
+ syn keyword erlangBIF whereis
+
+ " Other BIFs
+ syn keyword erlangBIF atom binary constant function integer
+ syn keyword erlangBIF list number pid ports port_close port_info
+ syn keyword erlangBIF reference record
+
+ " erlang:BIFs
+ syn keyword erlangBIF check_process_code delete_module
+ syn keyword erlangBIF get_cookie hash math module_loaded
+ syn keyword erlangBIF preloaded processes purge_module set_cookie
+ syn keyword erlangBIF set_node
+
+ " functions of math library
+ syn keyword erlangFunction acos asin atan atan2 cos cosh exp
+ syn keyword erlangFunction log log10 pi pow power sin sinh sqrt
+ syn keyword erlangFunction tan tanh
+
+ " Other functions
+ syn keyword erlangFunction call module_info parse_transform
+ syn keyword erlangFunction undefined_function
+
+ " Modules
+ syn keyword erlangModule error_handler
endif
if ! exists ("erlang_keywords")
- " Constants and Directives
- syn match erlangDirective "-compile\|-define\|-else\|-endif\|-export\|-file"
- syn match erlangDirective "-ifdef\|-ifndef\|-import\|-include\|-include_lib"
- syn match erlangDirective "-module\|-record\|-undef"
-
- syn match erlangConstant "-author\|-copyright\|-doc"
-
- " Keywords
- syn keyword erlangKeyword after begin case catch
- syn keyword erlangKeyword cond end fun if
- syn keyword erlangKeyword let of query receive
- syn keyword erlangKeyword when
-
- " Processes
- syn keyword erlangProcess creation current_function dictionary
- syn keyword erlangProcess group_leader heap_size high initial_call
- syn keyword erlangProcess linked low memory_in_use message_queue
- syn keyword erlangProcess net_kernel node normal priority
- syn keyword erlangProcess reductions registered_name runnable
- syn keyword erlangProcess running stack_trace status timer
- syn keyword erlangProcess trap_exit waiting
-
- " Ports
- syn keyword erlangPort command count_in count_out creation in
- syn keyword erlangPort in_format linked node out owner packeting
-
- " Nodes
- syn keyword erlangNode atom_tables communicating creation
- syn keyword erlangNode current_gc current_reductions current_runtime
- syn keyword erlangNode current_wall_clock distribution_port
- syn keyword erlangNode entry_points error_handler friends
- syn keyword erlangNode garbage_collection magic_cookie magic_cookies
- syn keyword erlangNode module_table monitored_nodes name next_ref
- syn keyword erlangNode ports preloaded processes reductions
- syn keyword erlangNode ref_state registry runtime wall_clock
-
- " Reserved
- syn keyword erlangReserved apply_lambda module_info module_lambdas
- syn keyword erlangReserved record record_index record_info
-
- " Extras
- syn keyword erlangExtra badarg nocookie false fun true
-
- " Signals
- syn keyword erlangSignal badsig kill killed exit normal
+ " Constants and Directives
+ syn match erlangDirective "-behaviour\|-behaviour"
+ syn match erlangDirective "-compile\|-define\|-else\|-endif\|-export\|-file"
+ syn match erlangDirective "-ifdef\|-ifndef\|-import\|-include_lib\|-include"
+ syn match erlangDirective "-module\|-record\|-undef"
+
+ syn match erlangConstant "-author\|-copyright\|-doc\|-vsn"
+
+ " Keywords
+ syn keyword erlangKeyword after begin case catch
+ syn keyword erlangKeyword cond end fun if
+ syn keyword erlangKeyword let of query receive
+ syn keyword erlangKeyword when
+ syn keyword erlangKeyword try
+
+ " Processes
+ syn keyword erlangProcess creation current_function dictionary
+ syn keyword erlangProcess group_leader heap_size high initial_call
+ syn keyword erlangProcess linked low memory_in_use message_queue
+ syn keyword erlangProcess net_kernel node normal priority
+ syn keyword erlangProcess reductions registered_name runnable
+ syn keyword erlangProcess running stack_trace status timer
+ syn keyword erlangProcess trap_exit waiting
+
+ " Ports
+ syn keyword erlangPort command count_in count_out creation in
+ syn keyword erlangPort in_format linked node out owner packeting
+
+ " Nodes
+ syn keyword erlangNode atom_tables communicating creation
+ syn keyword erlangNode current_gc current_reductions current_runtime
+ syn keyword erlangNode current_wall_clock distribution_port
+ syn keyword erlangNode entry_points error_handler friends
+ syn keyword erlangNode garbage_collection magic_cookie magic_cookies
+ syn keyword erlangNode module_table monitored_nodes name next_ref
+ syn keyword erlangNode ports preloaded processes reductions
+ syn keyword erlangNode ref_state registry runtime wall_clock
+
+ " Reserved
+ syn keyword erlangReserved apply_lambda module_info module_lambdas
+ syn keyword erlangReserved record record_index record_info
+
+ " Extras
+ syn keyword erlangExtra badarg nocookie false fun true
+
+ " Signals
+ syn keyword erlangSignal badsig kill killed exit normal
endif
@@ -173,52 +177,53 @@ endif
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists ("did_erlang_inits")
- if version < 508
- let did_erlang_inits = 1
- command -nargs=+ HiLink hi link <args>
- else
- command -nargs=+ HiLink hi def link <args>
- endif
-
- " erlang_characters
- HiLink erlangComment Comment
- HiLink erlangSpecialCharacter Special
- HiLink erlangSeparator Normal
- HiLink erlangModifier Special
- HiLink erlangOperator Operator
- HiLink erlangString String
- HiLink erlangAtom Type
-
- HiLink erlangNumberInteger Number
- HiLink erlangNumberFloat1 Float
- HiLink erlangNumberFloat2 Float
- HiLink erlangNumberFloat3 Float
- HiLink erlangNumberFloat4 Float
- HiLink erlangNumberHex Number
-
- HiLink erlangWord Normal
-
- " erlang_functions
- HiLink erlangFCall Function
- HiLink erlangBIF Function
- HiLink erlangFunction Function
- HiLink erlangModuleFunction Function
-
- " erlang_keywords
- HiLink erlangDirective Type
- HiLink erlangConstant Type
- HiLink erlangKeyword Keyword
- HiLink erlangProcess Special
- HiLink erlangPort Special
- HiLink erlangNode Special
- HiLink erlangReserved Statement
- HiLink erlangExtra Statement
- HiLink erlangSignal Statement
-
- delcommand HiLink
+ if version < 508
+ let did_erlang_inits = 1
+ command -nargs=+ HiLink hi link <args>
+ else
+ command -nargs=+ HiLink hi def link <args>
+ endif
+
+ " erlang_characters
+ HiLink erlangComment Comment
+ HiLink erlangAnnotation Special
+ HiLink erlangTodo Todo
+ HiLink erlangSpecialCharacter Special
+ HiLink erlangSeparator Normal
+ HiLink erlangModifier Special
+ HiLink erlangOperator Operator
+ HiLink erlangString String
+ HiLink erlangAtom Type
+
+ HiLink erlangNumberInteger Number
+ HiLink erlangNumberFloat1 Float
+ HiLink erlangNumberFloat2 Float
+ HiLink erlangNumberFloat3 Float
+ HiLink erlangNumberFloat4 Float
+ HiLink erlangNumberHex Number
+
+ HiLink erlangWord Normal
+
+ " erlang_functions
+ HiLink erlangFCall Function
+ HiLink erlangBIF Function
+ HiLink erlangFunction Function
+ HiLink erlangModuleFunction Function
+
+ " erlang_keywords
+ HiLink erlangDirective Type
+ HiLink erlangConstant Type
+ HiLink erlangKeyword Keyword
+ HiLink erlangProcess Special
+ HiLink erlangPort Special
+ HiLink erlangNode Special
+ HiLink erlangReserved Statement
+ HiLink erlangExtra Statement
+ HiLink erlangSignal Statement
+
+ delcommand HiLink
endif
let b:current_syntax = "erlang"
-" eof
diff --git a/runtime/syntax/eruby.vim b/runtime/syntax/eruby.vim
index f85e0093..22a84537 100644
--- a/runtime/syntax/eruby.vim
+++ b/runtime/syntax/eruby.vim
@@ -82,4 +82,4 @@ if main_syntax == 'eruby'
unlet main_syntax
endif
-" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
+" vim: nowrap sw=2 sts=2 ts=8 :
diff --git a/runtime/syntax/esterel.vim b/runtime/syntax/esterel.vim
index cc3c4d73..d853e752 100644
--- a/runtime/syntax/esterel.vim
+++ b/runtime/syntax/esterel.vim
@@ -1,10 +1,10 @@
" Vim syntax file
" Language: ESTEREL
" Maintainer: Maurizio Tranchero <maurizio.tranchero@polito.it> - <maurizio.tranchero@gmail.com>
-" Credits: Luca Necchi <luca.necchi@polito.it>
+" Credits: Luca Necchi <luca.necchi@polito.it>, Nikos Andrikos <nick.andrik@gmail.com>
" First Release: Tue May 17 23:49:39 CEST 2005
-" Last Change: Sat Apr 22 14:56:41 CEST 2006
-" Version: 0.5
+" Last Change: Tue May 6 13:29:56 CEST 2008
+" Version: 0.8
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -28,7 +28,7 @@ syn region esterelIfThen start=/if/ end=/then/ oneline
" Esterel Keywords
syn keyword esterelIO input output inputoutput constant
syn keyword esterelBoolean and or not xor xnor nor nand
-syn keyword esterelExpressions mod
+syn keyword esterelExpressions mod pre
syn keyword esterelStatement nothing halt
syn keyword esterelStatement module signal sensor end
syn keyword esterelStatement every do loop abort weak
@@ -43,20 +43,26 @@ syn keyword esterelStatement relation
syn keyword esterelFunctions function procedure task
syn keyword esterelSysCall call trap exit exec
" Esterel Types
-syn keyword esterelType integer float bolean
+syn keyword esterelType integer float bolean
" Esterel Comment
-syn match esterelComment "%.*$"
+syn match esterelComment "%.*$"
" Operators and special characters
-syn match esterelSpecial ":"
-syn match esterelSpecial "<="
-syn match esterelSpecial ">="
-syn match esterelSpecial ";"
-syn match esterelOperator "\["
-syn match esterelOperator "\]"
-syn match esterelOperator ":="
-syn match esterelStatement "\<\(if\|else\)\>"
-syn match esterelNone "\<else\s\+if\>$"
-syn match esterelNone "\<else\s\+if\>\s"
+syn match esterelSpecial ":"
+syn match esterelSpecial "<="
+syn match esterelSpecial ">="
+syn match esterelSpecial "+"
+syn match esterelSpecial "-"
+syn match esterelSpecial "="
+syn match esterelSpecial ";"
+syn match esterelSpecial "/"
+syn match esterelSpecial "?"
+syn match esterelOperator "\["
+syn match esterelOperator "\]"
+syn match esterelOperator ":="
+syn match esterelOperator "||"
+syn match esterelStatement "\<\(if\|else\)\>"
+syn match esterelNone "\<else\s\+if\>$"
+syn match esterelNone "\<else\s\+if\>\s"
" Class Linking
if version >= 508 || !exists("did_esterel_syntax_inits")
diff --git a/runtime/syntax/fvwm.vim b/runtime/syntax/fvwm.vim
index 43b7abcf..29112fcc 100644
--- a/runtime/syntax/fvwm.vim
+++ b/runtime/syntax/fvwm.vim
@@ -1,8 +1,8 @@
-" Vim syntax file
+" Vim syntax file for Fvwm-2.5.22
" Language: Fvwm{1,2} configuration file
" Maintainer: Gautam Iyer <gi1242@users.sourceforge.net>
" Previous Maintainer: Haakon Riiser <hakonrk@fys.uio.no>
-" Last Change: Sat 04 Nov 2006 11:28:37 PM PST
+" Last Change: Sat 29 Sep 2007 11:08:34 AM PDT
"
" Thanks to David Necas (Yeti) for adding Fvwm 2.4 support.
"
@@ -43,7 +43,9 @@ syn match fvwmRGBValue "#\x\{9}"
syn match fvwmRGBValue "#\x\{12}"
syn match fvwmRGBValue "rgb:\x\{1,4}/\x\{1,4}/\x\{1,4}"
-syn region fvwmComment contains=@Spell start="^\s*#" skip='\\$' end='$'
+syn region fvwmComment contains=@Spell
+ \ start='^\s*#\s' skip='\\$' end='$'
+syn region fvwmComment start="\v^\s*#(\S|$)" skip='\\$' end='$'
if (exists("b:fvwm_version") && b:fvwm_version == 1)
\ || (exists("use_fvwm_1") && use_fvwm_1)
@@ -130,12 +132,16 @@ else
syn match fvwmShortcutKey contained "&."
syn keyword fvwmModuleName FvwmAnimate FvwmAudio FvwmAuto FvwmBacker
- \ FvwmBanner FvwmButtons FvwmCommandS
- \ FvwmConsole FvwmCpp FvwmDebug FvwmDragWell
- \ FvwmEvent FvwmForm FvwmGtk FvwmIconBox
+ \ FvwmBanner FvwmButtons FvwmCascade
+ \ FvwmCommandS FvwmConsole FvwmConsoleC
+ \ FvwmCpp FvwmDebug FvwmDragWell FvwmEvent
+ \ FvwmForm FvwmGtkDebug FvwmIconBox
\ FvwmIconMan FvwmIdent FvwmM4 FvwmPager
- \ FvwmSave FvwmSaveDesk FvwmScript FvwmScroll
- \ FvwmTaskBar FvwmWinList FvwmWharf
+ \ FvwmPerl FvwmProxy FvwmRearrange FvwmSave
+ \ FvwmSaveDesk FvwmScript FvwmScroll FvwmTabs
+ \ FvwmTalk FvwmTaskBar FvwmTheme FvwmTile
+ \ FvwmWharf FvwmWindowMenu FvwmWinList
+
" Obsolete fvwmModuleName: FvwmTheme
syn keyword fvwmKeyword AddToMenu ChangeMenuStyle CopyMenuStyle
@@ -162,21 +168,22 @@ else
\ WindowShadeAnimate IgnoreModifiers
\ EdgeCommand EdgeLeaveCommand GnomeButton
\ Stroke StrokeFunc FocusStyle DestroyStyle
- \ UpdateStyles AddToDecor BorderStyle
- \ ChangeDecor DestroyDecor UpdateDecor
- \ DesktopName DeskTopSize EdgeResistance
- \ EdgeScroll EdgeThickness EwmhBaseStruts
- \ EWMHNumberOfDesktops GotoDeskAndPage
- \ GotoPage Scroll Xinerama
+ \ DestroyWindowStyle UpdateStyles AddToDecor
+ \ BorderStyle ChangeDecor DestroyDecor
+ \ UpdateDecor DesktopName DeskTopSize
+ \ EdgeResistance EdgeScroll EdgeThickness
+ \ EwmhBaseStruts EWMHNumberOfDesktops
+ \ GotoDeskAndPage GotoPage Scroll Xinerama
\ XineramaPrimaryScreen XineramaSls
\ XineramaSlsSize XineramaSlsScreens AddToFunc
\ Beep DestroyFunc Echo Exec ExecUseShell
\ Function Nop PipeRead Read SetEnv Silent
\ UnsetEnv Wait DestroyModuleConfig KillModule
- \ Module ModuleSynchronous ModuleTimeout
- \ SendToModule Quit QuitScreen QuitSession
- \ Restart SaveSession SaveQuitSession KeepRc
- \ NoWindow Break CleanupColorsets
+ \ Module ModuleListenOnly ModuleSynchronous
+ \ ModuleTimeout SendToModule Quit QuitScreen
+ \ QuitSession Restart SaveSession
+ \ SaveQuitSession KeepRc NoWindow Break
+ \ CleanupColorsets EchoFuncDefinition
" Conditional commands
syn keyword fvwmKeyword nextgroup=fvwmCondition skipwhite
@@ -200,9 +207,12 @@ else
\ CurrentPageAnyDesk CurrentScreen FixedSize
\ Focused HasHandles HasPointer Iconic
\ Iconifiable Maximizable Maximized
- \ Overlapped PlacedByButton3 PlacedByFvwm Raised
- \ Shaded Sticky StickyAcrossDesks
- \ StickyAcrossPages Transient Visible
+ \ Overlapped PlacedByButton PlacedByButton3
+ \ PlacedByFvwm Raised Shaded Sticky
+ \ StickyAcrossDesks StickyAcrossPages
+ \ Transient Visible StickyIcon
+ \ StickyAcrossPagesIcon StickyAcrossDesksIcon
+
syn keyword fvwmCondNames contained skipwhite nextgroup=@fvwmConstants
\ State Layer
@@ -288,7 +298,7 @@ else
\ MinOverlapPlacement
\ MinOverlapPercentPlacement
\ TileManualPlacement TileCascadePlacement
- \ CenterPlacement MinOverlapPlacementPenalties
+ \ MinOverlapPlacementPenalties
\ MinOverlapPercentPlacementPenalties
\ DecorateTransient NakedTransient
\ DontRaiseTransient RaiseTransient
@@ -353,7 +363,8 @@ else
\ EWMHUseStackingOrderHints
\ EWMHIgnoreStackingOrderHints
\ EWMHIgnoreStateHints EWMHUseStateHints
- \ EWMHIgnoreStrutHints EWMHUseStrutHints
+ \ EWMHIgnoreStrutHints EWMHIgnoreWindowType
+ \ EWMHUseStrutHints
\ EWMHMaximizeIgnoreWorkingArea
\ EWMHMaximizeUseWorkingArea
\ EWMHMaximizeUseDynamicWorkingArea
@@ -361,6 +372,14 @@ else
\ EWMHPlacementUseWorkingArea
\ EWMHPlacementUseDynamicWorkingArea
\ MoveByProgramMethod Unmanaged State
+ \ StippledIconTitle StickyStippledTitle
+ \ StickyStippledIconTitle
+ \ PositionPlacement
+ \ UnderMousePlacementHonorsStartsOnPage
+ \ UnderMousePlacementIgnoresStartsOnPage
+ \ MinOverlapPlacementPenalties
+ \ MinOverlapPercentPlacementPenalties
+ \ MinWindowSize StartShaded
" Cursor styles
syn keyword fvwmKeyword nextgroup=fvwmCursorStyle skipwhite
@@ -400,6 +419,7 @@ else
\ SelectOnRelease ItemFormat
\ VerticalItemSpacing VerticalTitleSpacing
\ AutomaticHotkeys AutomaticHotkeysOff
+ \ TitleFont TitleColorset HilightTitleBack
" Button style
syn keyword fvwmKeyword nextgroup=fvwmBNum skipwhite
diff --git a/runtime/syntax/indent.vim b/runtime/syntax/indent.vim
index 4934d018..4070769f 100644
--- a/runtime/syntax/indent.vim
+++ b/runtime/syntax/indent.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: indent(1) configuration file
" Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2007-05-10
+" Latest Revision: 2007-06-17
" indent_is_bsd: If exists, will change somewhat to match BSD implementation
"
" TODO: is the deny-all (a la lilo.vim nice or no?)...
@@ -15,7 +15,7 @@ endif
let s:cpo_save = &cpo
set cpo&vim
-setlocal iskeyword=@,48-57,-,+,_
+setlocal iskeyword+=-,+
syn match indentError '\S\+'
diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
index 85ea0810..d5e32fae 100644
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -2,7 +2,7 @@
" Language: Java
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/java.vim
-" Last Change: 2006 Apr 30
+" Last Change: 2007 Dec 21
" Please check :help java.vim for comments on some of the options available.
@@ -121,6 +121,11 @@ syn match javaUserLabel "^\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\s*:"he=e-1 contai
syn keyword javaLabel default
if !exists("java_allow_cpp_keywords")
+ " The default used to be to highlight C++ keywords. But several people
+ " don't like that, so default to not highlighting these.
+ let java_allow_cpp_keywords = 1
+endif
+if !java_allow_cpp_keywords
syn keyword javaError auto delete extern friend inline redeclared
syn keyword javaError register signed sizeof struct template typedef union
syn keyword javaError unsigned operator
diff --git a/runtime/syntax/man.vim b/runtime/syntax/man.vim
index 347180c8..6167b237 100644
--- a/runtime/syntax/man.vim
+++ b/runtime/syntax/man.vim
@@ -3,7 +3,7 @@
" Maintainer: Nam SungHyun <namsh@kldp.org>
" Previous Maintainer: Gautam H. Mudunuri <gmudunur@informatica.com>
" Version Info:
-" Last Change: 2004 May 16
+" Last Change: 2007 Dec 30
" Additional highlighting by Johannes Tanzler <johannes.tanzler@aon.at>:
" * manSubHeading
@@ -36,7 +36,7 @@ syn match manLongOptionDesc "^\s*--[a-z0-9-]\S*"
if getline(1) =~ '^[a-zA-Z_]\+([23])'
syntax include @cCode <sfile>:p:h/c.vim
syn match manCFuncDefinition display "\<\h\w*\>\s*("me=e-1 contained
- syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"he=e-12 keepend contains=manSectionHeading,@cCode,manCFuncDefinition
+ syn region manSynopsis start="^SYNOPSIS"hs=s+8 end="^\u\+\s*$"me=e-12 keepend contains=manSectionHeading,@cCode,manCFuncDefinition
endif
diff --git a/runtime/syntax/mplayerconf.vim b/runtime/syntax/mplayerconf.vim
index 55f7e1a5..b348327f 100644
--- a/runtime/syntax/mplayerconf.vim
+++ b/runtime/syntax/mplayerconf.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: mplayer(1) configuration file
" Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2006-04-19
+" Latest Revision: 2007-06-17
if exists("b:current_syntax")
finish
@@ -10,7 +10,7 @@ endif
let s:cpo_save = &cpo
set cpo&vim
-setlocal iskeyword=@,48-57,-
+setlocal iskeyword+=-
syn keyword mplayerconfTodo contained TODO FIXME XXX NOTE
diff --git a/runtime/syntax/muttrc.vim b/runtime/syntax/muttrc.vim
index fb88f6af..0b1d1616 100644
--- a/runtime/syntax/muttrc.vim
+++ b/runtime/syntax/muttrc.vim
@@ -2,9 +2,9 @@
" Language: Mutt setup files
" Original: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
" Maintainer: Kyle Wheeler <kyle-muttrc.vim@memoryhole.net>
-" Last Change: 5 Mar 2007
+" Last Change: 15 Aug 2007
-" This file covers mutt version 1.5.14 (and most of CVS HEAD)
+" This file covers mutt version 1.5.16 (and most of CVS HEAD)
" Included are also a few features from 1.4.2.1
" For version 5.x: Clear all syntax items
@@ -30,18 +30,19 @@ syn match muttrcComment "[^\\]#.*$"lc=1
" Escape sequences (back-tick and pipe goes here too)
syn match muttrcEscape +\\[#tnr"'Cc ]+
syn match muttrcEscape +[`|]+
+syn match muttrcEscape +\\$+
" The variables takes the following arguments
syn match muttrcString "=\s*[^ #"'`]\+"lc=1 contains=muttrcEscape
-syn region muttrcString start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction
+syn region muttrcString start=+"+ms=e skip=+\\"+ end=+"+ contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction,muttrcShellString
syn region muttrcString start=+'+ms=e skip=+\\'+ end=+'+ contains=muttrcEscape,muttrcSet,muttrcUnset,muttrcReset,muttrcToggle,muttrcCommand,muttrcAction
syn region muttrcShellString matchgroup=muttrcEscape keepend start=+`+ skip=+\\`+ end=+`+ contains=muttrcVarStr,muttrcVarBool,muttrcVarQuad,muttrcVarNum,muttrcCommand,muttrcSet
syn match muttrcRXChars contained /[^\\][][.*?+]\+/hs=s+1
syn match muttrcRXChars contained /[][|()][.*?+]*/
-syn match muttrcRXChars contained /'^/ms=s+1
-syn match muttrcRXChars contained /$'/me=e-1
+syn match muttrcRXChars contained /['"]^/ms=s+1
+syn match muttrcRXChars contained /$['"]/me=e-1
syn match muttrcRXChars contained /\\/
" Why does muttrcRXString2 work with one \ when muttrcRXString requires two?
syn region muttrcRXString contained start=+'+ skip=+\\'+ end=+'+ contains=muttrcRXChars
@@ -78,21 +79,21 @@ syn match muttrcKeyName contained "\c<\%(BackSpace\|Delete\|Down\|End\|Enter\|
syn keyword muttrcVarBool contained allow_8bit allow_ansi arrow_cursor ascii_chars askbcc
syn keyword muttrcVarBool contained askcc attach_split auto_tag autoedit beep beep_new
-syn keyword muttrcVarBool contained bounce_delivered braille_friendly check_new collapse_unread
+syn keyword muttrcVarBool contained bounce_delivered braille_friendly check_new check_mbox_size collapse_unread
syn keyword muttrcVarBool contained confirmappend confirmcreate crypt_autoencrypt crypt_autopgp
syn keyword muttrcVarBool contained crypt_autosign crypt_autosmime crypt_replyencrypt
syn keyword muttrcVarBool contained crypt_replysign crypt_replysignencrypted crypt_timestamp
-syn keyword muttrcVarBool contained crypt_use_gpgme delete_untag digest_collapse duplicate_threads
+syn keyword muttrcVarBool contained crypt_use_gpgme crypt_use_pka delete_untag digest_collapse duplicate_threads
syn keyword muttrcVarBool contained edit_hdrs edit_headers encode_from envelope_from fast_reply
syn keyword muttrcVarBool contained fcc_attach fcc_clear followup_to force_name forw_decode
syn keyword muttrcVarBool contained forw_decrypt forw_quote forward_decode forward_decrypt
syn keyword muttrcVarBool contained forward_quote hdrs header help hidden_host hide_limited
syn keyword muttrcVarBool contained hide_missing hide_thread_subject hide_top_limited
-syn keyword muttrcVarBool contained hide_top_missing ignore_list_reply_to imap_check_subscribed
+syn keyword muttrcVarBool contained hide_top_missing ignore_linear_white_space ignore_list_reply_to imap_check_subscribed
syn keyword muttrcVarBool contained imap_list_subscribed imap_passive imap_peek imap_servernoise
syn keyword muttrcVarBool contained implicit_autoview include_onlyfirst keep_flagged
syn keyword muttrcVarBool contained mailcap_sanitize maildir_header_cache_verify maildir_trash
-syn keyword muttrcVarBool contained mark_old markers menu_move_off menu_scroll meta_key
+syn keyword muttrcVarBool contained mark_old markers menu_move_off menu_scroll message_cache_clean meta_key
syn keyword muttrcVarBool contained metoo mh_purge mime_forward_decode narrow_tree pager_stop
syn keyword muttrcVarBool contained pgp_auto_decode pgp_auto_traditional pgp_autoencrypt
syn keyword muttrcVarBool contained pgp_autoinline pgp_autosign pgp_check_exit
@@ -206,37 +207,133 @@ syn keyword muttrcVarNum contained connect_timeout history imap_keepalive mail_c
syn keyword muttrcVarNum contained pager_context pager_index_lines pgp_timeout pop_checkinterval read_inc
syn keyword muttrcVarNum contained save_history score_threshold_delete score_threshold_flag
syn keyword muttrcVarNum contained score_threshold_read sendmail_wait sleep_time smime_timeout
-syn keyword muttrcVarNum contained ssl_min_dh_prime_bits timeout wrap wrapmargin write_inc
+syn keyword muttrcVarNum contained ssl_min_dh_prime_bits timeout time_inc wrap wrapmargin write_inc
+
+syn match muttrcStrftimeEscapes contained /%[AaBbCcDdeFGgHhIjklMmnpRrSsTtUuVvWwXxYyZz+%]/
+syn match muttrcStrftimeEscapes contained /%E[cCxXyY]/
+syn match muttrcStrftimeEscapes contained /%O[BdeHImMSuUVwWy]/
+
+syn match muttrcFormatErrors contained /%./
+
+syn region muttrcIndexFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes
+syn region muttrcIndexFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcIndexFormatEscapes,muttrcIndexFormatConditionals,muttrcFormatErrors,muttrcTimeEscapes
+syn region muttrcAliasFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors
+syn region muttrcAliasFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAliasFormatEscapes,muttrcFormatErrors
+syn region muttrcAttachFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors
+syn region muttrcAttachFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcAttachFormatEscapes,muttrcAttachFormatConditionals,muttrcFormatErrors
+syn region muttrcComposeFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcComposeFormatEscapes,muttrcFormatErrors
+syn region muttrcComposeFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcComposeFormatEscapes,muttrcFormatErrors
+syn region muttrcFolderFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors
+syn region muttrcFolderFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcFolderFormatEscapes,muttrcFolderFormatConditionals,muttrcFormatErrors
+syn region muttrcMixFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors
+syn region muttrcMixFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcMixFormatEscapes,muttrcMixFormatConditionals,muttrcFormatErrors
+syn region muttrcPGPFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes
+syn region muttrcPGPFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPFormatEscapes,muttrcPGPFormatConditionals,muttrcFormatErrors,muttrcPGPTimeEscapes
+syn region muttrcPGPCmdFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors
+syn region muttrcPGPCmdFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPCmdFormatEscapes,muttrcPGPCmdFormatConditionals,muttrcVariable,muttrcFormatErrors
+syn region muttrcStatusFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors
+syn region muttrcStatusFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcStatusFormatEscapes,muttrcStatusFormatConditionals,muttrcFormatErrors
+syn region muttrcPGPGetKeysFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPGPGetKeysFormatEscapes,muttrcFormatErrors
+syn region muttrcPGPGetKeysFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPGPGetKeysFormatEscapes,muttrcFormatErrors
+syn region muttrcSmimeFormatStr contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors
+syn region muttrcSmimeFormatStr contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcSmimeFormatEscapes,muttrcSmimeFormatConditionals,muttrcVariable,muttrcFormatErrors
+
+" The following info was pulled from hdr_format_str in hdrline.c
+syn match muttrcIndexFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[aAbBcCdDeEfFHilLmMnNOPsStTuvXyYZ%]/
+syn match muttrcIndexFormatConditionals contained /%?[EFHlLMNOXyY]?/ nextgroup=muttrcFormatConditionals2
+" The following info was pulled from alias_format_str in addrbook.c
+syn match muttrcAliasFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[afnrt%]/
+" The following info was pulled from mutt_attach_fmt in recvattach.c
+syn match muttrcAttachFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[CcDdefImMnQstTuX%]/
+syn match muttrcAttachFormatEscapes contained /%[>|*]./
+syn match muttrcAttachFormatConditionals contained /%?[CcdDefInmMQstTuX]?/ nextgroup=muttrcFormatConditionals2
+syn match muttrcFormatConditionals2 contained /[^?]*?/
+" The following info was pulled from compose_format_str in compose.c
+syn match muttrcComposeFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[ahlv%]/
+syn match muttrcComposeFormatEscapes contained /%[>|*]./
+" The following info was pulled from folder_format_str in browser.c
+syn match muttrcFolderFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[CdfFglNstu%]/
+syn match muttrcFolderFormatEscapes contained /%[>|*]./
+syn match muttrcFolderFormatConditionals contained /%?[N]?/
+" The following info was pulled from mix_entry_fmt in remailer.c
+syn match muttrcMixFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[ncsa%]/
+syn match muttrcMixFormatConditionals contained /%?[ncsa]?/
+" The following info was pulled from crypt_entry_fmt in crypt-gpgme.c
+" and pgp_entry_fmt in pgpkey.c (note that crypt_entry_fmt supports
+" 'p', but pgp_entry_fmt does not).
+syn match muttrcPGPFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[nkualfctp%]/
+syn match muttrcPGPFormatConditionals contained /%?[nkualfct]?/
+" The following info was pulled from _mutt_fmt_pgp_command in
+" pgpinvoke.c
+syn match muttrcPGPCmdFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[pfsar%]/
+syn match muttrcPGPCmdFormatConditionals contained /%?[pfsar]?/ nextgroup=muttrcFormatConditionals2
+" The following info was pulled from status_format_str in status.c
+syn match muttrcStatusFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[bdfFhlLmMnopPrsStuvV%]/
+syn match muttrcStatusFormatEscapes contained /%[>|*]./
+syn match muttrcStatusFormatConditionals contained /%?[bdFlLmMnoptuV]?/ nextgroup=muttrcFormatConditionals2
+" This matches the documentation, but directly contradicts the code
+" (according to the code, this should be identical to the
+" muttrcPGPCmdFormatEscapes
+syn match muttrcPGPGetKeysFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[r%]/
+" The following info was pulled from _mutt_fmt_smime_command in
+" smime.c
+syn match muttrcSmimeFormatEscapes contained /%\%(\%(-\?[0-9]\+\)\?\%(\.[0-9]\+\)\?\)\?[:_]\?[Cciskaf%]/
+syn match muttrcSmimeFormatConditionals contained /%?[Cciskaf]?/ nextgroup=muttrcFormatConditionals2
+
+syn region muttrcTimeEscapes contained start=+%{+ end=+}+ contains=muttrcStrftimeEscapes
+syn region muttrcTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes
+syn region muttrcTimeEscapes contained start=+%(+ end=+)+ contains=muttrcStrftimeEscapes
+syn region muttrcTimeEscapes contained start=+%<+ end=+>+ contains=muttrcStrftimeEscapes
+syn region muttrcPGPTimeEscapes contained start=+%\[+ end=+\]+ contains=muttrcStrftimeEscapes
+
+syn keyword muttrcVarStr contained attribution index_format message_format pager_format nextgroup=muttrcVarEqualsIdxFmt
+syn match muttrcVarEqualsIdxFmt contained "=" nextgroup=muttrcIndexFormatStr
+syn keyword muttrcVarStr contained alias_format nextgroup=muttrcVarEqualsAliasFmt
+syn match muttrcVarEqualsAliasFmt contained "=" nextgroup=muttrcAliasFormatStr
+syn keyword muttrcVarStr contained attach_format nextgroup=muttrcVarEqualsAttachFmt
+syn match muttrcVarEqualsAttachFmt contained "=" nextgroup=muttrcAttachFormatStr
+syn keyword muttrcVarStr contained compose_format nextgroup=muttrcVarEqualsComposeFmt
+syn match muttrcVarEqualsComposeFmt contained "=" nextgroup=muttrcComposeFormatStr
+syn keyword muttrcVarStr contained folder_format nextgroup=muttrcVarEqualsFolderFmt
+syn match muttrcVarEqualsFolderFmt contained "=" nextgroup=muttrcFolderFormatStr
+syn keyword muttrcVarStr contained mix_entry_format nextgroup=muttrcVarEqualsMixFmt
+syn match muttrcVarEqualsMixFmt contained "=" nextgroup=muttrcMixFormatStr
+syn keyword muttrcVarStr contained pgp_entry_format nextgroup=muttrcVarEqualsPGPFmt
+syn match muttrcVarEqualsPGPFmt contained "=" nextgroup=muttrcPGPFormatStr
+syn keyword muttrcVarStr contained pgp_decode_command pgp_verify_command pgp_decrypt_command pgp_clearsign_command pgp_sign_command pgp_encrypt_sign_command pgp_encrypt_only_command pgp_import_command pgp_export_command pgp_verify_key_command pgp_list_secring_command pgp_list_pubring_command nextgroup=muttrcVarEqualsPGPCmdFmt
+syn match muttrcVarEqualsPGPCmdFmt contained "=" nextgroup=muttrcPGPCmdFormatStr
+syn keyword muttrcVarStr contained status_format nextgroup=muttrcVarEqualsStatusFmt
+syn match muttrcVarEqualsStatusFmt contained "=" nextgroup=muttrcStatusFormatStr
+syn keyword muttrcVarStr contained pgp_getkeys_command nextgroup=muttrcVarEqualsPGPGetKeysFmt
+syn match muttrcVarEqualsPGPGetKeysFmt contained "=" nextgroup=muttrcPGPGetKeysFormatStr
+syn keyword muttrcVarStr contained smime_decrypt_command smime_verify_command smime_verify_opaque_command smime_sign_command smime_sign_opaque_command smime_encrypt_command smime_pk7out_command smime_get_cert_command smime_get_signer_cert_command smime_import_cert_command smime_get_cert_email_command nextgroup=muttrcVarEqualsSmimeFmt
+syn match muttrcVarEqualsSmimeFmt contained "=" nextgroup=muttrcSmimeFormatStr
syn match muttrcVarStr contained 'my_[a-zA-Z0-9_]\+'
-syn keyword muttrcVarStr contained alias_file alias_format assumed_charset attach_format attach_sep attribution
-syn keyword muttrcVarStr contained certificate_file charset compose_format config_charset content_type
+syn keyword muttrcVarStr contained alias_file assumed_charset attach_charset attach_sep
+syn keyword muttrcVarStr contained certificate_file charset config_charset content_type
syn keyword muttrcVarStr contained date_format default_hook display_filter dotlock_program dsn_notify
syn keyword muttrcVarStr contained dsn_return editor entropy_file envelope_from_address escape folder
-syn keyword muttrcVarStr contained folder_format forw_format forward_format from gecos_mask hdr_format
+syn keyword muttrcVarStr contained forw_format forward_format from gecos_mask hdr_format
syn keyword muttrcVarStr contained header_cache header_cache_pagesize history_file hostname imap_authenticators
-syn keyword muttrcVarStr contained imap_delim_chars imap_headers imap_home_namespace imap_idle imap_login imap_pass
-syn keyword muttrcVarStr contained imap_user indent_str indent_string index_format ispell locale mailcap_path
-syn keyword muttrcVarStr contained mask mbox mbox_type message_format message_cachedir mh_seq_flagged mh_seq_replied
-syn keyword muttrcVarStr contained mh_seq_unseen mix_entry_format mixmaster msg_format pager pager_format
-syn keyword muttrcVarStr contained pgp_clearsign_command pgp_decode_command pgp_decrypt_command
-syn keyword muttrcVarStr contained pgp_encrypt_only_command pgp_encrypt_sign_command pgp_entry_format
-syn keyword muttrcVarStr contained pgp_export_command pgp_getkeys_command pgp_good_sign pgp_import_command
-syn keyword muttrcVarStr contained pgp_list_pubring_command pgp_list_secring_command pgp_mime_signature_filename
+syn keyword muttrcVarStr contained imap_delim_chars imap_headers imap_idle imap_login imap_pass
+syn keyword muttrcVarStr contained imap_user indent_str indent_string ispell locale mailcap_path
+syn keyword muttrcVarStr contained mask mbox mbox_type message_cachedir mh_seq_flagged mh_seq_replied
+syn keyword muttrcVarStr contained mh_seq_unseen mixmaster msg_format pager
+syn keyword muttrcVarStr contained pgp_good_sign
+syn keyword muttrcVarStr contained pgp_mime_signature_filename
syn keyword muttrcVarStr contained pgp_mime_signature_description pgp_sign_as
-syn keyword muttrcVarStr contained pgp_sign_command pgp_sort_keys pgp_verify_command pgp_verify_key_command
+syn keyword muttrcVarStr contained pgp_sort_keys
syn keyword muttrcVarStr contained pipe_sep pop_authenticators pop_host pop_pass pop_user post_indent_str
syn keyword muttrcVarStr contained post_indent_string postponed preconnect print_cmd print_command
syn keyword muttrcVarStr contained query_command quote_regexp realname record reply_regexp send_charset
syn keyword muttrcVarStr contained sendmail shell signature simple_search smileys smime_ca_location
-syn keyword muttrcVarStr contained smime_certificates smime_decrypt_command smime_default_key
-syn keyword muttrcVarStr contained smime_encrypt_command smime_encrypt_with smime_get_cert_command
-syn keyword muttrcVarStr contained smime_get_cert_email_command smime_get_signer_cert_command
-syn keyword muttrcVarStr contained smime_import_cert_command smime_keys smime_pk7out_command smime_sign_as
-syn keyword muttrcVarStr contained smime_sign_command smime_sign_opaque_command smime_verify_command
-syn keyword muttrcVarStr contained smime_verify_opaque_command smtp_url smtp_authenticators sort sort_alias sort_aux
+syn keyword muttrcVarStr contained smime_certificates smime_default_key
+syn keyword muttrcVarStr contained smime_encrypt_with
+syn keyword muttrcVarStr contained smime_keys smime_sign_as
+syn keyword muttrcVarStr contained smtp_url smtp_authenticators smtp_pass sort sort_alias sort_aux
syn keyword muttrcVarStr contained sort_browser spam_separator spoolfile ssl_ca_certificates_file ssl_client_cert
-syn keyword muttrcVarStr contained status_chars status_format tmpdir to_chars tunnel visual
+syn keyword muttrcVarStr contained status_chars tmpdir to_chars tunnel visual
" Present in 1.4.2.1 (pgp_create_traditional was a bool then)
syn keyword muttrcVarBool contained imap_force_ssl imap_force_ssl noinvimap_force_ssl
@@ -372,12 +469,13 @@ syn match muttrcUnAlias /^\s*unalias\s\?/ nextgroup=muttrcUnAliasKey,muttrcUnAl
syn match muttrcSimplePat contained "!\?\^\?[~][ADEFgGklNOpPQRSTuUvV=$]"
syn match muttrcSimplePat contained "!\?\^\?[~][mnXz]\s\+\%([<>-][0-9]\+\|[0-9]\+[-][0-9]*\)"
-syn match muttrcSimplePat contained "!\?\^\?[~][dr]\s\+\%(\%(-\?[0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)\|\%(\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)-\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)\?\)\?\)\|\%([<>=][0-9]\+[ymwd]\)\)"
+syn match muttrcSimplePat contained "!\?\^\?[~][dr]\s\+\%(\%(-\?[0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)\|\%(\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)*\)-\%([0-9]\{1,2}\%(/[0-9]\{1,2}\%(/[0-9]\{2}\%([0-9]\{2}\)\?\)\?\)\?\%([+*-][0-9]\+[ymwd]\)\?\)\?\)\|\%([<>=][0-9]\+[ymwd]\)\|\%(`[^`]\+`\)\|\%(\$[a-zA-Z0-9_-]\+\)\)" contains=muttrcShellString,muttrcVariable
syn match muttrcSimplePat contained "!\?\^\?[~][bBcCefhHiLstxy]\s\+" nextgroup=muttrcSimplePatRXContainer
syn match muttrcSimplePat contained "!\?\^\?[%][bBcCefhHiLstxy]\s\+" nextgroup=muttrcSimplePatString
syn match muttrcSimplePat contained "!\?\^\?[=][bh]\s\+" nextgroup=muttrcSimplePatString
-"syn match muttrcSimplePat contained /"[^~=%][^"]*/ contains=muttrcRXPat
-"syn match muttrcSimplePat contained /'[^~=%][^']*/ contains=muttrcRXPat
+syn region muttrcSimplePat contained keepend start=+!\?\^\?[~](+ end=+)+ contains=muttrcSimplePat
+"syn match muttrcSimplePat contained /'[^~=%][^']*/
+"contains=muttrcRXPat
syn match muttrcSimplePatString contained /[a-zA-Z0-9]\+/
syn region muttrcSimplePatString contained keepend start=+"+ end=+"+ skip=+\\"+
syn region muttrcSimplePatString contained keepend start=+'+ end=+'+ skip=+\\'+
@@ -388,7 +486,7 @@ syn match muttrcSimplePatMetas contained /[(|)]/
syn region muttrcPattern contained keepend start=+"+ skip=+\\"+ end=+"+ contains=muttrcPatternInner
syn region muttrcPattern contained keepend start=+'+ skip=+\\'+ end=+'+ contains=muttrcPatternInner
-syn match muttrcPattern contained "[~][A-Za-z]" contains=muttrcSimplePat
+syn match muttrcPattern contained "[~]\([A-Za-z]\|([^)]\+)\)" contains=muttrcSimplePat
syn region muttrcPatternInner contained keepend start=+"[~=%!(^]+ms=s+1 skip=+\\"+ end=+"+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
syn region muttrcPatternInner contained keepend start=+'[~=%!(^]+ms=s+1 skip=+\\'+ end=+'+me=e-1 contains=muttrcSimplePat,muttrcUnHighlightSpace,muttrcSimplePatMetas
@@ -535,6 +633,41 @@ if version >= 508 || !exists("did_muttrc_syntax_inits")
HiLink muttrcRXHookNot Type
HiLink muttrcPatHooks muttrcCommand
HiLink muttrcPatHookNot Type
+ HiLink muttrcFormatConditionals2 Type
+ HiLink muttrcIndexFormatStr muttrcString
+ HiLink muttrcIndexFormatEscapes muttrcEscape
+ HiLink muttrcIndexFormatConditionals muttrcFormatConditionals2
+ HiLink muttrcAliasFormatStr muttrcString
+ HiLink muttrcAliasFormatEscapes muttrcEscape
+ HiLink muttrcAttachFormatStr muttrcString
+ HiLink muttrcAttachFormatEscapes muttrcEscape
+ HiLink muttrcAttachFormatConditionals muttrcFormatConditionals2
+ HiLink muttrcComposeFormatStr muttrcString
+ HiLink muttrcComposeFormatEscapes muttrcEscape
+ HiLink muttrcFolderFormatStr muttrcString
+ HiLink muttrcFolderFormatEscapes muttrcEscape
+ HiLink muttrcFolderFormatConditionals muttrcFormatConditionals2
+ HiLink muttrcMixFormatStr muttrcString
+ HiLink muttrcMixFormatEscapes muttrcEscape
+ HiLink muttrcMixFormatConditionals muttrcFormatConditionals2
+ HiLink muttrcPGPFormatStr muttrcString
+ HiLink muttrcPGPFormatEscapes muttrcEscape
+ HiLink muttrcPGPFormatConditionals muttrcFormatConditionals2
+ HiLink muttrcPGPCmdFormatStr muttrcString
+ HiLink muttrcPGPCmdFormatEscapes muttrcEscape
+ HiLink muttrcPGPCmdFormatConditionals muttrcFormatConditionals2
+ HiLink muttrcStatusFormatStr muttrcString
+ HiLink muttrcStatusFormatEscapes muttrcEscape
+ HiLink muttrcStatusFormatConditionals muttrcFormatConditionals2
+ HiLink muttrcPGPGetKeysFormatStr muttrcString
+ HiLink muttrcPGPGetKeysFormatEscapes muttrcEscape
+ HiLink muttrcSmimeFormatStr muttrcString
+ HiLink muttrcSmimeFormatEscapes muttrcEscape
+ HiLink muttrcSmimeFormatConditionals muttrcFormatConditionals2
+ HiLink muttrcTimeEscapes muttrcEscape
+ HiLink muttrcPGPTimeEscapes muttrcEscape
+ HiLink muttrcStrftimeEscapes Type
+ HiLink muttrcFormatErrors Error
HiLink muttrcBindFunctionNL SpecialChar
HiLink muttrcBindKeyNL SpecialChar
@@ -564,4 +697,4 @@ endif
let b:current_syntax = "muttrc"
-"EOF vim: ts=8 noet tw=100 sw=8 sts=0
+"EOF vim: ts=8 noet tw=100 sw=8 sts=0 ft=vim
diff --git a/runtime/syntax/po.vim b/runtime/syntax/po.vim
index 3bb39b17..124d5245 100644
--- a/runtime/syntax/po.vim
+++ b/runtime/syntax/po.vim
@@ -1,7 +1,10 @@
" Vim syntax file
" Language: po (gettext)
" Maintainer: Dwayne Bailey <dwayne@translate.org.za>
-" Last Change: 2004 Nov 13
+" Last Change: 2008 Jan 08
+" Contributors: Dwayne Bailey (Most advanced syntax highlighting)
+" Leonardo Fontenelle (Spell checking)
+" Nam SungHyun <namsh@kldp.org> (Original maintainer)
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -14,26 +17,30 @@ endif
syn sync minlines=10
" Identifiers
+syn match poStatementMsgCTxt "^msgctxt"
syn match poStatementMsgidplural "^msgid_plural" contained
syn match poPluralCaseN "[0-9]" contained
syn match poStatementMsgstr "^msgstr\(\[[0-9]\]\)" contains=poPluralCaseN
" Simple HTML and XML highlighting
-syn match poHtml "<[^<>]\+>" contains=poHtmlTranslatables
+syn match poHtml "<\_[^<>]\+>" contains=poHtmlTranslatables,poLineBreak
syn match poHtmlNot +"<[^<]\+>"+ms=s+1,me=e-1
-syn region poHtmlTranslatables start=+alt=\\"+ms=e-1 end=+\\"+ contained
+syn region poHtmlTranslatables start=+\(abbr\|alt\|content\|summary\|standby\|title\)=\\"+ms=e-1 end=+\\"+ contained contains=@Spell
+syn match poLineBreak +"\n"+ contained
" Translation blocks
+syn region poMsgCTxt matchgroup=poStatementMsgCTxt start=+^msgctxt "+rs=e-1 matchgroup=poStringCTxt end=+^msgid "+me=s-1 contains=poStringCTxt
syn region poMsgID matchgroup=poStatementMsgid start=+^msgid "+rs=e-1 matchgroup=poStringID end=+^msgstr\(\|\[[\]0\[]\]\) "+me=s-1 contains=poStringID,poStatementMsgidplural,poStatementMsgid
syn region poMsgSTR matchgroup=poStatementMsgstr start=+^msgstr\(\|\[[\]0\[]\]\) "+rs=e-1 matchgroup=poStringSTR end=+\n\n+me=s-1 contains=poStringSTR,poStatementMsgstr
+syn region poStringCTxt start=+"+ skip=+\\\\\|\\"+ end=+"+
syn region poStringID start=+"+ skip=+\\\\\|\\"+ end=+"+ contained
- \ contains=poSpecial,poFormat,poCommentKDE,poPluralKDE,poKDEdesktopFile,poHtml,poAccelerator,poHtmlNot,poVariable
+ \ contains=poSpecial,poFormat,poCommentKDE,poPluralKDE,poKDEdesktopFile,poHtml,poAcceleratorId,poHtmlNot,poVariable
syn region poStringSTR start=+"+ skip=+\\\\\|\\"+ end=+"+ contained
- \ contains=poSpecial,poFormat,poHeaderItem,poCommentKDEError,poHeaderUndefined,poPluralKDEError,poMsguniqError,poKDEdesktopFile,poHtml,poAccelerator,poHtmlNot,poVariable
+ \ contains=@Spell,poSpecial,poFormat,poHeaderItem,poCommentKDEError,poHeaderUndefined,poPluralKDEError,poMsguniqError,poKDEdesktopFile,poHtml,poAcceleratorStr,poHtmlNot,poVariable
" Header and Copyright
syn match poHeaderItem "\(Project-Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|MIME-Version\|Content-Type\|Content-Transfer-Encoding\|Plural-Forms\|X-Generator\): " contained
-syn match poHeaderUndefined "\(PACKAGE VERSION\|YEAR-MO-DA HO:MI+ZONE\|FULL NAME <EMAIL@ADDRESS>\|LANGUAGE <LL@li.org>\|text/plain; charset=CHARSET\|ENCODING\)" contained
+syn match poHeaderUndefined "\(PACKAGE VERSION\|YEAR-MO-DA HO:MI+ZONE\|FULL NAME <EMAIL@ADDRESS>\|LANGUAGE <LL@li.org>\|CHARSET\|ENCODING\|INTEGER\|EXPRESSION\)" contained
syn match poCopyrightUnset "SOME DESCRIPTIVE TITLE\|FIRST AUTHOR <EMAIL@ADDRESS>, YEAR\|Copyright (C) YEAR Free Software Foundation, Inc\|YEAR THE PACKAGE\'S COPYRIGHT HOLDER\|PACKAGE" contained
" Translation comment block including: translator comment, automatic coments, flags and locations
@@ -63,7 +70,8 @@ syn match poObsolete "^#\~.*$"
syn match poKDEdesktopFile "\"\(Name\|Comment\|GenericName\|Description\|Keywords\|About\)="ms=s+1,me=e-1
" Accelerator keys - this messes up if the preceding or following char is a multibyte unicode char
-syn match poAccelerator contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1
+syn match poAcceleratorId contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1
+syn match poAcceleratorStr contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 contains=@Spell
" Variables simple
syn match poVariable contained "%\d"
@@ -91,8 +99,10 @@ if version >= 508 || !exists("did_po_syn_inits")
HiLink poStatementMsgid Statement
HiLink poStatementMsgstr Statement
HiLink poStatementMsgidplural Statement
+ HiLink poStatementMsgCTxt Statement
HiLink poPluralCaseN Constant
+ HiLink poStringCTxt Comment
HiLink poStringID String
HiLink poStringSTR String
HiLink poCommentKDE Comment
@@ -106,11 +116,13 @@ if version >= 508 || !exists("did_po_syn_inits")
HiLink poHtml Identifier
HiLink poHtmlNot String
HiLink poHtmlTranslatables String
+ HiLink poLineBreak String
HiLink poFormat poSpecial
HiLink poSpecial Special
- HiLink poAccelerator Special
- HiLink poVariable Special
+ HiLink poAcceleratorId Special
+ HiLink poAcceleratorStr Special
+ HiLink poVariable Special
HiLink poMsguniqError Special
HiLink poMsguniqErrorMarkers Comment
diff --git a/runtime/syntax/readline.vim b/runtime/syntax/readline.vim
index 81175fee..1972e5af 100644
--- a/runtime/syntax/readline.vim
+++ b/runtime/syntax/readline.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: readline(3) configuration file
" Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2006-04-19
+" Latest Revision: 2007-06-17
" readline_has_bash - if defined add support for bash specific
" settings/functions
@@ -12,7 +12,7 @@ endif
let s:cpo_save = &cpo
set cpo&vim
-setlocal iskeyword=@,48-57,-
+setlocal iskeyword+=-
syn keyword readlineTodo contained TODO FIXME XXX NOTE
diff --git a/runtime/syntax/rhelp.vim b/runtime/syntax/rhelp.vim
index c0f0ff27..f1b8d88e 100644
--- a/runtime/syntax/rhelp.vim
+++ b/runtime/syntax/rhelp.vim
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: R Help File
" Maintainer: Johannes Ranke <jranke@uni-bremen.de>
-" Last Change: 2006 Apr 24
-" Version: 0.7
+" Last Change: 2008 Apr 10
+" Version: 0.7.1
" SVN: $Id$
" Remarks: - Now includes R syntax highlighting in the appropriate
" sections if an r.vim file is in the same directory or in the
@@ -107,6 +107,7 @@ syn match rhelpSection "\\tabular{[lcr]*}"
syn match rhelpSection "\\dontrun\>"
syn match rhelpSection "\\dontshow\>"
syn match rhelpSection "\\testonly\>"
+syn match rhelpSection "\\donttest\>"
" Freely named Sections {{{1
syn region rhelpFreesec matchgroup=Delimiter start="\\section{" matchgroup=Delimiter transparent end=/}/
diff --git a/runtime/syntax/sqlanywhere.vim b/runtime/syntax/sqlanywhere.vim
index b69da0bd..81fa060f 100644
--- a/runtime/syntax/sqlanywhere.vim
+++ b/runtime/syntax/sqlanywhere.vim
@@ -1,12 +1,14 @@
+
" Vim syntax file
" Language: SQL, Adaptive Server Anywhere
" Maintainer: David Fishburn <fishburn at ianywhere dot com>
-" Last Change: Thu Sep 15 2005 10:30:09 AM
-" Version: 9.0.2
+" Last Change: Tue 29 Jan 2008 12:54:19 PM Eastern Standard Time
+" Version: 10.0.1
-" Description: Updated to Adaptive Server Anywhere 9.0.2
-" Updated to Adaptive Server Anywhere 9.0.1
-" Updated to Adaptive Server Anywhere 9.0.0
+" Description: Updated to Adaptive Server Anywhere 10.0.1
+" Updated to Adaptive Server Anywhere 9.0.2
+" Updated to Adaptive Server Anywhere 9.0.1
+" Updated to Adaptive Server Anywhere 9.0.0
"
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -23,459 +25,460 @@ syn case ignore
syn keyword sqlSpecial false null true
" common functions
-syn keyword sqlFunction count sum avg min max debug_eng isnull
-syn keyword sqlFunction greater lesser argn string ymd todate
-syn keyword sqlFunction totimestamp date today now utc_now
-syn keyword sqlFunction number identity years months weeks days
-syn keyword sqlFunction hours minutes seconds second minute hour
-syn keyword sqlFunction day month year dow date_format substr
-syn keyword sqlFunction substring byte_substr length byte_length
-syn keyword sqlFunction datalength ifnull evaluate list
-syn keyword sqlFunction soundex similar difference like_start
-syn keyword sqlFunction like_end regexp_compile
-syn keyword sqlFunction regexp_compile_patindex remainder abs
-syn keyword sqlFunction graphical_plan plan explanation ulplan
-syn keyword sqlFunction graphical_ulplan long_ulplan
-syn keyword sqlFunction short_ulplan rewrite watcomsql
-syn keyword sqlFunction transactsql dialect estimate
-syn keyword sqlFunction estimate_source index_estimate
-syn keyword sqlFunction experience_estimate traceback wsql_state
-syn keyword sqlFunction lang_message dateadd datediff datepart
-syn keyword sqlFunction datename dayname monthname quarter
-syn keyword sqlFunction tsequal hextoint inttohex rand textptr
-syn keyword sqlFunction rowid grouping stddev variance rank
-syn keyword sqlFunction dense_rank density percent_rank user_name
-syn keyword sqlFunction user_id str stuff char_length nullif
-syn keyword sqlFunction sortkey compare ts_index_statistics
-syn keyword sqlFunction ts_table_statistics isdate isnumeric
-syn keyword sqlFunction get_identity lookup newid uuidtostr
-syn keyword sqlFunction strtouuid varexists
+syn keyword sqlFunction count sum avg min max debug_eng isnull
+syn keyword sqlFunction greater lesser argn string ymd todate
+syn keyword sqlFunction totimestamp date today now utc_now
+syn keyword sqlFunction number identity years months weeks days
+syn keyword sqlFunction hours minutes seconds second minute hour
+syn keyword sqlFunction day month year dow date_format substr
+syn keyword sqlFunction substring byte_substr length byte_length
+syn keyword sqlFunction datalength ifnull evaluate list
+syn keyword sqlFunction soundex similar difference like_start
+syn keyword sqlFunction like_end regexp_compile
+syn keyword sqlFunction regexp_compile_patindex remainder abs
+syn keyword sqlFunction graphical_plan plan explanation ulplan
+syn keyword sqlFunction graphical_ulplan long_ulplan
+syn keyword sqlFunction short_ulplan rewrite watcomsql
+syn keyword sqlFunction transactsql dialect estimate
+syn keyword sqlFunction estimate_source index_estimate
+syn keyword sqlFunction experience_estimate traceback wsql_state
+syn keyword sqlFunction lang_message dateadd datediff datepart
+syn keyword sqlFunction datename dayname monthname quarter
+syn keyword sqlFunction tsequal hextoint inttohex rand textptr
+syn keyword sqlFunction rowid grouping stddev variance rank
+syn keyword sqlFunction dense_rank density percent_rank user_name
+syn keyword sqlFunction user_id str stuff char_length nullif
+syn keyword sqlFunction sortkey compare ts_index_statistics
+syn keyword sqlFunction ts_table_statistics isdate isnumeric
+syn keyword sqlFunction get_identity lookup newid uuidtostr
+syn keyword sqlFunction strtouuid varexists
" 9.0.1 functions
-syn keyword sqlFunction acos asin atan atn2 cast ceiling convert cos cot
-syn keyword sqlFunction char_length coalesce dateformat datetime degrees exp
-syn keyword sqlFunction floor getdate insertstr
-syn keyword sqlFunction log log10 lower mod pi power
-syn keyword sqlFunction property radians replicate round sign sin
-syn keyword sqlFunction sqldialect tan truncate truncnum
-syn keyword sqlFunction base64_encode base64_decode
-syn keyword sqlFunction hash compress decompress encrypt decrypt
+syn keyword sqlFunction acos asin atan atn2 cast ceiling convert cos cot
+syn keyword sqlFunction char_length coalesce dateformat datetime degrees exp
+syn keyword sqlFunction floor getdate insertstr
+syn keyword sqlFunction log log10 lower mod pi power
+syn keyword sqlFunction property radians replicate round sign sin
+syn keyword sqlFunction sqldialect tan truncate truncnum
+syn keyword sqlFunction base64_encode base64_decode
+syn keyword sqlFunction hash compress decompress encrypt decrypt
" string functions
-syn keyword sqlFunction ascii char left ltrim repeat
-syn keyword sqlFunction space right rtrim trim lcase ucase
-syn keyword sqlFunction locate charindex patindex replace
-syn keyword sqlFunction errormsg csconvert
+syn keyword sqlFunction ascii char left ltrim repeat
+syn keyword sqlFunction space right rtrim trim lcase ucase
+syn keyword sqlFunction locate charindex patindex replace
+syn keyword sqlFunction errormsg csconvert
" property functions
-syn keyword sqlFunction db_id db_name property_name
-syn keyword sqlFunction property_description property_number
-syn keyword sqlFunction next_connection next_database property
-syn keyword sqlFunction connection_property db_property db_extended_property
-syn keyword sqlFunction event_parmeter event_condition event_condition_name
+syn keyword sqlFunction db_id db_name property_name
+syn keyword sqlFunction property_description property_number
+syn keyword sqlFunction next_connection next_database property
+syn keyword sqlFunction connection_property db_property db_extended_property
+syn keyword sqlFunction event_parmeter event_condition event_condition_name
" sa_ procedures
-syn keyword sqlFunction sa_add_index_consultant_analysis
-syn keyword sqlFunction sa_add_workload_query
-syn keyword sqlFunction sa_app_deregister
-syn keyword sqlFunction sa_app_get_infoStr
-syn keyword sqlFunction sa_app_get_status
-syn keyword sqlFunction sa_app_register
-syn keyword sqlFunction sa_app_registration_unlock
-syn keyword sqlFunction sa_app_set_infoStr
-syn keyword sqlFunction sa_audit_string
-syn keyword sqlFunction sa_check_commit
-syn keyword sqlFunction sa_checkpoint_execute
-syn keyword sqlFunction sa_conn_activity
-syn keyword sqlFunction sa_conn_compression_info
-syn keyword sqlFunction sa_conn_deregister
-syn keyword sqlFunction sa_conn_info
-syn keyword sqlFunction sa_conn_properties
-syn keyword sqlFunction sa_conn_properties_by_conn
-syn keyword sqlFunction sa_conn_properties_by_name
-syn keyword sqlFunction sa_conn_register
-syn keyword sqlFunction sa_conn_set_status
-syn keyword sqlFunction sa_create_analysis_from_query
-syn keyword sqlFunction sa_db_info
-syn keyword sqlFunction sa_db_properties
-syn keyword sqlFunction sa_disable_auditing_type
-syn keyword sqlFunction sa_disable_index
-syn keyword sqlFunction sa_disk_free_space
-syn keyword sqlFunction sa_enable_auditing_type
-syn keyword sqlFunction sa_enable_index
-syn keyword sqlFunction sa_end_forward_to
-syn keyword sqlFunction sa_eng_properties
-syn keyword sqlFunction sa_event_schedules
-syn keyword sqlFunction sa_exec_script
-syn keyword sqlFunction sa_flush_cache
-syn keyword sqlFunction sa_flush_statistics
-syn keyword sqlFunction sa_forward_to
-syn keyword sqlFunction sa_get_dtt
-syn keyword sqlFunction sa_get_histogram
-syn keyword sqlFunction sa_get_request_profile
-syn keyword sqlFunction sa_get_request_profile_sub
-syn keyword sqlFunction sa_get_request_times
-syn keyword sqlFunction sa_get_server_messages
-syn keyword sqlFunction sa_get_simulated_scale_factors
-syn keyword sqlFunction sa_get_workload_capture_status
-syn keyword sqlFunction sa_index_density
-syn keyword sqlFunction sa_index_levels
-syn keyword sqlFunction sa_index_statistics
-syn keyword sqlFunction sa_internal_alter_index_ability
-syn keyword sqlFunction sa_internal_create_analysis_from_query
-syn keyword sqlFunction sa_internal_disk_free_space
-syn keyword sqlFunction sa_internal_get_dtt
-syn keyword sqlFunction sa_internal_get_histogram
-syn keyword sqlFunction sa_internal_get_request_times
-syn keyword sqlFunction sa_internal_get_simulated_scale_factors
-syn keyword sqlFunction sa_internal_get_workload_capture_status
-syn keyword sqlFunction sa_internal_index_density
-syn keyword sqlFunction sa_internal_index_levels
-syn keyword sqlFunction sa_internal_index_statistics
-syn keyword sqlFunction sa_internal_java_loaded_classes
-syn keyword sqlFunction sa_internal_locks
-syn keyword sqlFunction sa_internal_pause_workload_capture
-syn keyword sqlFunction sa_internal_procedure_profile
-syn keyword sqlFunction sa_internal_procedure_profile_summary
-syn keyword sqlFunction sa_internal_read_backup_history
-syn keyword sqlFunction sa_internal_recommend_indexes
-syn keyword sqlFunction sa_internal_reset_identity
-syn keyword sqlFunction sa_internal_resume_workload_capture
-syn keyword sqlFunction sa_internal_start_workload_capture
-syn keyword sqlFunction sa_internal_stop_index_consultant
-syn keyword sqlFunction sa_internal_stop_workload_capture
-syn keyword sqlFunction sa_internal_table_fragmentation
-syn keyword sqlFunction sa_internal_table_page_usage
-syn keyword sqlFunction sa_internal_table_stats
-syn keyword sqlFunction sa_internal_virtual_sysindex
-syn keyword sqlFunction sa_internal_virtual_sysixcol
-syn keyword sqlFunction sa_java_loaded_classes
-syn keyword sqlFunction sa_jdk_version
-syn keyword sqlFunction sa_locks
-syn keyword sqlFunction sa_make_object
-syn keyword sqlFunction sa_pause_workload_capture
-syn keyword sqlFunction sa_proc_debug_attach_to_connection
-syn keyword sqlFunction sa_proc_debug_connect
-syn keyword sqlFunction sa_proc_debug_detach_from_connection
-syn keyword sqlFunction sa_proc_debug_disconnect
-syn keyword sqlFunction sa_proc_debug_get_connection_name
-syn keyword sqlFunction sa_proc_debug_release_connection
-syn keyword sqlFunction sa_proc_debug_request
-syn keyword sqlFunction sa_proc_debug_version
-syn keyword sqlFunction sa_proc_debug_wait_for_connection
-syn keyword sqlFunction sa_procedure_profile
-syn keyword sqlFunction sa_procedure_profile_summary
-syn keyword sqlFunction sa_read_backup_history
-syn keyword sqlFunction sa_recommend_indexes
-syn keyword sqlFunction sa_recompile_views
-syn keyword sqlFunction sa_remove_index_consultant_analysis
-syn keyword sqlFunction sa_remove_index_consultant_workload
-syn keyword sqlFunction sa_reset_identity
-syn keyword sqlFunction sa_resume_workload_capture
-syn keyword sqlFunction sa_server_option
-syn keyword sqlFunction sa_set_simulated_scale_factor
-syn keyword sqlFunction sa_setremoteuser
-syn keyword sqlFunction sa_setsubscription
-syn keyword sqlFunction sa_start_recording_commits
-syn keyword sqlFunction sa_start_workload_capture
-syn keyword sqlFunction sa_statement_text
-syn keyword sqlFunction sa_stop_index_consultant
-syn keyword sqlFunction sa_stop_recording_commits
-syn keyword sqlFunction sa_stop_workload_capture
-syn keyword sqlFunction sa_sync
-syn keyword sqlFunction sa_sync_sub
-syn keyword sqlFunction sa_table_fragmentation
-syn keyword sqlFunction sa_table_page_usage
-syn keyword sqlFunction sa_table_stats
-syn keyword sqlFunction sa_update_index_consultant_workload
-syn keyword sqlFunction sa_validate
-syn keyword sqlFunction sa_virtual_sysindex
-syn keyword sqlFunction sa_virtual_sysixcol
+syn keyword sqlFunction sa_add_index_consultant_analysis
+syn keyword sqlFunction sa_add_workload_query
+syn keyword sqlFunction sa_app_deregister
+syn keyword sqlFunction sa_app_get_infoStr
+syn keyword sqlFunction sa_app_get_status
+syn keyword sqlFunction sa_app_register
+syn keyword sqlFunction sa_app_registration_unlock
+syn keyword sqlFunction sa_app_set_infoStr
+syn keyword sqlFunction sa_audit_string
+syn keyword sqlFunction sa_check_commit
+syn keyword sqlFunction sa_checkpoint_execute
+syn keyword sqlFunction sa_conn_activity
+syn keyword sqlFunction sa_conn_compression_info
+syn keyword sqlFunction sa_conn_deregister
+syn keyword sqlFunction sa_conn_info
+syn keyword sqlFunction sa_conn_properties
+syn keyword sqlFunction sa_conn_properties_by_conn
+syn keyword sqlFunction sa_conn_properties_by_name
+syn keyword sqlFunction sa_conn_register
+syn keyword sqlFunction sa_conn_set_status
+syn keyword sqlFunction sa_create_analysis_from_query
+syn keyword sqlFunction sa_db_info
+syn keyword sqlFunction sa_db_properties
+syn keyword sqlFunction sa_disable_auditing_type
+syn keyword sqlFunction sa_disable_index
+syn keyword sqlFunction sa_disk_free_space
+syn keyword sqlFunction sa_enable_auditing_type
+syn keyword sqlFunction sa_enable_index
+syn keyword sqlFunction sa_end_forward_to
+syn keyword sqlFunction sa_eng_properties
+syn keyword sqlFunction sa_event_schedules
+syn keyword sqlFunction sa_exec_script
+syn keyword sqlFunction sa_flush_cache
+syn keyword sqlFunction sa_flush_statistics
+syn keyword sqlFunction sa_forward_to
+syn keyword sqlFunction sa_get_dtt
+syn keyword sqlFunction sa_get_histogram
+syn keyword sqlFunction sa_get_request_profile
+syn keyword sqlFunction sa_get_request_profile_sub
+syn keyword sqlFunction sa_get_request_times
+syn keyword sqlFunction sa_get_server_messages
+syn keyword sqlFunction sa_get_simulated_scale_factors
+syn keyword sqlFunction sa_get_workload_capture_status
+syn keyword sqlFunction sa_index_density
+syn keyword sqlFunction sa_index_levels
+syn keyword sqlFunction sa_index_statistics
+syn keyword sqlFunction sa_internal_alter_index_ability
+syn keyword sqlFunction sa_internal_create_analysis_from_query
+syn keyword sqlFunction sa_internal_disk_free_space
+syn keyword sqlFunction sa_internal_get_dtt
+syn keyword sqlFunction sa_internal_get_histogram
+syn keyword sqlFunction sa_internal_get_request_times
+syn keyword sqlFunction sa_internal_get_simulated_scale_factors
+syn keyword sqlFunction sa_internal_get_workload_capture_status
+syn keyword sqlFunction sa_internal_index_density
+syn keyword sqlFunction sa_internal_index_levels
+syn keyword sqlFunction sa_internal_index_statistics
+syn keyword sqlFunction sa_internal_java_loaded_classes
+syn keyword sqlFunction sa_internal_locks
+syn keyword sqlFunction sa_internal_pause_workload_capture
+syn keyword sqlFunction sa_internal_procedure_profile
+syn keyword sqlFunction sa_internal_procedure_profile_summary
+syn keyword sqlFunction sa_internal_read_backup_history
+syn keyword sqlFunction sa_internal_recommend_indexes
+syn keyword sqlFunction sa_internal_reset_identity
+syn keyword sqlFunction sa_internal_resume_workload_capture
+syn keyword sqlFunction sa_internal_start_workload_capture
+syn keyword sqlFunction sa_internal_stop_index_consultant
+syn keyword sqlFunction sa_internal_stop_workload_capture
+syn keyword sqlFunction sa_internal_table_fragmentation
+syn keyword sqlFunction sa_internal_table_page_usage
+syn keyword sqlFunction sa_internal_table_stats
+syn keyword sqlFunction sa_internal_virtual_sysindex
+syn keyword sqlFunction sa_internal_virtual_sysixcol
+syn keyword sqlFunction sa_java_loaded_classes
+syn keyword sqlFunction sa_jdk_version
+syn keyword sqlFunction sa_locks
+syn keyword sqlFunction sa_make_object
+syn keyword sqlFunction sa_pause_workload_capture
+syn keyword sqlFunction sa_proc_debug_attach_to_connection
+syn keyword sqlFunction sa_proc_debug_connect
+syn keyword sqlFunction sa_proc_debug_detach_from_connection
+syn keyword sqlFunction sa_proc_debug_disconnect
+syn keyword sqlFunction sa_proc_debug_get_connection_name
+syn keyword sqlFunction sa_proc_debug_release_connection
+syn keyword sqlFunction sa_proc_debug_request
+syn keyword sqlFunction sa_proc_debug_version
+syn keyword sqlFunction sa_proc_debug_wait_for_connection
+syn keyword sqlFunction sa_procedure_profile
+syn keyword sqlFunction sa_procedure_profile_summary
+syn keyword sqlFunction sa_read_backup_history
+syn keyword sqlFunction sa_recommend_indexes
+syn keyword sqlFunction sa_recompile_views
+syn keyword sqlFunction sa_remove_index_consultant_analysis
+syn keyword sqlFunction sa_remove_index_consultant_workload
+syn keyword sqlFunction sa_reset_identity
+syn keyword sqlFunction sa_resume_workload_capture
+syn keyword sqlFunction sa_server_option
+syn keyword sqlFunction sa_set_simulated_scale_factor
+syn keyword sqlFunction sa_setremoteuser
+syn keyword sqlFunction sa_setsubscription
+syn keyword sqlFunction sa_start_recording_commits
+syn keyword sqlFunction sa_start_workload_capture
+syn keyword sqlFunction sa_statement_text
+syn keyword sqlFunction sa_stop_index_consultant
+syn keyword sqlFunction sa_stop_recording_commits
+syn keyword sqlFunction sa_stop_workload_capture
+syn keyword sqlFunction sa_sync
+syn keyword sqlFunction sa_sync_sub
+syn keyword sqlFunction sa_table_fragmentation
+syn keyword sqlFunction sa_table_page_usage
+syn keyword sqlFunction sa_table_stats
+syn keyword sqlFunction sa_update_index_consultant_workload
+syn keyword sqlFunction sa_validate
+syn keyword sqlFunction sa_virtual_sysindex
+syn keyword sqlFunction sa_virtual_sysixcol
" sp_ procedures
-syn keyword sqlFunction sp_addalias
-syn keyword sqlFunction sp_addauditrecord
-syn keyword sqlFunction sp_adddumpdevice
-syn keyword sqlFunction sp_addgroup
-syn keyword sqlFunction sp_addlanguage
-syn keyword sqlFunction sp_addlogin
-syn keyword sqlFunction sp_addmessage
-syn keyword sqlFunction sp_addremotelogin
-syn keyword sqlFunction sp_addsegment
-syn keyword sqlFunction sp_addserver
-syn keyword sqlFunction sp_addthreshold
-syn keyword sqlFunction sp_addtype
-syn keyword sqlFunction sp_adduser
-syn keyword sqlFunction sp_auditdatabase
-syn keyword sqlFunction sp_auditlogin
-syn keyword sqlFunction sp_auditobject
-syn keyword sqlFunction sp_auditoption
-syn keyword sqlFunction sp_auditsproc
-syn keyword sqlFunction sp_bindefault
-syn keyword sqlFunction sp_bindmsg
-syn keyword sqlFunction sp_bindrule
-syn keyword sqlFunction sp_changedbowner
-syn keyword sqlFunction sp_changegroup
-syn keyword sqlFunction sp_checknames
-syn keyword sqlFunction sp_checkperms
-syn keyword sqlFunction sp_checkreswords
-syn keyword sqlFunction sp_clearstats
-syn keyword sqlFunction sp_column_privileges
-syn keyword sqlFunction sp_columns
-syn keyword sqlFunction sp_commonkey
-syn keyword sqlFunction sp_configure
-syn keyword sqlFunction sp_cursorinfo
-syn keyword sqlFunction sp_databases
-syn keyword sqlFunction sp_datatype_info
-syn keyword sqlFunction sp_dboption
-syn keyword sqlFunction sp_dbremap
-syn keyword sqlFunction sp_depends
-syn keyword sqlFunction sp_diskdefault
-syn keyword sqlFunction sp_displaylogin
-syn keyword sqlFunction sp_dropalias
-syn keyword sqlFunction sp_dropdevice
-syn keyword sqlFunction sp_dropgroup
-syn keyword sqlFunction sp_dropkey
-syn keyword sqlFunction sp_droplanguage
-syn keyword sqlFunction sp_droplogin
-syn keyword sqlFunction sp_dropmessage
-syn keyword sqlFunction sp_dropremotelogin
-syn keyword sqlFunction sp_dropsegment
-syn keyword sqlFunction sp_dropserver
-syn keyword sqlFunction sp_dropthreshold
-syn keyword sqlFunction sp_droptype
-syn keyword sqlFunction sp_dropuser
-syn keyword sqlFunction sp_estspace
-syn keyword sqlFunction sp_extendsegment
-syn keyword sqlFunction sp_fkeys
-syn keyword sqlFunction sp_foreignkey
-syn keyword sqlFunction sp_getmessage
-syn keyword sqlFunction sp_help
-syn keyword sqlFunction sp_helpconstraint
-syn keyword sqlFunction sp_helpdb
-syn keyword sqlFunction sp_helpdevice
-syn keyword sqlFunction sp_helpgroup
-syn keyword sqlFunction sp_helpindex
-syn keyword sqlFunction sp_helpjoins
-syn keyword sqlFunction sp_helpkey
-syn keyword sqlFunction sp_helplanguage
-syn keyword sqlFunction sp_helplog
-syn keyword sqlFunction sp_helpprotect
-syn keyword sqlFunction sp_helpremotelogin
-syn keyword sqlFunction sp_helpsegment
-syn keyword sqlFunction sp_helpserver
-syn keyword sqlFunction sp_helpsort
-syn keyword sqlFunction sp_helptext
-syn keyword sqlFunction sp_helpthreshold
-syn keyword sqlFunction sp_helpuser
-syn keyword sqlFunction sp_indsuspect
-syn keyword sqlFunction sp_lock
-syn keyword sqlFunction sp_locklogin
-syn keyword sqlFunction sp_logdevice
-syn keyword sqlFunction sp_login_environment
-syn keyword sqlFunction sp_modifylogin
-syn keyword sqlFunction sp_modifythreshold
-syn keyword sqlFunction sp_monitor
-syn keyword sqlFunction sp_password
-syn keyword sqlFunction sp_pkeys
-syn keyword sqlFunction sp_placeobject
-syn keyword sqlFunction sp_primarykey
-syn keyword sqlFunction sp_procxmode
-syn keyword sqlFunction sp_recompile
-syn keyword sqlFunction sp_remap
-syn keyword sqlFunction sp_remote_columns
-syn keyword sqlFunction sp_remote_exported_keys
-syn keyword sqlFunction sp_remote_imported_keys
-syn keyword sqlFunction sp_remote_pcols
-syn keyword sqlFunction sp_remote_primary_keys
-syn keyword sqlFunction sp_remote_procedures
-syn keyword sqlFunction sp_remote_tables
-syn keyword sqlFunction sp_remoteoption
-syn keyword sqlFunction sp_rename
-syn keyword sqlFunction sp_renamedb
-syn keyword sqlFunction sp_reportstats
-syn keyword sqlFunction sp_reset_tsql_environment
-syn keyword sqlFunction sp_role
-syn keyword sqlFunction sp_server_info
-syn keyword sqlFunction sp_servercaps
-syn keyword sqlFunction sp_serverinfo
-syn keyword sqlFunction sp_serveroption
-syn keyword sqlFunction sp_setlangalias
-syn keyword sqlFunction sp_setreplicate
-syn keyword sqlFunction sp_setrepproc
-syn keyword sqlFunction sp_setreptable
-syn keyword sqlFunction sp_spaceused
-syn keyword sqlFunction sp_special_columns
-syn keyword sqlFunction sp_sproc_columns
-syn keyword sqlFunction sp_statistics
-syn keyword sqlFunction sp_stored_procedures
-syn keyword sqlFunction sp_syntax
-syn keyword sqlFunction sp_table_privileges
-syn keyword sqlFunction sp_tables
-syn keyword sqlFunction sp_tsql_environment
-syn keyword sqlFunction sp_tsql_feature_not_supported
-syn keyword sqlFunction sp_unbindefault
-syn keyword sqlFunction sp_unbindmsg
-syn keyword sqlFunction sp_unbindrule
-syn keyword sqlFunction sp_volchanged
-syn keyword sqlFunction sp_who
-syn keyword sqlFunction xp_scanf
-syn keyword sqlFunction xp_sprintf
+syn keyword sqlFunction sp_addalias
+syn keyword sqlFunction sp_addauditrecord
+syn keyword sqlFunction sp_adddumpdevice
+syn keyword sqlFunction sp_addgroup
+syn keyword sqlFunction sp_addlanguage
+syn keyword sqlFunction sp_addlogin
+syn keyword sqlFunction sp_addmessage
+syn keyword sqlFunction sp_addremotelogin
+syn keyword sqlFunction sp_addsegment
+syn keyword sqlFunction sp_addserver
+syn keyword sqlFunction sp_addthreshold
+syn keyword sqlFunction sp_addtype
+syn keyword sqlFunction sp_adduser
+syn keyword sqlFunction sp_auditdatabase
+syn keyword sqlFunction sp_auditlogin
+syn keyword sqlFunction sp_auditobject
+syn keyword sqlFunction sp_auditoption
+syn keyword sqlFunction sp_auditsproc
+syn keyword sqlFunction sp_bindefault
+syn keyword sqlFunction sp_bindmsg
+syn keyword sqlFunction sp_bindrule
+syn keyword sqlFunction sp_changedbowner
+syn keyword sqlFunction sp_changegroup
+syn keyword sqlFunction sp_checknames
+syn keyword sqlFunction sp_checkperms
+syn keyword sqlFunction sp_checkreswords
+syn keyword sqlFunction sp_clearstats
+syn keyword sqlFunction sp_column_privileges
+syn keyword sqlFunction sp_columns
+syn keyword sqlFunction sp_commonkey
+syn keyword sqlFunction sp_configure
+syn keyword sqlFunction sp_cursorinfo
+syn keyword sqlFunction sp_databases
+syn keyword sqlFunction sp_datatype_info
+syn keyword sqlFunction sp_dboption
+syn keyword sqlFunction sp_dbremap
+syn keyword sqlFunction sp_depends
+syn keyword sqlFunction sp_diskdefault
+syn keyword sqlFunction sp_displaylogin
+syn keyword sqlFunction sp_dropalias
+syn keyword sqlFunction sp_dropdevice
+syn keyword sqlFunction sp_dropgroup
+syn keyword sqlFunction sp_dropkey
+syn keyword sqlFunction sp_droplanguage
+syn keyword sqlFunction sp_droplogin
+syn keyword sqlFunction sp_dropmessage
+syn keyword sqlFunction sp_dropremotelogin
+syn keyword sqlFunction sp_dropsegment
+syn keyword sqlFunction sp_dropserver
+syn keyword sqlFunction sp_dropthreshold
+syn keyword sqlFunction sp_droptype
+syn keyword sqlFunction sp_dropuser
+syn keyword sqlFunction sp_estspace
+syn keyword sqlFunction sp_extendsegment
+syn keyword sqlFunction sp_fkeys
+syn keyword sqlFunction sp_foreignkey
+syn keyword sqlFunction sp_getmessage
+syn keyword sqlFunction sp_help
+syn keyword sqlFunction sp_helpconstraint
+syn keyword sqlFunction sp_helpdb
+syn keyword sqlFunction sp_helpdevice
+syn keyword sqlFunction sp_helpgroup
+syn keyword sqlFunction sp_helpindex
+syn keyword sqlFunction sp_helpjoins
+syn keyword sqlFunction sp_helpkey
+syn keyword sqlFunction sp_helplanguage
+syn keyword sqlFunction sp_helplog
+syn keyword sqlFunction sp_helpprotect
+syn keyword sqlFunction sp_helpremotelogin
+syn keyword sqlFunction sp_helpsegment
+syn keyword sqlFunction sp_helpserver
+syn keyword sqlFunction sp_helpsort
+syn keyword sqlFunction sp_helptext
+syn keyword sqlFunction sp_helpthreshold
+syn keyword sqlFunction sp_helpuser
+syn keyword sqlFunction sp_indsuspect
+syn keyword sqlFunction sp_lock
+syn keyword sqlFunction sp_locklogin
+syn keyword sqlFunction sp_logdevice
+syn keyword sqlFunction sp_login_environment
+syn keyword sqlFunction sp_modifylogin
+syn keyword sqlFunction sp_modifythreshold
+syn keyword sqlFunction sp_monitor
+syn keyword sqlFunction sp_password
+syn keyword sqlFunction sp_pkeys
+syn keyword sqlFunction sp_placeobject
+syn keyword sqlFunction sp_primarykey
+syn keyword sqlFunction sp_procxmode
+syn keyword sqlFunction sp_recompile
+syn keyword sqlFunction sp_remap
+syn keyword sqlFunction sp_remote_columns
+syn keyword sqlFunction sp_remote_exported_keys
+syn keyword sqlFunction sp_remote_imported_keys
+syn keyword sqlFunction sp_remote_pcols
+syn keyword sqlFunction sp_remote_primary_keys
+syn keyword sqlFunction sp_remote_procedures
+syn keyword sqlFunction sp_remote_tables
+syn keyword sqlFunction sp_remoteoption
+syn keyword sqlFunction sp_rename
+syn keyword sqlFunction sp_renamedb
+syn keyword sqlFunction sp_reportstats
+syn keyword sqlFunction sp_reset_tsql_environment
+syn keyword sqlFunction sp_role
+syn keyword sqlFunction sp_server_info
+syn keyword sqlFunction sp_servercaps
+syn keyword sqlFunction sp_serverinfo
+syn keyword sqlFunction sp_serveroption
+syn keyword sqlFunction sp_setlangalias
+syn keyword sqlFunction sp_setreplicate
+syn keyword sqlFunction sp_setrepproc
+syn keyword sqlFunction sp_setreptable
+syn keyword sqlFunction sp_spaceused
+syn keyword sqlFunction sp_special_columns
+syn keyword sqlFunction sp_sproc_columns
+syn keyword sqlFunction sp_statistics
+syn keyword sqlFunction sp_stored_procedures
+syn keyword sqlFunction sp_syntax
+syn keyword sqlFunction sp_table_privileges
+syn keyword sqlFunction sp_tables
+syn keyword sqlFunction sp_tsql_environment
+syn keyword sqlFunction sp_tsql_feature_not_supported
+syn keyword sqlFunction sp_unbindefault
+syn keyword sqlFunction sp_unbindmsg
+syn keyword sqlFunction sp_unbindrule
+syn keyword sqlFunction sp_volchanged
+syn keyword sqlFunction sp_who
+syn keyword sqlFunction xp_scanf
+syn keyword sqlFunction xp_sprintf
" server functions
-syn keyword sqlFunction col_length
-syn keyword sqlFunction col_name
-syn keyword sqlFunction index_col
-syn keyword sqlFunction object_id
-syn keyword sqlFunction object_name
-syn keyword sqlFunction proc_role
-syn keyword sqlFunction show_role
-syn keyword sqlFunction xp_cmdshell
-syn keyword sqlFunction xp_msver
-syn keyword sqlFunction xp_read_file
-syn keyword sqlFunction xp_real_cmdshell
-syn keyword sqlFunction xp_real_read_file
-syn keyword sqlFunction xp_real_sendmail
-syn keyword sqlFunction xp_real_startmail
-syn keyword sqlFunction xp_real_startsmtp
-syn keyword sqlFunction xp_real_stopmail
-syn keyword sqlFunction xp_real_stopsmtp
-syn keyword sqlFunction xp_real_write_file
-syn keyword sqlFunction xp_scanf
-syn keyword sqlFunction xp_sendmail
-syn keyword sqlFunction xp_sprintf
-syn keyword sqlFunction xp_startmail
-syn keyword sqlFunction xp_startsmtp
-syn keyword sqlFunction xp_stopmail
-syn keyword sqlFunction xp_stopsmtp
-syn keyword sqlFunction xp_write_file
+syn keyword sqlFunction col_length
+syn keyword sqlFunction col_name
+syn keyword sqlFunction index_col
+syn keyword sqlFunction object_id
+syn keyword sqlFunction object_name
+syn keyword sqlFunction proc_role
+syn keyword sqlFunction show_role
+syn keyword sqlFunction xp_cmdshell
+syn keyword sqlFunction xp_msver
+syn keyword sqlFunction xp_read_file
+syn keyword sqlFunction xp_real_cmdshell
+syn keyword sqlFunction xp_real_read_file
+syn keyword sqlFunction xp_real_sendmail
+syn keyword sqlFunction xp_real_startmail
+syn keyword sqlFunction xp_real_startsmtp
+syn keyword sqlFunction xp_real_stopmail
+syn keyword sqlFunction xp_real_stopsmtp
+syn keyword sqlFunction xp_real_write_file
+syn keyword sqlFunction xp_scanf
+syn keyword sqlFunction xp_sendmail
+syn keyword sqlFunction xp_sprintf
+syn keyword sqlFunction xp_startmail
+syn keyword sqlFunction xp_startsmtp
+syn keyword sqlFunction xp_stopmail
+syn keyword sqlFunction xp_stopsmtp
+syn keyword sqlFunction xp_write_file
" http functions
-syn keyword sqlFunction http_header http_variable
-syn keyword sqlFunction next_http_header next_http_variable
-syn keyword sqlFunction sa_set_http_header sa_set_http_option
-syn keyword sqlFunction sa_http_variable_info sa_http_header_info
+syn keyword sqlFunction http_header http_variable
+syn keyword sqlFunction next_http_header next_http_variable
+syn keyword sqlFunction sa_set_http_header sa_set_http_option
+syn keyword sqlFunction sa_http_variable_info sa_http_header_info
" http functions 9.0.1
-syn keyword sqlFunction http_encode http_decode
-syn keyword sqlFunction html_encode html_decode
+syn keyword sqlFunction http_encode http_decode
+syn keyword sqlFunction html_encode html_decode
" keywords
-syn keyword sqlKeyword absolute action activ add address after
-syn keyword sqlKeyword algorithm allow_dup_row
-syn keyword sqlKeyword alter and any as asc ascii ase at atomic
-syn keyword sqlKeyword attended audit authorization
-syn keyword sqlKeyword autoincrement autostop bcp before
-syn keyword sqlKeyword between blank
-syn keyword sqlKeyword blanks block bottom unbounded break bufferpool
-syn keyword sqlKeyword bulk by byte cache calibrate calibration
-syn keyword sqlKeyword capability cascade cast
-syn keyword sqlKeyword catalog changes char char_convert check
-syn keyword sqlKeyword class classes client
-syn keyword sqlKeyword cluster clustered collation column
-syn keyword sqlKeyword command comment comparisons
-syn keyword sqlKeyword compatible component compressed compute
-syn keyword sqlKeyword concat confirm connection
-syn keyword sqlKeyword console consolidate consolidated
-syn keyword sqlKeyword constraint constraints continue
-syn keyword sqlKeyword convert count crc cross cube
-syn keyword sqlKeyword current cursor data data database
-syn keyword sqlKeyword current_timestamp current_user
-syn keyword sqlKeyword datatype dba dbfile
-syn keyword sqlKeyword dbspace debug
-syn keyword sqlKeyword decrypted default defaults definition
-syn keyword sqlKeyword delay deleting delimited desc
-syn keyword sqlKeyword description deterministic directory
-syn keyword sqlKeyword disable distinct do domain
-syn keyword sqlKeyword dsetpass dttm dynamic each editproc ejb
-syn keyword sqlKeyword else elseif enable encrypted end endif
-syn keyword sqlKeyword engine erase error escape escapes event
-syn keyword sqlKeyword every exception exclusive exec
-syn keyword sqlKeyword existing exists expanded express
-syn keyword sqlKeyword external externlogin factor false
-syn keyword sqlKeyword fastfirstrow fieldproc file filler
-syn keyword sqlKeyword fillfactor finish first first_keyword
-syn keyword sqlKeyword following force foreign format
-syn keyword sqlKeyword freepage full function go global
-syn keyword sqlKeyword group handler hash having hexadecimal
-syn keyword sqlKeyword hidden high hng hold holdlock
-syn keyword sqlKeyword hours id identified identity ignore
-syn keyword sqlKeyword ignore_dup_key ignore_dup_row immediate
-syn keyword sqlKeyword in inactive incremental index info inner
-syn keyword sqlKeyword inout insensitive inserting
-syn keyword sqlKeyword instead integrated
-syn keyword sqlKeyword internal into iq is isolation jar java
-syn keyword sqlKeyword jconnect jdk join kb key language last
-syn keyword sqlKeyword last_keyword lateral left level like
-syn keyword sqlKeyword limit local location log
-syn keyword sqlKeyword logging login long low main
-syn keyword sqlKeyword match max maximum membership
-syn keyword sqlKeyword minutes mirror mode modify monitor
-syn keyword sqlKeyword name named native natural new next no
-syn keyword sqlKeyword noholdlock nolock nonclustered none not
-syn keyword sqlKeyword notify null nulls of off old on
-syn keyword sqlKeyword only optimization optimizer option
-syn keyword sqlKeyword or order others out outer over
-syn keyword sqlKeyword package packetsize padding page pages
-syn keyword sqlKeyword paglock parallel part partition path
-syn keyword sqlKeyword pctfree plan preceding precision prefetch prefix
-syn keyword sqlKeyword preserve preview primary
-syn keyword sqlKeyword prior priqty private privileges
-syn keyword sqlKeyword procedure public publication publish publisher
-syn keyword sqlKeyword quotes range readcommitted
-syn keyword sqlKeyword readpast readuncommitted
-syn keyword sqlKeyword received recompile recursive references
-syn keyword sqlKeyword referencing relative
-syn keyword sqlKeyword rename repeatableread
-syn keyword sqlKeyword replicate rereceive resend reset
-syn keyword sqlKeyword resolve resource respect
-syn keyword sqlKeyword restrict result retain
-syn keyword sqlKeyword returns right
-syn keyword sqlKeyword rollup row rowlock rows save
-syn keyword sqlKeyword schedule schema scroll seconds secqty
-syn keyword sqlKeyword send sensitive sent serializable
-syn keyword sqlKeyword server server session sets
-syn keyword sqlKeyword share since site size skip
-syn keyword sqlKeyword some sorted_data sqlcode sqlid
-syn keyword sqlKeyword sqlstate stacker statement
-syn keyword sqlKeyword statistics status stogroup store
-syn keyword sqlKeyword strip subpages subscribe subscription
-syn keyword sqlKeyword subtransaction synchronization
-syn keyword sqlKeyword syntax_error table tablock
-syn keyword sqlKeyword tablockx tb temp template temporary then
-syn keyword sqlKeyword timezone to top
-syn keyword sqlKeyword transaction transactional tries true
-syn keyword sqlKeyword tsequal type unconditionally unenforced
-syn keyword sqlKeyword unique union unknown unload
-syn keyword sqlKeyword updating updlock upgrade use user
-syn keyword sqlKeyword using utc utilities validproc
-syn keyword sqlKeyword value values varchar variable
-syn keyword sqlKeyword varying vcat verify view virtual wait
-syn keyword sqlKeyword warning wd when where window with within
-syn keyword sqlKeyword with_lparen work writefile
-syn keyword sqlKeyword xlock zeros
+syn keyword sqlKeyword absolute accent action activ add address after
+syn keyword sqlKeyword algorithm allow_dup_row
+syn keyword sqlKeyword alter and any as append asc ascii ase at atomic
+syn keyword sqlKeyword attach attended audit authorization
+syn keyword sqlKeyword autoincrement autostop batch bcp before
+syn keyword sqlKeyword between blank blanks block
+syn keyword sqlKeyword both bottom unbounded break bufferpool
+syn keyword sqlKeyword build bulk by byte bytes cache calibrate calibration
+syn keyword sqlKeyword cancel capability cascade cast
+syn keyword sqlKeyword catalog changes char char_convert check checksum
+syn keyword sqlKeyword class classes client cmp
+syn keyword sqlKeyword cluster clustered collation column columns
+syn keyword sqlKeyword command comment committed comparisons
+syn keyword sqlKeyword compatible component compressed compute computes
+syn keyword sqlKeyword concat confirm conflict connection
+syn keyword sqlKeyword console consolidate consolidated
+syn keyword sqlKeyword constraint constraints continue
+syn keyword sqlKeyword convert copy count crc cross cube
+syn keyword sqlKeyword current cursor data data database
+syn keyword sqlKeyword current_timestamp current_user
+syn keyword sqlKeyword datatype dba dbfile
+syn keyword sqlKeyword dbspace dbspacename debug decoupled
+syn keyword sqlKeyword decrypted default defaults deferred definition
+syn keyword sqlKeyword delay deleting delimited dependencies desc
+syn keyword sqlKeyword description detach deterministic directory
+syn keyword sqlKeyword disable disabled distinct do domain download
+syn keyword sqlKeyword dsetpass dttm dynamic each editproc ejb
+syn keyword sqlKeyword else elseif enable encapsulated encrypted end
+syn keyword sqlKeyword encoding endif engine erase error escape escapes event
+syn keyword sqlKeyword every except exception exclude exclusive exec
+syn keyword sqlKeyword existing exists expanded express
+syn keyword sqlKeyword external externlogin factor failover false
+syn keyword sqlKeyword fastfirstrow fieldproc file filler
+syn keyword sqlKeyword fillfactor finish first first_keyword
+syn keyword sqlKeyword following force foreign format
+syn keyword sqlKeyword freepage french fresh full function go global
+syn keyword sqlKeyword group handler hash having header hexadecimal
+syn keyword sqlKeyword hidden high history hold holdlock
+syn keyword sqlKeyword hours id identified identity ignore
+syn keyword sqlKeyword ignore_dup_key ignore_dup_row immediate
+syn keyword sqlKeyword in inactive inactivity incremental index info
+syn keyword sqlKeyword inline inner inout insensitive inserting
+syn keyword sqlKeyword instead integrated
+syn keyword sqlKeyword internal into introduced iq is isolation jar java
+syn keyword sqlKeyword jconnect jdk join kb key keep kerberos language last
+syn keyword sqlKeyword last_keyword lateral left level like
+syn keyword sqlKeyword limit local location log
+syn keyword sqlKeyword logging login logscan long low lru main
+syn keyword sqlKeyword match materialized max maximum membership
+syn keyword sqlKeyword minutes mirror mode modify monitor mru
+syn keyword sqlKeyword name named national native natural new next no
+syn keyword sqlKeyword noholdlock nolock nonclustered none not
+syn keyword sqlKeyword notify null nulls of off old on
+syn keyword sqlKeyword only optimization optimizer option
+syn keyword sqlKeyword or order others out outer over
+syn keyword sqlKeyword package packetsize padding page pages
+syn keyword sqlKeyword paglock parallel part partition partner password path
+syn keyword sqlKeyword pctfree plan preceding precision prefetch prefix
+syn keyword sqlKeyword preserve preview primary
+syn keyword sqlKeyword prior priqty private privileges procedure profile
+syn keyword sqlKeyword public publication publish publisher
+syn keyword sqlKeyword quote quotes range readcommitted readonly
+syn keyword sqlKeyword readpast readuncommitted readwrite rebuild
+syn keyword sqlKeyword received recompile recover recursive references
+syn keyword sqlKeyword referencing refresh relative relocate
+syn keyword sqlKeyword rename repeatable repeatableread
+syn keyword sqlKeyword replicate rereceive resend reserve reset
+syn keyword sqlKeyword resizing resolve resource respect
+syn keyword sqlKeyword restrict result retain
+syn keyword sqlKeyword returns right
+syn keyword sqlKeyword rollup root row rowlock rows save
+syn keyword sqlKeyword schedule schema scripted scroll seconds secqty
+syn keyword sqlKeyword send sensitive sent serializable
+syn keyword sqlKeyword server server session sets
+syn keyword sqlKeyword share simple since site size skip
+syn keyword sqlKeyword snapshot soapheader some sorted_data
+syn keyword sqlKeyword sqlcode sqlid sqlstate stacker stale statement
+syn keyword sqlKeyword statistics status stogroup store
+syn keyword sqlKeyword strip subpages subscribe subscription
+syn keyword sqlKeyword subtransaction synchronization
+syn keyword sqlKeyword syntax_error table tablock
+syn keyword sqlKeyword tablockx tb temp template temporary then
+syn keyword sqlKeyword ties timezone to top tracing
+syn keyword sqlKeyword transaction transactional tries true
+syn keyword sqlKeyword tsequal type tune uncommitted unconditionally
+syn keyword sqlKeyword unenforced unique union unknown unload
+syn keyword sqlKeyword updating updlock upgrade upload use user
+syn keyword sqlKeyword using utc utilities validproc
+syn keyword sqlKeyword value values varchar variable
+syn keyword sqlKeyword varying vcat verify view virtual wait
+syn keyword sqlKeyword warning web when where window with with_auto
+syn keyword sqlKeyword with_auto with_cube with_rollup without
+syn keyword sqlKeyword with_lparen within word work workload writefile
+syn keyword sqlKeyword writers writeserver xlock zeros
" XML function support
-syn keyword sqlFunction openxml xmlelement xmlforest xmlgen xmlconcat xmlagg
-syn keyword sqlFunction xmlattributes
-syn keyword sqlKeyword raw auto elements explicit
+syn keyword sqlFunction openxml xmlelement xmlforest xmlgen xmlconcat xmlagg
+syn keyword sqlFunction xmlattributes
+syn keyword sqlKeyword raw auto elements explicit
" HTTP support
-syn keyword sqlKeyword authorization secure url service
+syn keyword sqlKeyword authorization secure url service
" HTTP 9.0.2 new procedure keywords
-syn keyword sqlKeyword namespace certificate clientport proxy
+syn keyword sqlKeyword namespace certificate clientport proxy
" OLAP support 9.0.0
-syn keyword sqlKeyword covar_pop covar_samp corr regr_slope regr_intercept
-syn keyword sqlKeyword regr_count regr_r2 regr_avgx regr_avgy
-syn keyword sqlKeyword regr_sxx regr_syy regr_sxy
+syn keyword sqlKeyword covar_pop covar_samp corr regr_slope regr_intercept
+syn keyword sqlKeyword regr_count regr_r2 regr_avgx regr_avgy
+syn keyword sqlKeyword regr_sxx regr_syy regr_sxy
" Alternate keywords
-syn keyword sqlKeyword character dec options proc reference
-syn keyword sqlKeyword subtrans tran syn keyword
+syn keyword sqlKeyword character dec options proc reference
+syn keyword sqlKeyword subtrans tran syn keyword
-syn keyword sqlOperator in any some all between exists
-syn keyword sqlOperator like escape not is and or
-syn keyword sqlOperator intersect minus
-syn keyword sqlOperator prior distinct
+syn keyword sqlOperator in any some all between exists
+syn keyword sqlOperator like escape not is and or
+syn keyword sqlOperator intersect minus
+syn keyword sqlOperator prior distinct
syn keyword sqlStatement allocate alter backup begin call case
syn keyword sqlStatement checkpoint clear close commit configure connect
@@ -492,171 +495,173 @@ syn keyword sqlStatement system trigger truncate unload update
syn keyword sqlStatement validate waitfor whenever while writetext
-syn keyword sqlType char long varchar text
-syn keyword sqlType bigint decimal double float int integer numeric
-syn keyword sqlType smallint tinyint real
-syn keyword sqlType money smallmoney
-syn keyword sqlType bit
-syn keyword sqlType date datetime smalldate time timestamp
-syn keyword sqlType binary image varbinary uniqueidentifier
-syn keyword sqlType xml unsigned
+syn keyword sqlType char long varchar text
+syn keyword sqlType bigint decimal double float int integer numeric
+syn keyword sqlType smallint tinyint real
+syn keyword sqlType money smallmoney
+syn keyword sqlType bit
+syn keyword sqlType date datetime smalldate time timestamp
+syn keyword sqlType binary image varbinary uniqueidentifier
+syn keyword sqlType xml unsigned
+" New types 10.0.0
+syn keyword sqlType varbit nchar nvarchar
-syn keyword sqlOption Allow_nulls_by_default
-syn keyword sqlOption Ansi_blanks
-syn keyword sqlOption Ansi_close_cursors_on_rollback
-syn keyword sqlOption Ansi_integer_overflow
-syn keyword sqlOption Ansi_permissions
-syn keyword sqlOption Ansi_update_constraints
-syn keyword sqlOption Ansinull
-syn keyword sqlOption Assume_distinct_servers
-syn keyword sqlOption Auditing
-syn keyword sqlOption Auditing_options
-syn keyword sqlOption Auto_commit
-syn keyword sqlOption Auto_refetch
-syn keyword sqlOption Automatic_timestamp
-syn keyword sqlOption Background_priority
-syn keyword sqlOption Bell
-syn keyword sqlOption Blob_threshold
-syn keyword sqlOption Blocking
-syn keyword sqlOption Blocking_timeout
-syn keyword sqlOption Chained
-syn keyword sqlOption Char_OEM_Translation
-syn keyword sqlOption Checkpoint_time
-syn keyword sqlOption Cis_option
-syn keyword sqlOption Cis_rowset_size
-syn keyword sqlOption Close_on_endtrans
-syn keyword sqlOption Command_delimiter
-syn keyword sqlOption Commit_on_exit
-syn keyword sqlOption Compression
-syn keyword sqlOption Connection_authentication
-syn keyword sqlOption Continue_after_raiserror
-syn keyword sqlOption Conversion_error
-syn keyword sqlOption Cooperative_commit_timeout
-syn keyword sqlOption Cooperative_commits
-syn keyword sqlOption Database_authentication
-syn keyword sqlOption Date_format
-syn keyword sqlOption Date_order
-syn keyword sqlOption Debug_messages
-syn keyword sqlOption Dedicated_task
-syn keyword sqlOption Default_timestamp_increment
-syn keyword sqlOption Delayed_commit_timeout
-syn keyword sqlOption Delayed_commits
-syn keyword sqlOption Delete_old_logs
-syn keyword sqlOption Describe_Java_Format
-syn keyword sqlOption Divide_by_zero_error
-syn keyword sqlOption Echo
-syn keyword sqlOption Escape_character
-syn keyword sqlOption Exclude_operators
-syn keyword sqlOption Extended_join_syntax
-syn keyword sqlOption External_remote_options
-syn keyword sqlOption Fire_triggers
-syn keyword sqlOption First_day_of_week
-syn keyword sqlOption Float_as_double
-syn keyword sqlOption For_xml_null_treatment
-syn keyword sqlOption Force_view_creation
-syn keyword sqlOption Global_database_id
-syn keyword sqlOption Headings
-syn keyword sqlOption Input_format
-syn keyword sqlOption Integrated_server_name
-syn keyword sqlOption Isolation_level
-syn keyword sqlOption ISQL_command_timing
-syn keyword sqlOption ISQL_escape_character
-syn keyword sqlOption ISQL_field_separator
-syn keyword sqlOption ISQL_log
-syn keyword sqlOption ISQL_plan
-syn keyword sqlOption ISQL_plan_cursor_sensitivity
-syn keyword sqlOption ISQL_plan_cursor_writability
-syn keyword sqlOption ISQL_quote
-syn keyword sqlOption Java_heap_size
-syn keyword sqlOption Java_input_output
-syn keyword sqlOption Java_namespace_size
-syn keyword sqlOption Java_page_buffer_size
-syn keyword sqlOption Lock_rejected_rows
-syn keyword sqlOption Log_deadlocks
-syn keyword sqlOption Log_detailed_plans
-syn keyword sqlOption Log_max_requests
-syn keyword sqlOption Login_mode
-syn keyword sqlOption Login_procedure
-syn keyword sqlOption Max_cursor_count
-syn keyword sqlOption Max_hash_size
-syn keyword sqlOption Max_plans_cached
-syn keyword sqlOption Max_recursive_iterations
-syn keyword sqlOption Max_statement_count
-syn keyword sqlOption Max_work_table_hash_size
-syn keyword sqlOption Min_password_length
-syn keyword sqlOption Nearest_century
-syn keyword sqlOption Non_keywords
-syn keyword sqlOption NULLS
-syn keyword sqlOption ODBC_describe_binary_as_varbinary
-syn keyword sqlOption ODBC_distinguish_char_and_varchar
-syn keyword sqlOption On_Charset_conversion_failure
-syn keyword sqlOption On_error
-syn keyword sqlOption On_tsql_error
-syn keyword sqlOption Optimistic_wait_for_commit
-syn keyword sqlOption Optimization_goal
-syn keyword sqlOption Optimization_level
-syn keyword sqlOption Optimization_logging
-syn keyword sqlOption Optimization_workload
-syn keyword sqlOption Output_format
-syn keyword sqlOption Output_length
-syn keyword sqlOption Output_nulls
-syn keyword sqlOption Percent_as_comment
-syn keyword sqlOption Pinned_cursor_percent_of_cache
-syn keyword sqlOption Precision
-syn keyword sqlOption Prefetch
-syn keyword sqlOption Preserve_source_format
-syn keyword sqlOption Prevent_article_pkey_update
-syn keyword sqlOption Qualify_owners
-syn keyword sqlOption Query_plan_on_open
-syn keyword sqlOption Quiet
-syn keyword sqlOption Quote_all_identifiers
-syn keyword sqlOption Quoted_identifier
-syn keyword sqlOption Read_past_deleted
-syn keyword sqlOption Recovery_time
-syn keyword sqlOption Remote_idle_timeout
-syn keyword sqlOption Replicate_all
-syn keyword sqlOption Replication_error
-syn keyword sqlOption Replication_error_piece
-syn keyword sqlOption Return_date_time_as_string
-syn keyword sqlOption Return_java_as_string
-syn keyword sqlOption RI_Trigger_time
-syn keyword sqlOption Rollback_on_deadlock
-syn keyword sqlOption Row_counts
-syn keyword sqlOption Save_remote_passwords
-syn keyword sqlOption Scale
-syn keyword sqlOption Screen_format
-syn keyword sqlOption Sort_Collation
-syn keyword sqlOption SQL_flagger_error_level
-syn keyword sqlOption SQL_flagger_warning_level
-syn keyword sqlOption SQLConnect
-syn keyword sqlOption SQLStart
-syn keyword sqlOption SR_Date_Format
-syn keyword sqlOption SR_Time_Format
-syn keyword sqlOption SR_TimeStamp_Format
-syn keyword sqlOption Statistics
-syn keyword sqlOption String_rtruncation
-syn keyword sqlOption Subscribe_by_remote
-syn keyword sqlOption Subsume_row_locks
-syn keyword sqlOption Suppress_TDS_debugging
-syn keyword sqlOption TDS_Empty_string_is_null
-syn keyword sqlOption Temp_space_limit_check
-syn keyword sqlOption Thread_count
-syn keyword sqlOption Thread_stack
-syn keyword sqlOption Thread_swaps
-syn keyword sqlOption Time_format
-syn keyword sqlOption Time_zone_adjustment
-syn keyword sqlOption Timestamp_format
-syn keyword sqlOption Truncate_date_values
-syn keyword sqlOption Truncate_timestamp_values
-syn keyword sqlOption Truncate_with_auto_commit
-syn keyword sqlOption Truncation_length
-syn keyword sqlOption Tsql_hex_constant
-syn keyword sqlOption Tsql_variables
-syn keyword sqlOption Update_statistics
-syn keyword sqlOption User_estimates
-syn keyword sqlOption Verify_all_columns
-syn keyword sqlOption Verify_threshold
-syn keyword sqlOption Wait_for_commit
+syn keyword sqlOption Allow_nulls_by_default
+syn keyword sqlOption Ansi_blanks
+syn keyword sqlOption Ansi_close_cursors_on_rollback
+syn keyword sqlOption Ansi_integer_overflow
+syn keyword sqlOption Ansi_permissions
+syn keyword sqlOption Ansi_update_constraints
+syn keyword sqlOption Ansinull
+syn keyword sqlOption Assume_distinct_servers
+syn keyword sqlOption Auditing
+syn keyword sqlOption Auditing_options
+syn keyword sqlOption Auto_commit
+syn keyword sqlOption Auto_refetch
+syn keyword sqlOption Automatic_timestamp
+syn keyword sqlOption Background_priority
+syn keyword sqlOption Bell
+syn keyword sqlOption Blob_threshold
+syn keyword sqlOption Blocking
+syn keyword sqlOption Blocking_timeout
+syn keyword sqlOption Chained
+syn keyword sqlOption Char_OEM_Translation
+syn keyword sqlOption Checkpoint_time
+syn keyword sqlOption Cis_option
+syn keyword sqlOption Cis_rowset_size
+syn keyword sqlOption Close_on_endtrans
+syn keyword sqlOption Command_delimiter
+syn keyword sqlOption Commit_on_exit
+syn keyword sqlOption Compression
+syn keyword sqlOption Connection_authentication
+syn keyword sqlOption Continue_after_raiserror
+syn keyword sqlOption Conversion_error
+syn keyword sqlOption Cooperative_commit_timeout
+syn keyword sqlOption Cooperative_commits
+syn keyword sqlOption Database_authentication
+syn keyword sqlOption Date_format
+syn keyword sqlOption Date_order
+syn keyword sqlOption Debug_messages
+syn keyword sqlOption Dedicated_task
+syn keyword sqlOption Default_timestamp_increment
+syn keyword sqlOption Delayed_commit_timeout
+syn keyword sqlOption Delayed_commits
+syn keyword sqlOption Delete_old_logs
+syn keyword sqlOption Describe_Java_Format
+syn keyword sqlOption Divide_by_zero_error
+syn keyword sqlOption Echo
+syn keyword sqlOption Escape_character
+syn keyword sqlOption Exclude_operators
+syn keyword sqlOption Extended_join_syntax
+syn keyword sqlOption External_remote_options
+syn keyword sqlOption Fire_triggers
+syn keyword sqlOption First_day_of_week
+syn keyword sqlOption Float_as_double
+syn keyword sqlOption For_xml_null_treatment
+syn keyword sqlOption Force_view_creation
+syn keyword sqlOption Global_database_id
+syn keyword sqlOption Headings
+syn keyword sqlOption Input_format
+syn keyword sqlOption Integrated_server_name
+syn keyword sqlOption Isolation_level
+syn keyword sqlOption ISQL_command_timing
+syn keyword sqlOption ISQL_escape_character
+syn keyword sqlOption ISQL_field_separator
+syn keyword sqlOption ISQL_log
+syn keyword sqlOption ISQL_plan
+syn keyword sqlOption ISQL_plan_cursor_sensitivity
+syn keyword sqlOption ISQL_plan_cursor_writability
+syn keyword sqlOption ISQL_quote
+syn keyword sqlOption Java_heap_size
+syn keyword sqlOption Java_input_output
+syn keyword sqlOption Java_namespace_size
+syn keyword sqlOption Java_page_buffer_size
+syn keyword sqlOption Lock_rejected_rows
+syn keyword sqlOption Log_deadlocks
+syn keyword sqlOption Log_detailed_plans
+syn keyword sqlOption Log_max_requests
+syn keyword sqlOption Login_mode
+syn keyword sqlOption Login_procedure
+syn keyword sqlOption Max_cursor_count
+syn keyword sqlOption Max_hash_size
+syn keyword sqlOption Max_plans_cached
+syn keyword sqlOption Max_recursive_iterations
+syn keyword sqlOption Max_statement_count
+syn keyword sqlOption Max_work_table_hash_size
+syn keyword sqlOption Min_password_length
+syn keyword sqlOption Nearest_century
+syn keyword sqlOption Non_keywords
+syn keyword sqlOption NULLS
+syn keyword sqlOption ODBC_describe_binary_as_varbinary
+syn keyword sqlOption ODBC_distinguish_char_and_varchar
+syn keyword sqlOption On_Charset_conversion_failure
+syn keyword sqlOption On_error
+syn keyword sqlOption On_tsql_error
+syn keyword sqlOption Optimistic_wait_for_commit
+syn keyword sqlOption Optimization_goal
+syn keyword sqlOption Optimization_level
+syn keyword sqlOption Optimization_logging
+syn keyword sqlOption Optimization_workload
+syn keyword sqlOption Output_format
+syn keyword sqlOption Output_length
+syn keyword sqlOption Output_nulls
+syn keyword sqlOption Percent_as_comment
+syn keyword sqlOption Pinned_cursor_percent_of_cache
+syn keyword sqlOption Precision
+syn keyword sqlOption Prefetch
+syn keyword sqlOption Preserve_source_format
+syn keyword sqlOption Prevent_article_pkey_update
+syn keyword sqlOption Qualify_owners
+syn keyword sqlOption Query_plan_on_open
+syn keyword sqlOption Quiet
+syn keyword sqlOption Quote_all_identifiers
+syn keyword sqlOption Quoted_identifier
+syn keyword sqlOption Read_past_deleted
+syn keyword sqlOption Recovery_time
+syn keyword sqlOption Remote_idle_timeout
+syn keyword sqlOption Replicate_all
+syn keyword sqlOption Replication_error
+syn keyword sqlOption Replication_error_piece
+syn keyword sqlOption Return_date_time_as_string
+syn keyword sqlOption Return_java_as_string
+syn keyword sqlOption RI_Trigger_time
+syn keyword sqlOption Rollback_on_deadlock
+syn keyword sqlOption Row_counts
+syn keyword sqlOption Save_remote_passwords
+syn keyword sqlOption Scale
+syn keyword sqlOption Screen_format
+syn keyword sqlOption Sort_Collation
+syn keyword sqlOption SQL_flagger_error_level
+syn keyword sqlOption SQL_flagger_warning_level
+syn keyword sqlOption SQLConnect
+syn keyword sqlOption SQLStart
+syn keyword sqlOption SR_Date_Format
+syn keyword sqlOption SR_Time_Format
+syn keyword sqlOption SR_TimeStamp_Format
+syn keyword sqlOption Statistics
+syn keyword sqlOption String_rtruncation
+syn keyword sqlOption Subscribe_by_remote
+syn keyword sqlOption Subsume_row_locks
+syn keyword sqlOption Suppress_TDS_debugging
+syn keyword sqlOption TDS_Empty_string_is_null
+syn keyword sqlOption Temp_space_limit_check
+syn keyword sqlOption Thread_count
+syn keyword sqlOption Thread_stack
+syn keyword sqlOption Thread_swaps
+syn keyword sqlOption Time_format
+syn keyword sqlOption Time_zone_adjustment
+syn keyword sqlOption Timestamp_format
+syn keyword sqlOption Truncate_date_values
+syn keyword sqlOption Truncate_timestamp_values
+syn keyword sqlOption Truncate_with_auto_commit
+syn keyword sqlOption Truncation_length
+syn keyword sqlOption Tsql_hex_constant
+syn keyword sqlOption Tsql_variables
+syn keyword sqlOption Update_statistics
+syn keyword sqlOption User_estimates
+syn keyword sqlOption Verify_all_columns
+syn keyword sqlOption Verify_threshold
+syn keyword sqlOption Wait_for_commit
" Strings and characters:
syn region sqlString start=+"+ end=+"+ contains=@Spell
@@ -703,4 +708,4 @@ endif
let b:current_syntax = "sqlanywhere"
-" vim:sw=4:ff=unix:
+" vim:sw=4:
diff --git a/runtime/syntax/sudoers.vim b/runtime/syntax/sudoers.vim
index 2e2d7448..1bcd03f9 100644
--- a/runtime/syntax/sudoers.vim
+++ b/runtime/syntax/sudoers.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: sudoers(5) configuration files
" Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2006-04-19
+" Latest Revision: 2007-08-02
if exists("b:current_syntax")
finish
@@ -156,7 +156,7 @@ syn keyword sudoersListParameter contained env_check env_delete env_keep next
syn match sudoersParameterListComma contained ',' nextgroup=@sudoersParameter skipwhite skipnl
-syn cluster sudoersParameter contains=sudoersBooleanParameter,sudoersIntegerParameterEquals,sudoersStringParameter,sudoersListParameter
+syn cluster sudoersParameter contains=sudoersBooleanParameter,sudoersIntegerParameter,sudoersStringParameter,sudoersListParameter
syn match sudoersIntegerParameterEquals contained '[+-]\==' nextgroup=sudoersIntegerValue skipwhite skipnl
syn match sudoersStringParameterEquals contained '[+-]\==' nextgroup=sudoersStringValue skipwhite skipnl
diff --git a/runtime/syntax/tpp.vim b/runtime/syntax/tpp.vim
index 92fa6f82..050a2ba7 100644
--- a/runtime/syntax/tpp.vim
+++ b/runtime/syntax/tpp.vim
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: tpp - Text Presentation Program
-" Maintainer: Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
+" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainer: Gerfried Fuchs <alfie@ist.org>
-" Last Change: $LastChangedDate: 2006-04-16 22:06:40 -0400 (dom, 16 apr 2006) $
-" URL: http://svn.debian.org/wsvn/pkg-vim/trunk/runtime/syntax/tpp.vim?op=file&rev=0&sc=0
+" Last Change: 2007-10-14
+" URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/syntax/tpp.vim;hb=debian
" Filenames: *.tpp
" License: BSD
"
diff --git a/runtime/syntax/verilogams.vim b/runtime/syntax/verilogams.vim
index 7141eca2..d16e4bff 100644
--- a/runtime/syntax/verilogams.vim
+++ b/runtime/syntax/verilogams.vim
@@ -1,7 +1,13 @@
" Vim syntax file
-" Language: Verilog-AMS
-" Maintainer: S. Myles Prather <smprather@gmail.com>
-" Last Update: Sun Aug 14 03:58:00 CST 2003
+" Language: Verilog-AMS
+" Maintainer: S. Myles Prather <smprather@gmail.com>
+"
+" Version 1.1 S. Myles Prather <smprather@gmail.com>
+" Moved some keywords to the type category.
+" Added the metrix suffixes to the number matcher.
+" Version 1.2 Prasanna Tamhankar <pratam@gmail.com>
+" Minor reserved keyword updates.
+" Last Update: Thursday September 15 15:36:03 CST 2005
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -21,17 +27,17 @@ endif
" Annex B.1 'All keywords'
syn keyword verilogamsStatement above abs absdelay acos acosh ac_stim
syn keyword verilogamsStatement always analog analysis and asin
-syn keyword verilogamsStatement asinh assign atan atan2 atanh branch
-syn keyword verilogamsStatement buf bufif1 ceil cmos
+syn keyword verilogamsStatement asinh assign atan atan2 atanh
+syn keyword verilogamsStatement buf bufif0 bufif1 ceil cmos connectmodule
syn keyword verilogamsStatement connectrules cos cosh cross ddt ddx deassign
syn keyword verilogamsStatement defparam disable discipline
syn keyword verilogamsStatement driver_update edge enddiscipline
-syn keyword verilogamsStatement endconnectrules endmodule endfunction
+syn keyword verilogamsStatement endconnectrules endmodule endfunction endgenerate
syn keyword verilogamsStatement endnature endparamset endprimitive endspecify
syn keyword verilogamsStatement endtable endtask event exp final_step
syn keyword verilogamsStatement flicker_noise floor flow force fork
-syn keyword verilogamsStatement function generate genvar highz0
-syn keyword verilogamsStatement highz1 hypot idt idtmod if ifnone initial
+syn keyword verilogamsStatement function generate highz0
+syn keyword verilogamsStatement highz1 hypot idt idtmod if ifnone inf initial
syn keyword verilogamsStatement initial_step inout input join
syn keyword verilogamsStatement laplace_nd laplace_np laplace_zd laplace_zp
syn keyword verilogamsStatement large last_crossing limexp ln localparam log
@@ -40,17 +46,18 @@ syn keyword verilogamsStatement negedge net_resolution nmos noise_table nor not
syn keyword verilogamsStatement notif0 notif1 or output paramset pmos
syn keyword verilogamsType parameter real integer electrical input output
syn keyword verilogamsType inout reg tri tri0 tri1 triand trior trireg
-syn keyword verilogamsType string from exclude aliasparam ground
+syn keyword verilogamsType string from exclude aliasparam ground genvar
+syn keyword verilogamsType branch time realtime
syn keyword verilogamsStatement posedge potential pow primitive pull0 pull1
syn keyword verilogamsStatement pullup pulldown rcmos release
syn keyword verilogamsStatement rnmos rpmos rtran rtranif0 rtranif1
syn keyword verilogamsStatement scalared sin sinh slew small specify specparam
syn keyword verilogamsStatement sqrt strong0 strong1 supply0 supply1
-syn keyword verilogamsStatement table tan tanh task time timer tran tranif0
+syn keyword verilogamsStatement table tan tanh task timer tran tranif0
syn keyword verilogamsStatement tranif1 transition
syn keyword verilogamsStatement vectored wait wand weak0 weak1
syn keyword verilogamsStatement white_noise wire wor wreal xnor xor zi_nd
-syn keyword verilogamsStatement zi_np zi_zd
+syn keyword verilogamsStatement zi_np zi_zd zi_zp
syn keyword verilogamsRepeat forever repeat while for
syn keyword verilogamsLabel begin end
syn keyword verilogamsConditional if else case casex casez default endcase
@@ -95,7 +102,7 @@ syn match verilogamsNumber "\(\<\d\+\|\)'[bB]\s*[0-1_xXzZ?]\+\>"
syn match verilogamsNumber "\(\<\d\+\|\)'[oO]\s*[0-7_xXzZ?]\+\>"
syn match verilogamsNumber "\(\<\d\+\|\)'[dD]\s*[0-9_xXzZ?]\+\>"
syn match verilogamsNumber "\(\<\d\+\|\)'[hH]\s*[0-9a-fA-F_xXzZ?]\+\>"
-syn match verilogamsNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)\>"
+syn match verilogamsNumber "\<[+-]\=[0-9_]\+\(\.[0-9_]*\|\)\(e[0-9_]*\|\)[TGMKkmunpfa]\=\>"
syn region verilogamsString start=+"+ skip=+\\"+ end=+"+ contains=verilogamsEscape
syn match verilogamsEscape +\\[nt"\\]+ contained
diff --git a/runtime/syntax/xbl.vim b/runtime/syntax/xbl.vim
new file mode 100644
index 00000000..97837e38
--- /dev/null
+++ b/runtime/syntax/xbl.vim
@@ -0,0 +1,29 @@
+" Vim syntax file
+" Language: XBL 1.0
+" Maintainer: Doug Kearns <dougkearns@gmail.com>
+" Latest Revision: 2007 November 5
+
+if exists("b:current_syntax")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+runtime! syntax/xml.vim
+unlet b:current_syntax
+
+syn include @javascriptTop syntax/javascript.vim
+unlet b:current_syntax
+
+syn region xblJavascript
+ \ matchgroup=xmlCdataStart start=+<!\[CDATA\[+
+ \ matchgroup=xmlCdataEnd end=+]]>+
+ \ contains=@javascriptTop keepend extend
+
+let b:current_syntax = "xbl"
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: ts=8
diff --git a/runtime/syntax/xpm.vim b/runtime/syntax/xpm.vim
index 4cbda82f..3cbc1b54 100644
--- a/runtime/syntax/xpm.vim
+++ b/runtime/syntax/xpm.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: X Pixmap
" Maintainer: Ronald Schild <rs@scutum.de>
-" Last Change: 2001 May 09
+" Last Change: 2008 May 28
" Version: 5.4n.1
" For version 5.x: Clear all syntax items
@@ -38,9 +38,15 @@ while i <= line("$") " scanning all lines
let colors = substitute(s, '"\s*\d\+\s\+\d\+\s\+\(\d\+\).*"', '\1', '')
" get the 4th value: cpp = number of character per pixel
let cpp = substitute(s, '"\s*\d\+\s\+\d\+\s\+\d\+\s\+\(\d\+\).*"', '\1', '')
+ if cpp =~ '[^0-9]'
+ break " if cpp is not made of digits there must be something wrong
+ endif
- " highlight the Values string as normal string (no pixel string)
- exe 'syn match xpmValues /'.s.'/'
+ " Highlight the Values string as normal string (no pixel string).
+ " Only when there is no slash, it would terminate the pattern.
+ if s !~ '/'
+ exe 'syn match xpmValues /' . s . '/'
+ endif
hi link xpmValues String
let n = 1 " n = color index
@@ -103,7 +109,7 @@ while i <= line("$") " scanning all lines
if color == "" || substitute(color, '.*', '\L&', '') == 'none'
exe 'hi xpmColor'.n.' guifg=bg'
exe 'hi xpmColor'.n.' guibg=NONE'
- else
+ elseif color !~ "'"
exe 'hi xpmColor'.n." guifg='".color."'"
exe 'hi xpmColor'.n." guibg='".color."'"
endif
diff --git a/runtime/tutor/README.el.cp737.txt b/runtime/tutor/README.el.cp737.txt
new file mode 100644
index 00000000..426f929c
--- /dev/null
+++ b/runtime/tutor/README.el.cp737.txt
@@ -0,0 +1,24 @@
+ Tutor 夘 "" 㚞 ⦬ 㩫
+ᡫ Vim.
+
+ 櫜 ⦠ 㩫 驦 櫜
+ 騘. ⢜ 夘 櫠 嫜 ᤜ
+嘪 ⤦ 餫 ᡫ Vim.
+
+ Tutor 夘 ⤘ ⮜ 㣘 .
+嫜 ⩜ "vim tutor" 㩜
+圪 㣘. 㣘 礜 㩜
+ , .
+
+ 穫 Unix 嫜 婞 㩜 暨 "vimtutor".
+ 㩜 高 ⤘ 殜 嚨 tutor.
+
+ 櫜 ਞ⤘ 㣘
+ 嫞 椦. 驫 ⢘ 墜
+ 㧦 驜 ᤜ.
+
+Bob Ware, Colorado School of Mines, Golden, Co 80401, USA
+(303) 273-3987
+bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet
+
+[ 㟞 Vim Bram Moolenaar]
diff --git a/runtime/tutor/README.el.txt b/runtime/tutor/README.el.txt
new file mode 100644
index 00000000..b2f5e074
--- /dev/null
+++ b/runtime/tutor/README.el.txt
@@ -0,0 +1,24 @@
+ Tutor ""
+ Vim.
+
+
+ .
+ Vim.
+
+ Tutor .
+ "vim tutor"
+ .
+ , .
+
+ Unix "vimtutor".
+ tutor.
+
+
+ .
+ .
+
+Bob Ware, Colorado School of Mines, Golden, Co 80401, USA
+(303) 273-3987
+bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet
+
+[ Vim Bram Moolenaar]
diff --git a/runtime/tutor/README.txt.info b/runtime/tutor/README.txt.info
index 238b11fa..e7fa1149 100755
--- a/runtime/tutor/README.txt.info
+++ b/runtime/tutor/README.txt.info
Binary files differ
diff --git a/runtime/tutor/README_amibin.txt b/runtime/tutor/README_amibin.txt
new file mode 100644
index 00000000..24b9ef2e
--- /dev/null
+++ b/runtime/tutor/README_amibin.txt
@@ -0,0 +1,12 @@
+README_amibin.txt for version 7.2a of Vim: Vi IMproved.
+
+See "README.txt" for general information about Vim.
+See "README_ami.txt" for installation instructions for the Amiga.
+These files are in the runtime archive (vim60rt.tgz).
+
+
+The Amiga "bin" archive contains the Vim executable for the Amiga. It was
+compiled with "big" features.
+
+Postscript printing is not included to avoid requiring floating point
+computations.
diff --git a/runtime/tutor/README_extra.txt b/runtime/tutor/README_extra.txt
new file mode 100644
index 00000000..660b502d
--- /dev/null
+++ b/runtime/tutor/README_extra.txt
@@ -0,0 +1,61 @@
+README_extra.txt for version 7.2a of Vim: Vi IMproved.
+
+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.
+
+For more information, see the "README.txt" file that comes with the runtime
+archive (vim-7.0-rt.tar.gz). To be able to run Vim you MUST get the runtime
+archive too!
+
+The extra archive plus the source and runtime achives make up the complete
+sources of Vim for all systems.
+
+
+Some of the things that the extra archive contains:
+
+Farsi Files for the Farsi (persian) language. If you don't know
+ what Farsi is, this is not for you.
+
+if_sniff Interface to SNiFF. If you don't know what SNiFF is, this is
+ not for you.
+
+os_amiga Files for the Amiga port.
+
+gui_riscos
+os_riscos Files for the RISC OS port.
+
+gui_beos
+os_beos Files for the BeOS port.
+
+os_msdos
+os_dos Files for the MS-DOS port.
+
+gui_mac
+os_mac Files for the Mac port.
+
+os_mint Files for the Atari Mint port.
+
+os_os2 Files for the OS/2 port.
+tee Extra program for OS/2.
+
+os_vms Files for the VMS port.
+
+os_w32
+os_win32 Files for the Win32 port.
+
+gui_w32 Files for the Win32 GUI.
+gui_w48 Files for the Win32 and Win16 GUI.
+Make_mvc.mak MS Visual C++ makefile for the Win32 GUI.
+rgb.txt File with color definitions for the Win32 GUI.
+
+if_ole OLE automation interface, for MS Windows 95 and NT.
+
+VisVim Integration of Win32 GUI with MS Visual Developer Studio.
+
+GvimExt DLL for the "Edit with Vim" context menu entry
+
+nsis NSIS script to build the self-installing MS-Windows exe
+
+*.man Preprocessed manual pages.
+
+file_select.vim Vim script to browse directories (Unix only).
diff --git a/runtime/tutor/README_ole.txt b/runtime/tutor/README_ole.txt
new file mode 100644
index 00000000..8112136c
--- /dev/null
+++ b/runtime/tutor/README_ole.txt
@@ -0,0 +1,20 @@
+README_ole.txt for version 7.2a of Vim: Vi IMproved.
+
+This archive contains gvim.exe with OLE interface and VisVim.
+This version of gvim.exe can also load a number of interface dynamically (you
+can optionally install the .dll files for each interface).
+It is only for MS-Windows 95/98/ME/NT/2000/XP.
+
+Also see the README_bindos.txt, README_dos.txt and README.txt files.
+
+Be careful not to overwrite the OLE gvim.exe with the non-OLE gvim.exe when
+unpacking another binary archive! Check the output of ":version":
+ Win32s - "MS-Windows 16/32 bit GUI version"
+ Win32 - "MS-Windows 32 bit GUI version"
+Win32 with OLE - "MS-Windows 32 bit GUI version with OLE support"
+
+For further information, type this inside Vim:
+ :help if_ole
+
+Futhermore, this archive contains VISVIM.DLL. It can be used to integrate
+the OLE gvim with Microsoft Visual Developer Studio. See VisVim/README.txt.
diff --git a/runtime/tutor/runtime/doc.info b/runtime/tutor/runtime/doc.info
new file mode 100755
index 00000000..a836031e
--- /dev/null
+++ b/runtime/tutor/runtime/doc.info
Binary files differ
diff --git a/runtime/tutor/runtime/ftplugin.vim b/runtime/tutor/runtime/ftplugin.vim
new file mode 100644
index 00000000..a434b937
--- /dev/null
+++ b/runtime/tutor/runtime/ftplugin.vim
@@ -0,0 +1,35 @@
+" Vim support file to switch on loading plugins for file types
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last change: 2006 Apr 30
+
+if exists("did_load_ftplugin")
+ finish
+endif
+let did_load_ftplugin = 1
+
+augroup filetypeplugin
+ au FileType * call s:LoadFTPlugin()
+
+ func! s:LoadFTPlugin()
+ if exists("b:undo_ftplugin")
+ exe b:undo_ftplugin
+ unlet! b:undo_ftplugin b:did_ftplugin
+ endif
+
+ let s = expand("<amatch>")
+ if s != ""
+ if &cpo =~# "S" && exists("b:did_ftplugin")
+ " In compatible mode options are reset to the global values, need to
+ " set the local values also when a plugin was already used.
+ unlet b:did_ftplugin
+ endif
+
+ " When there is a dot it is used to separate filetype names. Thus for
+ " "aaa.bbb" load "aaa" and then "bbb".
+ for name in split(s, '\.')
+ exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
+ endfor
+ endif
+ endfunc
+augroup END
diff --git a/runtime/tutor/runtime/ftplugof.vim b/runtime/tutor/runtime/ftplugof.vim
new file mode 100644
index 00000000..cd99ce05
--- /dev/null
+++ b/runtime/tutor/runtime/ftplugof.vim
@@ -0,0 +1,11 @@
+" Vim support file to switch off loading plugins for file types
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2002 Apr 04
+
+if exists("did_load_ftplugin")
+ unlet did_load_ftplugin
+endif
+
+" Remove all autocommands in the filetypeplugin group
+silent! au! filetypeplugin *
diff --git a/runtime/tutor/runtime/hi16-action-make.png b/runtime/tutor/runtime/hi16-action-make.png
new file mode 100644
index 00000000..824c7580
--- /dev/null
+++ b/runtime/tutor/runtime/hi16-action-make.png
Binary files differ
diff --git a/runtime/tutor/runtime/menu.vim b/runtime/tutor/runtime/menu.vim
new file mode 100644
index 00000000..d120ce29
--- /dev/null
+++ b/runtime/tutor/runtime/menu.vim
@@ -0,0 +1,1105 @@
+" Vim support file to define the default menus
+" You can also use this as a start for your own set of menus.
+"
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2008 Jun 16
+
+" Note that ":an" (short for ":anoremenu") is often used to make a menu work
+" in all modes and avoid side effects from mappings defined by the user.
+
+" Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise
+" <CR> would not be recognized. See ":help 'cpoptions'".
+let s:cpo_save = &cpo
+set cpo&vim
+
+" Avoid installing the menus twice
+if !exists("did_install_default_menus")
+let did_install_default_menus = 1
+
+
+if exists("v:lang") || &langmenu != ""
+ " Try to find a menu translation file for the current language.
+ if &langmenu != ""
+ if &langmenu =~ "none"
+ let s:lang = ""
+ else
+ let s:lang = &langmenu
+ endif
+ else
+ let s:lang = v:lang
+ endif
+ " A language name must be at least two characters, don't accept "C"
+ if strlen(s:lang) > 1
+ " When the language does not include the charset add 'encoding'
+ if s:lang =~ '^\a\a$\|^\a\a_\a\a$'
+ let s:lang = s:lang . '.' . &enc
+ endif
+
+ " We always use a lowercase name.
+ " Change "iso-8859" to "iso_8859" and "iso8859" to "iso_8859", some
+ " systems appear to use this.
+ " Change spaces to underscores.
+ let s:lang = substitute(tolower(s:lang), '\.iso-', ".iso_", "")
+ let s:lang = substitute(s:lang, '\.iso8859', ".iso_8859", "")
+ let s:lang = substitute(s:lang, " ", "_", "g")
+ " Remove "@euro", otherwise "LC_ALL=de_DE@euro gvim" will show English menus
+ let s:lang = substitute(s:lang, "@euro", "", "")
+ " Change "iso_8859-1" and "iso_8859-15" to "latin1", we always use the
+ " same menu file for them.
+ let s:lang = substitute(s:lang, 'iso_8859-15\=$', "latin1", "")
+ menutrans clear
+ exe "runtime! lang/menu_" . s:lang . ".vim"
+
+ if !exists("did_menu_trans")
+ " There is no exact match, try matching with a wildcard added
+ " (e.g. find menu_de_de.iso_8859-1.vim if s:lang == de_DE).
+ let s:lang = substitute(s:lang, '\.[^.]*', "", "")
+ exe "runtime! lang/menu_" . s:lang . "[^a-z]*vim"
+
+ if !exists("did_menu_trans") && strlen($LANG) > 1 && s:lang !~ '^en_us'
+ " On windows locale names are complicated, try using $LANG, it might
+ " have been set by set_init_1(). But don't do this for "en" or "en_us".
+ " But don't match "slovak" when $LANG is "sl".
+ exe "runtime! lang/menu_" . tolower($LANG) . "[^a-z]*vim"
+ endif
+ endif
+ endif
+endif
+
+
+" Help menu
+an 9999.10 &Help.&Overview<Tab><F1> :help<CR>
+an 9999.20 &Help.&User\ Manual :help usr_toc<CR>
+an 9999.30 &Help.&How-to\ links :help how-to<CR>
+an <silent> 9999.40 &Help.&Find\.\.\. :call <SID>Helpfind()<CR>
+an 9999.45 &Help.-sep1- <Nop>
+an 9999.50 &Help.&Credits :help credits<CR>
+an 9999.60 &Help.Co&pying :help copying<CR>
+an 9999.70 &Help.&Sponsor/Register :help sponsor<CR>
+an 9999.70 &Help.O&rphans :help kcc<CR>
+an 9999.75 &Help.-sep2- <Nop>
+an 9999.80 &Help.&Version :version<CR>
+an 9999.90 &Help.&About :intro<CR>
+
+fun! s:Helpfind()
+ if !exists("g:menutrans_help_dialog")
+ let g:menutrans_help_dialog = "Enter a command or word to find help on:\n\nPrepend i_ for Input mode commands (e.g.: i_CTRL-X)\nPrepend c_ for command-line editing commands (e.g.: c_<Del>)\nPrepend ' for an option name (e.g.: 'shiftwidth')"
+ endif
+ let h = inputdialog(g:menutrans_help_dialog)
+ if h != ""
+ let v:errmsg = ""
+ silent! exe "help " . h
+ if v:errmsg != ""
+ echo v:errmsg
+ endif
+ endif
+endfun
+
+" File menu
+an 10.310 &File.&Open\.\.\.<Tab>:e :browse confirm e<CR>
+an 10.320 &File.Sp&lit-Open\.\.\.<Tab>:sp :browse sp<CR>
+an 10.320 &File.Open\ Tab\.\.\.<Tab>:tabnew :browse tabnew<CR>
+an 10.325 &File.&New<Tab>:enew :confirm enew<CR>
+an <silent> 10.330 &File.&Close<Tab>:close
+ \ :if winheight(2) < 0 <Bar>
+ \ confirm enew <Bar>
+ \ else <Bar>
+ \ confirm close <Bar>
+ \ endif<CR>
+an 10.335 &File.-SEP1- <Nop>
+an <silent> 10.340 &File.&Save<Tab>:w :if expand("%") == ""<Bar>browse confirm w<Bar>else<Bar>confirm w<Bar>endif<CR>
+an 10.350 &File.Save\ &As\.\.\.<Tab>:sav :browse confirm saveas<CR>
+
+if has("diff")
+ an 10.400 &File.-SEP2- <Nop>
+ an 10.410 &File.Split\ &Diff\ with\.\.\. :browse vert diffsplit<CR>
+ an 10.420 &File.Split\ Patched\ &By\.\.\. :browse vert diffpatch<CR>
+endif
+
+if has("printer")
+ an 10.500 &File.-SEP3- <Nop>
+ an 10.510 &File.&Print :hardcopy<CR>
+ vunmenu &File.&Print
+ vnoremenu &File.&Print :hardcopy<CR>
+elseif has("unix")
+ an 10.500 &File.-SEP3- <Nop>
+ an 10.510 &File.&Print :w !lpr<CR>
+ vunmenu &File.&Print
+ vnoremenu &File.&Print :w !lpr<CR>
+endif
+an 10.600 &File.-SEP4- <Nop>
+an 10.610 &File.Sa&ve-Exit<Tab>:wqa :confirm wqa<CR>
+an 10.620 &File.E&xit<Tab>:qa :confirm qa<CR>
+
+func! <SID>SelectAll()
+ exe "norm gg" . (&slm == "" ? "VG" : "gH\<C-O>G")
+endfunc
+
+func! s:FnameEscape(fname)
+ if exists('*fnameescape')
+ return fnameescape(a:fname)
+ return escape(a:fname, " \t\n*?[{`$\\%#'\"|!<")
+endfunc
+
+" Edit menu
+an 20.310 &Edit.&Undo<Tab>u u
+an 20.320 &Edit.&Redo<Tab>^R <C-R>
+an 20.330 &Edit.Rep&eat<Tab>\. .
+
+an 20.335 &Edit.-SEP1- <Nop>
+vnoremenu 20.340 &Edit.Cu&t<Tab>"+x "+x
+vnoremenu 20.350 &Edit.&Copy<Tab>"+y "+y
+cnoremenu 20.350 &Edit.&Copy<Tab>"+y <C-Y>
+nnoremenu 20.360 &Edit.&Paste<Tab>"+gP "+gP
+cnoremenu &Edit.&Paste<Tab>"+gP <C-R>+
+exe 'vnoremenu <script> &Edit.&Paste<Tab>"+gP ' . paste#paste_cmd['v']
+exe 'inoremenu <script> &Edit.&Paste<Tab>"+gP ' . paste#paste_cmd['i']
+nnoremenu 20.370 &Edit.Put\ &Before<Tab>[p [p
+inoremenu &Edit.Put\ &Before<Tab>[p <C-O>[p
+nnoremenu 20.380 &Edit.Put\ &After<Tab>]p ]p
+inoremenu &Edit.Put\ &After<Tab>]p <C-O>]p
+if has("win32") || has("win16")
+ vnoremenu 20.390 &Edit.&Delete<Tab>x x
+endif
+noremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG :<C-U>call <SID>SelectAll()<CR>
+inoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-O>:call <SID>SelectAll()<CR>
+cnoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-U>call <SID>SelectAll()<CR>
+
+an 20.405 &Edit.-SEP2- <Nop>
+if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif")
+ an 20.410 &Edit.&Find\.\.\. :promptfind<CR>
+ vunmenu &Edit.&Find\.\.\.
+ vnoremenu <silent> &Edit.&Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR>
+ an 20.420 &Edit.Find\ and\ Rep&lace\.\.\. :promptrepl<CR>
+ vunmenu &Edit.Find\ and\ Rep&lace\.\.\.
+ vnoremenu <silent> &Edit.Find\ and\ Rep&lace\.\.\. y:promptrepl <C-R>=<SID>FixFText()<CR><CR>
+else
+ an 20.410 &Edit.&Find<Tab>/ /
+ an 20.420 &Edit.Find\ and\ Rep&lace<Tab>:%s :%s/
+ vunmenu &Edit.Find\ and\ Rep&lace<Tab>:%s
+ vnoremenu &Edit.Find\ and\ Rep&lace<Tab>:s :s/
+endif
+
+an 20.425 &Edit.-SEP3- <Nop>
+an 20.430 &Edit.Settings\ &Window :options<CR>
+an 20.435 &Edit.Startup\ &Settings :call <SID>EditVimrc()<CR>
+
+fun! s:EditVimrc()
+ if $MYVIMRC != ''
+ let fname = "$MYVIMRC"
+ elseif has("win32") || has("dos32") || has("dos16") || has("os2")
+ if $HOME != ''
+ let fname = "$HOME/_vimrc"
+ else
+ let fname = "$VIM/_vimrc"
+ endif
+ elseif has("amiga")
+ let fname = "s:.vimrc"
+ else
+ let fname = "$HOME/.vimrc"
+ endif
+ let fname = s:FnameEscape(fname)
+ if &mod
+ exe "split " . fname
+ else
+ exe "edit " . fname
+ endif
+endfun
+
+fun! s:FixFText()
+ " Fix text in nameless register to be used with :promptfind.
+ return substitute(@", "[\r\n]", '\\n', 'g')
+endfun
+
+" Edit/Global Settings
+an 20.440.100 &Edit.&Global\ Settings.Toggle\ Pattern\ &Highlight<Tab>:set\ hls! :set hls! hls?<CR>
+an 20.440.110 &Edit.&Global\ Settings.Toggle\ &Ignore-case<Tab>:set\ ic! :set ic! ic?<CR>
+an 20.440.110 &Edit.&Global\ Settings.Toggle\ &Showmatch<Tab>:set\ sm! :set sm! sm?<CR>
+
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 1\ :set so=1<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 2\ :set so=2<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 3\ :set so=3<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 4\ :set so=4<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 5\ :set so=5<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 7\ :set so=7<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 10\ :set so=10<CR>
+an 20.440.120 &Edit.&Global\ Settings.&Context\ lines.\ 100\ :set so=100<CR>
+
+an 20.440.130.40 &Edit.&Global\ Settings.&Virtual\ Edit.Never :set ve=<CR>
+an 20.440.130.50 &Edit.&Global\ Settings.&Virtual\ Edit.Block\ Selection :set ve=block<CR>
+an 20.440.130.60 &Edit.&Global\ Settings.&Virtual\ Edit.Insert\ mode :set ve=insert<CR>
+an 20.440.130.70 &Edit.&Global\ Settings.&Virtual\ Edit.Block\ and\ Insert :set ve=block,insert<CR>
+an 20.440.130.80 &Edit.&Global\ Settings.&Virtual\ Edit.Always :set ve=all<CR>
+an 20.440.140 &Edit.&Global\ Settings.Toggle\ Insert\ &Mode<Tab>:set\ im! :set im!<CR>
+an 20.440.145 &Edit.&Global\ Settings.Toggle\ Vi\ C&ompatible<Tab>:set\ cp! :set cp!<CR>
+an <silent> 20.440.150 &Edit.&Global\ Settings.Search\ &Path\.\.\. :call <SID>SearchP()<CR>
+an <silent> 20.440.160 &Edit.&Global\ Settings.Ta&g\ Files\.\.\. :call <SID>TagFiles()<CR>
+"
+" GUI options
+an 20.440.300 &Edit.&Global\ Settings.-SEP1- <Nop>
+an <silent> 20.440.310 &Edit.&Global\ Settings.Toggle\ &Toolbar :call <SID>ToggleGuiOption("T")<CR>
+an <silent> 20.440.320 &Edit.&Global\ Settings.Toggle\ &Bottom\ Scrollbar :call <SID>ToggleGuiOption("b")<CR>
+an <silent> 20.440.330 &Edit.&Global\ Settings.Toggle\ &Left\ Scrollbar :call <SID>ToggleGuiOption("l")<CR>
+an <silent> 20.440.340 &Edit.&Global\ Settings.Toggle\ &Right\ Scrollbar :call <SID>ToggleGuiOption("r")<CR>
+
+fun! s:SearchP()
+ if !exists("g:menutrans_path_dialog")
+ let g:menutrans_path_dialog = "Enter search path for files.\nSeparate directory names with a comma."
+ endif
+ let n = inputdialog(g:menutrans_path_dialog, substitute(&path, '\\ ', ' ', 'g'))
+ if n != ""
+ let &path = substitute(n, ' ', '\\ ', 'g')
+ endif
+endfun
+
+fun! s:TagFiles()
+ if !exists("g:menutrans_tags_dialog")
+ let g:menutrans_tags_dialog = "Enter names of tag files.\nSeparate the names with a comma."
+ endif
+ let n = inputdialog(g:menutrans_tags_dialog, substitute(&tags, '\\ ', ' ', 'g'))
+ if n != ""
+ let &tags = substitute(n, ' ', '\\ ', 'g')
+ endif
+endfun
+
+fun! s:ToggleGuiOption(option)
+ " If a:option is already set in guioptions, then we want to remove it
+ if match(&guioptions, "\\C" . a:option) > -1
+ exec "set go-=" . a:option
+ else
+ exec "set go+=" . a:option
+ endif
+endfun
+
+" Edit/File Settings
+
+" Boolean options
+an 20.440.100 &Edit.F&ile\ Settings.Toggle\ Line\ &Numbering<Tab>:set\ nu! :set nu! nu?<CR>
+an 20.440.110 &Edit.F&ile\ Settings.Toggle\ &List\ Mode<Tab>:set\ list! :set list! list?<CR>
+an 20.440.120 &Edit.F&ile\ Settings.Toggle\ Line\ &Wrap<Tab>:set\ wrap! :set wrap! wrap?<CR>
+an 20.440.130 &Edit.F&ile\ Settings.Toggle\ W&rap\ at\ word<Tab>:set\ lbr! :set lbr! lbr?<CR>
+an 20.440.160 &Edit.F&ile\ Settings.Toggle\ &expand-tab<Tab>:set\ et! :set et! et?<CR>
+an 20.440.170 &Edit.F&ile\ Settings.Toggle\ &auto-indent<Tab>:set\ ai! :set ai! ai?<CR>
+an 20.440.180 &Edit.F&ile\ Settings.Toggle\ &C-indenting<Tab>:set\ cin! :set cin! cin?<CR>
+
+" other options
+an 20.440.600 &Edit.F&ile\ Settings.-SEP2- <Nop>
+an 20.440.610.20 &Edit.F&ile\ Settings.&Shiftwidth.2 :set sw=2 sw?<CR>
+an 20.440.610.30 &Edit.F&ile\ Settings.&Shiftwidth.3 :set sw=3 sw?<CR>
+an 20.440.610.40 &Edit.F&ile\ Settings.&Shiftwidth.4 :set sw=4 sw?<CR>
+an 20.440.610.50 &Edit.F&ile\ Settings.&Shiftwidth.5 :set sw=5 sw?<CR>
+an 20.440.610.60 &Edit.F&ile\ Settings.&Shiftwidth.6 :set sw=6 sw?<CR>
+an 20.440.610.80 &Edit.F&ile\ Settings.&Shiftwidth.8 :set sw=8 sw?<CR>
+
+an 20.440.620.20 &Edit.F&ile\ Settings.Soft\ &Tabstop.2 :set sts=2 sts?<CR>
+an 20.440.620.30 &Edit.F&ile\ Settings.Soft\ &Tabstop.3 :set sts=3 sts?<CR>
+an 20.440.620.40 &Edit.F&ile\ Settings.Soft\ &Tabstop.4 :set sts=4 sts?<CR>
+an 20.440.620.50 &Edit.F&ile\ Settings.Soft\ &Tabstop.5 :set sts=5 sts?<CR>
+an 20.440.620.60 &Edit.F&ile\ Settings.Soft\ &Tabstop.6 :set sts=6 sts?<CR>
+an 20.440.620.80 &Edit.F&ile\ Settings.Soft\ &Tabstop.8 :set sts=8 sts?<CR>
+
+an <silent> 20.440.630 &Edit.F&ile\ Settings.Te&xt\ Width\.\.\. :call <SID>TextWidth()<CR>
+an <silent> 20.440.640 &Edit.F&ile\ Settings.&File\ Format\.\.\. :call <SID>FileFormat()<CR>
+fun! s:TextWidth()
+ if !exists("g:menutrans_textwidth_dialog")
+ let g:menutrans_textwidth_dialog = "Enter new text width (0 to disable formatting): "
+ endif
+ let n = inputdialog(g:menutrans_textwidth_dialog, &tw)
+ if n != ""
+ " remove leading zeros to avoid it being used as an octal number
+ let &tw = substitute(n, "^0*", "", "")
+ endif
+endfun
+
+fun! s:FileFormat()
+ if !exists("g:menutrans_fileformat_dialog")
+ let g:menutrans_fileformat_dialog = "Select format for writing the file"
+ endif
+ if !exists("g:menutrans_fileformat_choices")
+ let g:menutrans_fileformat_choices = "&Unix\n&Dos\n&Mac\n&Cancel"
+ endif
+ if &ff == "dos"
+ let def = 2
+ elseif &ff == "mac"
+ let def = 3
+ else
+ let def = 1
+ endif
+ let n = confirm(g:menutrans_fileformat_dialog, g:menutrans_fileformat_choices, def, "Question")
+ if n == 1
+ set ff=unix
+ elseif n == 2
+ set ff=dos
+ elseif n == 3
+ set ff=mac
+ endif
+endfun
+
+" Setup the Edit.Color Scheme submenu
+let s:n = globpath(&runtimepath, "colors/*.vim")
+let s:idx = 100
+while strlen(s:n) > 0
+ let s:i = stridx(s:n, "\n")
+ if s:i < 0
+ let s:name = s:n
+ let s:n = ""
+ else
+ let s:name = strpart(s:n, 0, s:i)
+ let s:n = strpart(s:n, s:i + 1, 19999)
+ endif
+ " Ignore case for VMS and windows
+ let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:]*\)\.vim', '\1', '')
+ exe "an 20.450." . s:idx . ' &Edit.C&olor\ Scheme.' . s:name . " :colors " . s:name . "<CR>"
+ unlet s:name
+ unlet s:i
+ let s:idx = s:idx + 10
+endwhile
+unlet s:n
+unlet s:idx
+
+" Setup the Edit.Keymap submenu
+if has("keymap")
+ let s:n = globpath(&runtimepath, "keymap/*.vim")
+ if s:n != ""
+ let s:idx = 100
+ an 20.460.90 &Edit.&Keymap.None :set keymap=<CR>
+ while strlen(s:n) > 0
+ let s:i = stridx(s:n, "\n")
+ if s:i < 0
+ let s:name = s:n
+ let s:n = ""
+ else
+ let s:name = strpart(s:n, 0, s:i)
+ let s:n = strpart(s:n, s:i + 1, 19999)
+ endif
+ " Ignore case for VMS and windows
+ let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
+ exe "an 20.460." . s:idx . ' &Edit.&Keymap.' . s:name . " :set keymap=" . s:name . "<CR>"
+ unlet s:name
+ unlet s:i
+ let s:idx = s:idx + 10
+ endwhile
+ unlet s:idx
+ endif
+ unlet s:n
+endif
+if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac")
+ an 20.470 &Edit.Select\ Fo&nt\.\.\. :set guifont=*<CR>
+endif
+
+" Programming menu
+if !exists("g:ctags_command")
+ if has("vms")
+ let g:ctags_command = "mc vim:ctags *.*"
+ else
+ let g:ctags_command = "ctags -R ."
+ endif
+endif
+
+an 40.300 &Tools.&Jump\ to\ this\ tag<Tab>g^] g<C-]>
+vunmenu &Tools.&Jump\ to\ this\ tag<Tab>g^]
+vnoremenu &Tools.&Jump\ to\ this\ tag<Tab>g^] g<C-]>
+an 40.310 &Tools.Jump\ &back<Tab>^T <C-T>
+an 40.320 &Tools.Build\ &Tags\ File :exe "!" . g:ctags_command<CR>
+
+if has("folding") || has("spell")
+ an 40.330 &Tools.-SEP1- <Nop>
+endif
+
+" Tools.Spelling Menu
+if has("spell")
+ an 40.335.110 &Tools.&Spelling.&Spell\ Check\ On :set spell<CR>
+ an 40.335.120 &Tools.&Spelling.Spell\ Check\ &Off :set nospell<CR>
+ an 40.335.130 &Tools.&Spelling.To\ &Next\ error<Tab>]s ]s
+ an 40.335.130 &Tools.&Spelling.To\ &Previous\ error<Tab>[s [s
+ an 40.335.140 &Tools.&Spelling.Suggest\ &Corrections<Tab>z= z=
+ an 40.335.150 &Tools.&Spelling.&Repeat\ correction<Tab>:spellrepall :spellrepall<CR>
+ an 40.335.200 &Tools.&Spelling.-SEP1- <Nop>
+ an 40.335.210 &Tools.&Spelling.Set\ language\ to\ "en" :set spl=en spell<CR>
+ an 40.335.220 &Tools.&Spelling.Set\ language\ to\ "en_au" :set spl=en_au spell<CR>
+ an 40.335.230 &Tools.&Spelling.Set\ language\ to\ "en_ca" :set spl=en_ca spell<CR>
+ an 40.335.240 &Tools.&Spelling.Set\ language\ to\ "en_gb" :set spl=en_gb spell<CR>
+ an 40.335.250 &Tools.&Spelling.Set\ language\ to\ "en_nz" :set spl=en_nz spell<CR>
+ an 40.335.260 &Tools.&Spelling.Set\ language\ to\ "en_us" :set spl=en_us spell<CR>
+ an <silent> 40.335.270 &Tools.&Spelling.&Find\ More\ Languages :call <SID>SpellLang()<CR>
+
+ let s:undo_spellang = ['aun &Tools.&Spelling.&Find\ More\ Languages']
+ func! s:SpellLang()
+ for cmd in s:undo_spellang
+ exe "silent! " . cmd
+ endfor
+ let s:undo_spellang = []
+
+ if &enc == "iso-8859-15"
+ let enc = "latin1"
+ else
+ let enc = &enc
+ endif
+
+ let found = 0
+ let s = globpath(&rtp, "spell/*." . enc . ".spl")
+ if s != ""
+ let n = 300
+ for f in split(s, "\n")
+ let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "")
+ if nm != "en" && nm !~ '/'
+ let found += 1
+ let menuname = '&Tools.&Spelling.Set\ language\ to\ "' . nm . '"'
+ exe 'an 40.335.' . n . ' ' . menuname . ' :set spl=' . nm . ' spell<CR>'
+ let s:undo_spellang += ['aun ' . menuname]
+ endif
+ let n += 10
+ endfor
+ endif
+ if found == 0
+ echomsg "Could not find other spell files"
+ elseif found == 1
+ echomsg "Found spell file " . nm
+ else
+ echomsg "Found " . found . " more spell files"
+ endif
+ " Need to redo this when 'encoding' is changed.
+ augroup spellmenu
+ au! EncodingChanged * call <SID>SpellLang()
+ augroup END
+ endfun
+
+endif
+
+" Tools.Fold Menu
+if has("folding")
+ " open close folds
+ an 40.340.110 &Tools.&Folding.&Enable/Disable\ folds<Tab>zi zi
+ an 40.340.120 &Tools.&Folding.&View\ Cursor\ Line<Tab>zv zv
+ an 40.340.120 &Tools.&Folding.Vie&w\ Cursor\ Line\ only<Tab>zMzx zMzx
+ an 40.340.130 &Tools.&Folding.C&lose\ more\ folds<Tab>zm zm
+ an 40.340.140 &Tools.&Folding.&Close\ all\ folds<Tab>zM zM
+ an 40.340.150 &Tools.&Folding.O&pen\ more\ folds<Tab>zr zr
+ an 40.340.160 &Tools.&Folding.&Open\ all\ folds<Tab>zR zR
+ " fold method
+ an 40.340.200 &Tools.&Folding.-SEP1- <Nop>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.M&anual :set fdm=manual<CR>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.I&ndent :set fdm=indent<CR>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.E&xpression :set fdm=expr<CR>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.S&yntax :set fdm=syntax<CR>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.&Diff :set fdm=diff<CR>
+ an 40.340.210 &Tools.&Folding.Fold\ Met&hod.Ma&rker :set fdm=marker<CR>
+ " create and delete folds
+ vnoremenu 40.340.220 &Tools.&Folding.Create\ &Fold<Tab>zf zf
+ an 40.340.230 &Tools.&Folding.&Delete\ Fold<Tab>zd zd
+ an 40.340.240 &Tools.&Folding.Delete\ &All\ Folds<Tab>zD zD
+ " moving around in folds
+ an 40.340.300 &Tools.&Folding.-SEP2- <Nop>
+ an 40.340.310.10 &Tools.&Folding.Fold\ col&umn\ width.\ &0\ :set fdc=0<CR>
+ an 40.340.310.20 &Tools.&Folding.Fold\ col&umn\ width.\ &2\ :set fdc=2<CR>
+ an 40.340.310.30 &Tools.&Folding.Fold\ col&umn\ width.\ &3\ :set fdc=3<CR>
+ an 40.340.310.40 &Tools.&Folding.Fold\ col&umn\ width.\ &4\ :set fdc=4<CR>
+ an 40.340.310.50 &Tools.&Folding.Fold\ col&umn\ width.\ &5\ :set fdc=5<CR>
+ an 40.340.310.60 &Tools.&Folding.Fold\ col&umn\ width.\ &6\ :set fdc=6<CR>
+ an 40.340.310.70 &Tools.&Folding.Fold\ col&umn\ width.\ &7\ :set fdc=7<CR>
+ an 40.340.310.80 &Tools.&Folding.Fold\ col&umn\ width.\ &8\ :set fdc=8<CR>
+endif " has folding
+
+if has("diff")
+ an 40.350.100 &Tools.&Diff.&Update :diffupdate<CR>
+ an 40.350.110 &Tools.&Diff.&Get\ Block :diffget<CR>
+ vunmenu &Tools.&Diff.&Get\ Block
+ vnoremenu &Tools.&Diff.&Get\ Block :diffget<CR>
+ an 40.350.120 &Tools.&Diff.&Put\ Block :diffput<CR>
+ vunmenu &Tools.&Diff.&Put\ Block
+ vnoremenu &Tools.&Diff.&Put\ Block :diffput<CR>
+endif
+
+an 40.358 &Tools.-SEP2- <Nop>
+an 40.360 &Tools.&Make<Tab>:make :make<CR>
+an 40.370 &Tools.&List\ Errors<Tab>:cl :cl<CR>
+an 40.380 &Tools.L&ist\ Messages<Tab>:cl! :cl!<CR>
+an 40.390 &Tools.&Next\ Error<Tab>:cn :cn<CR>
+an 40.400 &Tools.&Previous\ Error<Tab>:cp :cp<CR>
+an 40.410 &Tools.&Older\ List<Tab>:cold :colder<CR>
+an 40.420 &Tools.N&ewer\ List<Tab>:cnew :cnewer<CR>
+an 40.430.50 &Tools.Error\ &Window.&Update<Tab>:cwin :cwin<CR>
+an 40.430.60 &Tools.Error\ &Window.&Open<Tab>:copen :copen<CR>
+an 40.430.70 &Tools.Error\ &Window.&Close<Tab>:cclose :cclose<CR>
+
+an 40.520 &Tools.-SEP3- <Nop>
+an <silent> 40.530 &Tools.&Convert\ to\ HEX<Tab>:%!xxd
+ \ :call <SID>XxdConv()<CR>
+an <silent> 40.540 &Tools.Conve&rt\ back<Tab>:%!xxd\ -r
+ \ :call <SID>XxdBack()<CR>
+
+" Use a function to do the conversion, so that it also works with 'insertmode'
+" set.
+func! s:XxdConv()
+ let mod = &mod
+ if has("vms")
+ %!mc vim:xxd
+ else
+ call s:XxdFind()
+ exe '%!"' . g:xxdprogram . '"'
+ endif
+ if getline(1) =~ "^0000000:" " only if it worked
+ set ft=xxd
+ endif
+ let &mod = mod
+endfun
+
+func! s:XxdBack()
+ let mod = &mod
+ if has("vms")
+ %!mc vim:xxd -r
+ else
+ call s:XxdFind()
+ exe '%!"' . g:xxdprogram . '" -r'
+ endif
+ set ft=
+ doautocmd filetypedetect BufReadPost
+ let &mod = mod
+endfun
+
+func! s:XxdFind()
+ if !exists("g:xxdprogram")
+ " On the PC xxd may not be in the path but in the install directory
+ if (has("win32") || has("dos32")) && !executable("xxd")
+ let g:xxdprogram = $VIMRUNTIME . (&shellslash ? '/' : '\') . "xxd.exe"
+ else
+ let g:xxdprogram = "xxd"
+ endif
+ endif
+endfun
+
+" Setup the Tools.Compiler submenu
+let s:n = globpath(&runtimepath, "compiler/*.vim")
+let s:idx = 100
+while strlen(s:n) > 0
+ let s:i = stridx(s:n, "\n")
+ if s:i < 0
+ let s:name = s:n
+ let s:n = ""
+ else
+ let s:name = strpart(s:n, 0, s:i)
+ let s:n = strpart(s:n, s:i + 1, 19999)
+ endif
+ " Ignore case for VMS and windows
+ let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:]*\)\.vim', '\1', '')
+ exe "an 30.440." . s:idx . ' &Tools.Se&T\ Compiler.' . s:name . " :compiler " . s:name . "<CR>"
+ unlet s:name
+ unlet s:i
+ let s:idx = s:idx + 10
+endwhile
+unlet s:n
+unlet s:idx
+
+if !exists("no_buffers_menu")
+
+" Buffer list menu -- Setup functions & actions
+
+" wait with building the menu until after loading 'session' files. Makes
+" startup faster.
+let s:bmenu_wait = 1
+
+if !exists("bmenu_priority")
+ let bmenu_priority = 60
+endif
+
+func! s:BMAdd()
+ if s:bmenu_wait == 0
+ " when adding too many buffers, redraw in short format
+ if s:bmenu_count == &menuitems && s:bmenu_short == 0
+ call s:BMShow()
+ else
+ call <SID>BMFilename(expand("<afile>"), expand("<abuf>"))
+ let s:bmenu_count = s:bmenu_count + 1
+ endif
+ endif
+endfunc
+
+func! s:BMRemove()
+ if s:bmenu_wait == 0
+ let name = expand("<afile>")
+ if isdirectory(name)
+ return
+ endif
+ let munge = <SID>BMMunge(name, expand("<abuf>"))
+
+ if s:bmenu_short == 0
+ exe 'silent! aun &Buffers.' . munge
+ else
+ exe 'silent! aun &Buffers.' . <SID>BMHash2(munge) . munge
+ endif
+ let s:bmenu_count = s:bmenu_count - 1
+ endif
+endfunc
+
+" Create the buffer menu (delete an existing one first).
+func! s:BMShow(...)
+ let s:bmenu_wait = 1
+ let s:bmenu_short = 1
+ let s:bmenu_count = 0
+ "
+ " get new priority, if exists
+ if a:0 == 1
+ let g:bmenu_priority = a:1
+ endif
+
+ " remove old menu, if exists; keep one entry to avoid a torn off menu to
+ " disappear.
+ silent! unmenu &Buffers
+ exe 'noremenu ' . g:bmenu_priority . ".1 &Buffers.Dummy l"
+ silent! unmenu! &Buffers
+
+ " create new menu; set 'cpo' to include the <CR>
+ let cpo_save = &cpo
+ set cpo&vim
+ exe 'an <silent> ' . g:bmenu_priority . ".2 &Buffers.&Refresh\\ menu :call <SID>BMShow()<CR>"
+ exe 'an ' . g:bmenu_priority . ".4 &Buffers.&Delete :confirm bd<CR>"
+ exe 'an ' . g:bmenu_priority . ".6 &Buffers.&Alternate :confirm b #<CR>"
+ exe 'an ' . g:bmenu_priority . ".7 &Buffers.&Next :confirm bnext<CR>"
+ exe 'an ' . g:bmenu_priority . ".8 &Buffers.&Previous :confirm bprev<CR>"
+ exe 'an ' . g:bmenu_priority . ".9 &Buffers.-SEP- :"
+ let &cpo = cpo_save
+ unmenu &Buffers.Dummy
+
+ " figure out how many buffers there are
+ let buf = 1
+ while buf <= bufnr('$')
+ if bufexists(buf) && !isdirectory(bufname(buf)) && buflisted(buf)
+ let s:bmenu_count = s:bmenu_count + 1
+ endif
+ let buf = buf + 1
+ endwhile
+ if s:bmenu_count <= &menuitems
+ let s:bmenu_short = 0
+ endif
+
+ " iterate through buffer list, adding each buffer to the menu:
+ let buf = 1
+ while buf <= bufnr('$')
+ if bufexists(buf) && !isdirectory(bufname(buf)) && buflisted(buf)
+ call <SID>BMFilename(bufname(buf), buf)
+ endif
+ let buf = buf + 1
+ endwhile
+ let s:bmenu_wait = 0
+ aug buffer_list
+ au!
+ au BufCreate,BufFilePost * call <SID>BMAdd()
+ au BufDelete,BufFilePre * call <SID>BMRemove()
+ aug END
+endfunc
+
+func! s:BMHash(name)
+ " Make name all upper case, so that chars are between 32 and 96
+ let nm = substitute(a:name, ".*", '\U\0', "")
+ if has("ebcdic")
+ " HACK: Replace all non alphabetics with 'Z'
+ " Just to make it work for now.
+ let nm = substitute(nm, "[^A-Z]", 'Z', "g")
+ let sp = char2nr('A') - 1
+ else
+ let sp = char2nr(' ')
+ endif
+ " convert first six chars into a number for sorting:
+ return (char2nr(nm[0]) - sp) * 0x800000 + (char2nr(nm[1]) - sp) * 0x20000 + (char2nr(nm[2]) - sp) * 0x1000 + (char2nr(nm[3]) - sp) * 0x80 + (char2nr(nm[4]) - sp) * 0x20 + (char2nr(nm[5]) - sp)
+endfunc
+
+func! s:BMHash2(name)
+ let nm = substitute(a:name, ".", '\L\0', "")
+ " Not exactly right for EBCDIC...
+ if nm[0] < 'a' || nm[0] > 'z'
+ return '&others.'
+ elseif nm[0] <= 'd'
+ return '&abcd.'
+ elseif nm[0] <= 'h'
+ return '&efgh.'
+ elseif nm[0] <= 'l'
+ return '&ijkl.'
+ elseif nm[0] <= 'p'
+ return '&mnop.'
+ elseif nm[0] <= 't'
+ return '&qrst.'
+ else
+ return '&u-z.'
+ endif
+endfunc
+
+" insert a buffer name into the buffer menu:
+func! s:BMFilename(name, num)
+ if isdirectory(a:name)
+ return
+ endif
+ let munge = <SID>BMMunge(a:name, a:num)
+ let hash = <SID>BMHash(munge)
+ if s:bmenu_short == 0
+ let name = 'an ' . g:bmenu_priority . '.' . hash . ' &Buffers.' . munge
+ else
+ let name = 'an ' . g:bmenu_priority . '.' . hash . '.' . hash . ' &Buffers.' . <SID>BMHash2(munge) . munge
+ endif
+ " set 'cpo' to include the <CR>
+ let cpo_save = &cpo
+ set cpo&vim
+ exe name . ' :confirm b' . a:num . '<CR>'
+ let &cpo = cpo_save
+endfunc
+
+" Truncate a long path to fit it in a menu item.
+if !exists("g:bmenu_max_pathlen")
+ let g:bmenu_max_pathlen = 35
+endif
+func! s:BMTruncName(fname)
+ let name = a:fname
+ if g:bmenu_max_pathlen < 5
+ let name = ""
+ else
+ let len = strlen(name)
+ if len > g:bmenu_max_pathlen
+ let amountl = (g:bmenu_max_pathlen / 2) - 2
+ let amountr = g:bmenu_max_pathlen - amountl - 3
+ let pattern = '^\(.\{,' . amountl . '}\).\{-}\(.\{,' . amountr . '}\)$'
+ let left = substitute(name, pattern, '\1', '')
+ let right = substitute(name, pattern, '\2', '')
+ if strlen(left) + strlen(right) < len
+ let name = left . '...' . right
+ endif
+ endif
+ endif
+ return name
+endfunc
+
+func! s:BMMunge(fname, bnum)
+ let name = a:fname
+ if name == ''
+ if !exists("g:menutrans_no_file")
+ let g:menutrans_no_file = "[No file]"
+ endif
+ let name = g:menutrans_no_file
+ else
+ let name = fnamemodify(name, ':p:~')
+ endif
+ " detach file name and separate it out:
+ let name2 = fnamemodify(name, ':t')
+ if a:bnum >= 0
+ let name2 = name2 . ' (' . a:bnum . ')'
+ endif
+ let name = name2 . "\t" . <SID>BMTruncName(fnamemodify(name,':h'))
+ let name = escape(name, "\\. \t|")
+ let name = substitute(name, "&", "&&", "g")
+ let name = substitute(name, "\n", "^@", "g")
+ return name
+endfunc
+
+" When just starting Vim, load the buffer menu later
+if has("vim_starting")
+ augroup LoadBufferMenu
+ au! VimEnter * if !exists("no_buffers_menu") | call <SID>BMShow() | endif
+ au VimEnter * au! LoadBufferMenu
+ augroup END
+else
+ call <SID>BMShow()
+endif
+
+endif " !exists("no_buffers_menu")
+
+" Window menu
+an 70.300 &Window.&New<Tab>^Wn <C-W>n
+an 70.310 &Window.S&plit<Tab>^Ws <C-W>s
+an 70.320 &Window.Sp&lit\ To\ #<Tab>^W^^ <C-W><C-^>
+an 70.330 &Window.Split\ &Vertically<Tab>^Wv <C-W>v
+if has("vertsplit")
+ an <silent> 70.332 &Window.Split\ File\ E&xplorer :call MenuExplOpen()<CR>
+ if !exists("*MenuExplOpen")
+ fun MenuExplOpen()
+ if @% == ""
+ 20vsp .
+ else
+ exe "20vsp " . s:FnameEscape(expand("%:p:h"))
+ endif
+ endfun
+ endif
+endif
+an 70.335 &Window.-SEP1- <Nop>
+an 70.340 &Window.&Close<Tab>^Wc :confirm close<CR>
+an 70.345 &Window.Close\ &Other(s)<Tab>^Wo :confirm only<CR>
+an 70.350 &Window.-SEP2- <Nop>
+an 70.355 &Window.Move\ &To.&Top<Tab>^WK <C-W>K
+an 70.355 &Window.Move\ &To.&Bottom<Tab>^WJ <C-W>J
+an 70.355 &Window.Move\ &To.&Left\ side<Tab>^WH <C-W>H
+an 70.355 &Window.Move\ &To.&Right\ side<Tab>^WL <C-W>L
+an 70.360 &Window.Rotate\ &Up<Tab>^WR <C-W>R
+an 70.362 &Window.Rotate\ &Down<Tab>^Wr <C-W>r
+an 70.365 &Window.-SEP3- <Nop>
+an 70.370 &Window.&Equal\ Size<Tab>^W= <C-W>=
+an 70.380 &Window.&Max\ Height<Tab>^W_ <C-W>_
+an 70.390 &Window.M&in\ Height<Tab>^W1_ <C-W>1_
+an 70.400 &Window.Max\ &Width<Tab>^W\| <C-W>\|
+an 70.410 &Window.Min\ Widt&h<Tab>^W1\| <C-W>1\|
+
+" The popup menu
+an 1.10 PopUp.&Undo u
+an 1.15 PopUp.-SEP1- <Nop>
+vnoremenu 1.20 PopUp.Cu&t "+x
+vnoremenu 1.30 PopUp.&Copy "+y
+cnoremenu 1.30 PopUp.&Copy <C-Y>
+nnoremenu 1.40 PopUp.&Paste "+gP
+cnoremenu 1.40 PopUp.&Paste <C-R>+
+exe 'vnoremenu <script> 1.40 PopUp.&Paste ' . paste#paste_cmd['v']
+exe 'inoremenu <script> 1.40 PopUp.&Paste ' . paste#paste_cmd['i']
+vnoremenu 1.50 PopUp.&Delete x
+an 1.55 PopUp.-SEP2- <Nop>
+vnoremenu 1.60 PopUp.Select\ Blockwise <C-V>
+
+nnoremenu 1.70 PopUp.Select\ &Word vaw
+onoremenu 1.70 PopUp.Select\ &Word aw
+vnoremenu 1.70 PopUp.Select\ &Word <C-C>vaw
+inoremenu 1.70 PopUp.Select\ &Word <C-O>vaw
+cnoremenu 1.70 PopUp.Select\ &Word <C-C>vaw
+
+nnoremenu 1.73 PopUp.Select\ &Sentence vas
+onoremenu 1.73 PopUp.Select\ &Sentence as
+vnoremenu 1.73 PopUp.Select\ &Sentence <C-C>vas
+inoremenu 1.73 PopUp.Select\ &Sentence <C-O>vas
+cnoremenu 1.73 PopUp.Select\ &Sentence <C-C>vas
+
+nnoremenu 1.77 PopUp.Select\ Pa&ragraph vap
+onoremenu 1.77 PopUp.Select\ Pa&ragraph ap
+vnoremenu 1.77 PopUp.Select\ Pa&ragraph <C-C>vap
+inoremenu 1.77 PopUp.Select\ Pa&ragraph <C-O>vap
+cnoremenu 1.77 PopUp.Select\ Pa&ragraph <C-C>vap
+
+nnoremenu 1.80 PopUp.Select\ &Line V
+onoremenu 1.80 PopUp.Select\ &Line <C-C>V
+vnoremenu 1.80 PopUp.Select\ &Line <C-C>V
+inoremenu 1.80 PopUp.Select\ &Line <C-O>V
+cnoremenu 1.80 PopUp.Select\ &Line <C-C>V
+
+nnoremenu 1.90 PopUp.Select\ &Block <C-V>
+onoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
+vnoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
+inoremenu 1.90 PopUp.Select\ &Block <C-O><C-V>
+cnoremenu 1.90 PopUp.Select\ &Block <C-C><C-V>
+
+noremenu <script> <silent> 1.100 PopUp.Select\ &All :<C-U>call <SID>SelectAll()<CR>
+inoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-O>:call <SID>SelectAll()<CR>
+cnoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-U>call <SID>SelectAll()<CR>
+
+if has("spell")
+ " Spell suggestions in the popup menu. Note that this will slow down the
+ " appearance of the menu!
+ func! <SID>SpellPopup()
+ if exists("s:changeitem") && s:changeitem != ''
+ call <SID>SpellDel()
+ endif
+
+ " Return quickly if spell checking is not enabled.
+ if !&spell || &spelllang == ''
+ return
+ endif
+
+ let curcol = col('.')
+ let [w, a] = spellbadword()
+ if col('.') > curcol " don't use word after the cursor
+ let w = ''
+ call cursor(0, curcol) " put the cursor back where it was
+ endif
+ if w != ''
+ if a == 'caps'
+ let s:suglist = [substitute(w, '.*', '\u&', '')]
+ else
+ let s:suglist = spellsuggest(w, 10)
+ endif
+ if len(s:suglist) <= 0
+ call cursor(0, curcol) " put the cursor back where it was
+ else
+ let s:changeitem = 'change\ "' . escape(w, ' .'). '"\ to'
+ let s:fromword = w
+ let pri = 1
+ for sug in s:suglist
+ exe 'anoremenu 1.5.' . pri . ' PopUp.' . s:changeitem . '.' . escape(sug, ' .')
+ \ . ' :call <SID>SpellReplace(' . pri . ')<CR>'
+ let pri += 1
+ endfor
+
+ let s:additem = 'add\ "' . escape(w, ' .') . '"\ to\ word\ list'
+ exe 'anoremenu 1.6 PopUp.' . s:additem . ' :spellgood ' . w . '<CR>'
+
+ let s:ignoreitem = 'ignore\ "' . escape(w, ' .') . '"'
+ exe 'anoremenu 1.7 PopUp.' . s:ignoreitem . ' :spellgood! ' . w . '<CR>'
+
+ anoremenu 1.8 PopUp.-SpellSep- :
+ endif
+ endif
+ endfunc
+
+ func! <SID>SpellReplace(n)
+ let l = getline('.')
+ call setline('.', strpart(l, 0, col('.') - 1) . s:suglist[a:n - 1]
+ \ . strpart(l, col('.') + len(s:fromword) - 1))
+ endfunc
+
+ func! <SID>SpellDel()
+ exe "aunmenu PopUp." . s:changeitem
+ exe "aunmenu PopUp." . s:additem
+ exe "aunmenu PopUp." . s:ignoreitem
+ aunmenu PopUp.-SpellSep-
+ let s:changeitem = ''
+ endfun
+
+ augroup SpellPopupMenu
+ au! MenuPopup * call <SID>SpellPopup()
+ augroup END
+endif
+
+" The GUI toolbar (for MS-Windows and GTK)
+if has("toolbar")
+ an 1.10 ToolBar.Open :browse confirm e<CR>
+ an <silent> 1.20 ToolBar.Save :if expand("%") == ""<Bar>browse confirm w<Bar>else<Bar>confirm w<Bar>endif<CR>
+ an 1.30 ToolBar.SaveAll :browse confirm wa<CR>
+
+ if has("printer")
+ an 1.40 ToolBar.Print :hardcopy<CR>
+ vunmenu ToolBar.Print
+ vnoremenu ToolBar.Print :hardcopy<CR>
+ elseif has("unix")
+ an 1.40 ToolBar.Print :w !lpr<CR>
+ vunmenu ToolBar.Print
+ vnoremenu ToolBar.Print :w !lpr<CR>
+ endif
+
+ an 1.45 ToolBar.-sep1- <Nop>
+ an 1.50 ToolBar.Undo u
+ an 1.60 ToolBar.Redo <C-R>
+
+ an 1.65 ToolBar.-sep2- <Nop>
+ vnoremenu 1.70 ToolBar.Cut "+x
+ vnoremenu 1.80 ToolBar.Copy "+y
+ cnoremenu 1.80 ToolBar.Copy <C-Y>
+ nnoremenu 1.90 ToolBar.Paste "+gP
+ cnoremenu ToolBar.Paste <C-R>+
+ exe 'vnoremenu <script> ToolBar.Paste ' . paste#paste_cmd['v']
+ exe 'inoremenu <script> ToolBar.Paste ' . paste#paste_cmd['i']
+
+ if !has("gui_athena")
+ an 1.95 ToolBar.-sep3- <Nop>
+ an 1.100 ToolBar.Replace :promptrepl<CR>
+ vunmenu ToolBar.Replace
+ vnoremenu ToolBar.Replace y:promptrepl <C-R>=<SID>FixFText()<CR><CR>
+ an 1.110 ToolBar.FindNext n
+ an 1.120 ToolBar.FindPrev N
+ endif
+
+ an 1.215 ToolBar.-sep5- <Nop>
+ an <silent> 1.220 ToolBar.LoadSesn :call <SID>LoadVimSesn()<CR>
+ an <silent> 1.230 ToolBar.SaveSesn :call <SID>SaveVimSesn()<CR>
+ an 1.240 ToolBar.RunScript :browse so<CR>
+
+ an 1.245 ToolBar.-sep6- <Nop>
+ an 1.250 ToolBar.Make :make<CR>
+ an 1.270 ToolBar.RunCtags :exe "!" . g:ctags_command<CR>
+ an 1.280 ToolBar.TagJump g<C-]>
+
+ an 1.295 ToolBar.-sep7- <Nop>
+ an 1.300 ToolBar.Help :help<CR>
+ an <silent> 1.310 ToolBar.FindHelp :call <SID>Helpfind()<CR>
+
+" Only set the tooltips here if not done in a language menu file
+if exists("*Do_toolbar_tmenu")
+ call Do_toolbar_tmenu()
+else
+ let did_toolbar_tmenu = 1
+ tmenu ToolBar.Open Open file
+ tmenu ToolBar.Save Save current file
+ tmenu ToolBar.SaveAll Save all files
+ tmenu ToolBar.Print Print
+ tmenu ToolBar.Undo Undo
+ tmenu ToolBar.Redo Redo
+ tmenu ToolBar.Cut Cut to clipboard
+ tmenu ToolBar.Copy Copy to clipboard
+ tmenu ToolBar.Paste Paste from Clipboard
+ if !has("gui_athena")
+ tmenu ToolBar.Find Find...
+ tmenu ToolBar.FindNext Find Next
+ tmenu ToolBar.FindPrev Find Previous
+ tmenu ToolBar.Replace Find / Replace...
+ endif
+ tmenu ToolBar.LoadSesn Choose a session to load
+ tmenu ToolBar.SaveSesn Save current session
+ tmenu ToolBar.RunScript Choose a Vim Script to run
+ tmenu ToolBar.Make Make current project (:make)
+ tmenu ToolBar.RunCtags Build tags in current directory tree (!ctags -R .)
+ tmenu ToolBar.TagJump Jump to tag under cursor
+ tmenu ToolBar.Help Vim Help
+ tmenu ToolBar.FindHelp Search Vim Help
+endif
+
+" Select a session to load; default to current session name if present
+fun! s:LoadVimSesn()
+ if strlen(v:this_session) > 0
+ let name = s:FnameEscape(v:this_session)
+ else
+ let name = "Session.vim"
+ endif
+ execute "browse so " . name
+endfun
+
+" Select a session to save; default to current session name if present
+fun! s:SaveVimSesn()
+ if strlen(v:this_session) == 0
+ let v:this_session = "Session.vim"
+ endif
+ execute "browse mksession! " . s:FnameEscape(v:this_session)
+endfun
+
+endif
+
+endif " !exists("did_install_default_menus")
+
+" Define these items always, so that syntax can be switched on when it wasn't.
+" But skip them when the Syntax menu was disabled by the user.
+if !exists("did_install_syntax_menu")
+ an 50.212 &Syntax.&Manual :syn manual<CR>
+ an 50.214 &Syntax.A&utomatic :syn on<CR>
+ an <silent> 50.216 &Syntax.on/off\ for\ &This\ file :call <SID>SynOnOff()<CR>
+ if !exists("*s:SynOnOff")
+ fun s:SynOnOff()
+ if has("syntax_items")
+ syn clear
+ else
+ if !exists("g:syntax_on")
+ syn manual
+ endif
+ set syn=ON
+ endif
+ endfun
+ endif
+endif
+
+
+" Install the Syntax menu only when filetype.vim has been loaded or when
+" manual syntax highlighting is enabled.
+" Avoid installing the Syntax menu twice.
+if (exists("did_load_filetypes") || exists("syntax_on"))
+ \ && !exists("did_install_syntax_menu")
+ let did_install_syntax_menu = 1
+
+" Skip setting up the individual syntax selection menus unless
+" do_syntax_sel_menu is defined (it takes quite a bit of time).
+if exists("do_syntax_sel_menu")
+ runtime! synmenu.vim
+else
+ an 50.10 &Syntax.&Show\ filetypes\ in\ menu :let do_syntax_sel_menu = 1<Bar>runtime! synmenu.vim<Bar>aunmenu &Syntax.&Show\ filetypes\ in\ menu<CR>
+ an 50.195 &Syntax.-SEP1- <Nop>
+endif
+
+an 50.210 &Syntax.&Off :syn off<CR>
+an 50.700 &Syntax.-SEP3- <Nop>
+an 50.710 &Syntax.Co&lor\ test :sp $VIMRUNTIME/syntax/colortest.vim<Bar>so %<CR>
+an 50.720 &Syntax.&Highlight\ test :runtime syntax/hitest.vim<CR>
+an 50.730 &Syntax.&Convert\ to\ HTML :runtime syntax/2html.vim<CR>
+
+endif " !exists("did_install_syntax_menu")
+
+" Restore the previous value of 'cpoptions'.
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+" vim: set sw=2 :
diff --git a/runtime/tutor/runtime/rgb.txt b/runtime/tutor/runtime/rgb.txt
new file mode 100644
index 00000000..5bc2baa3
--- /dev/null
+++ b/runtime/tutor/runtime/rgb.txt
@@ -0,0 +1,753 @@
+! $XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp $
+255 250 250 snow
+248 248 255 ghost white
+248 248 255 GhostWhite
+245 245 245 white smoke
+245 245 245 WhiteSmoke
+220 220 220 gainsboro
+255 250 240 floral white
+255 250 240 FloralWhite
+253 245 230 old lace
+253 245 230 OldLace
+250 240 230 linen
+250 235 215 antique white
+250 235 215 AntiqueWhite
+255 239 213 papaya whip
+255 239 213 PapayaWhip
+255 235 205 blanched almond
+255 235 205 BlanchedAlmond
+255 228 196 bisque
+255 218 185 peach puff
+255 218 185 PeachPuff
+255 222 173 navajo white
+255 222 173 NavajoWhite
+255 228 181 moccasin
+255 248 220 cornsilk
+255 255 240 ivory
+255 250 205 lemon chiffon
+255 250 205 LemonChiffon
+255 245 238 seashell
+240 255 240 honeydew
+245 255 250 mint cream
+245 255 250 MintCream
+240 255 255 azure
+240 248 255 alice blue
+240 248 255 AliceBlue
+230 230 250 lavender
+255 240 245 lavender blush
+255 240 245 LavenderBlush
+255 228 225 misty rose
+255 228 225 MistyRose
+255 255 255 white
+ 0 0 0 black
+ 47 79 79 dark slate gray
+ 47 79 79 DarkSlateGray
+ 47 79 79 dark slate grey
+ 47 79 79 DarkSlateGrey
+105 105 105 dim gray
+105 105 105 DimGray
+105 105 105 dim grey
+105 105 105 DimGrey
+112 128 144 slate gray
+112 128 144 SlateGray
+112 128 144 slate grey
+112 128 144 SlateGrey
+119 136 153 light slate gray
+119 136 153 LightSlateGray
+119 136 153 light slate grey
+119 136 153 LightSlateGrey
+190 190 190 gray
+190 190 190 grey
+211 211 211 light grey
+211 211 211 LightGrey
+211 211 211 light gray
+211 211 211 LightGray
+ 25 25 112 midnight blue
+ 25 25 112 MidnightBlue
+ 0 0 128 navy
+ 0 0 128 navy blue
+ 0 0 128 NavyBlue
+100 149 237 cornflower blue
+100 149 237 CornflowerBlue
+ 72 61 139 dark slate blue
+ 72 61 139 DarkSlateBlue
+106 90 205 slate blue
+106 90 205 SlateBlue
+123 104 238 medium slate blue
+123 104 238 MediumSlateBlue
+132 112 255 light slate blue
+132 112 255 LightSlateBlue
+ 0 0 205 medium blue
+ 0 0 205 MediumBlue
+ 65 105 225 royal blue
+ 65 105 225 RoyalBlue
+ 0 0 255 blue
+ 30 144 255 dodger blue
+ 30 144 255 DodgerBlue
+ 0 191 255 deep sky blue
+ 0 191 255 DeepSkyBlue
+135 206 235 sky blue
+135 206 235 SkyBlue
+135 206 250 light sky blue
+135 206 250 LightSkyBlue
+ 70 130 180 steel blue
+ 70 130 180 SteelBlue
+176 196 222 light steel blue
+176 196 222 LightSteelBlue
+173 216 230 light blue
+173 216 230 LightBlue
+176 224 230 powder blue
+176 224 230 PowderBlue
+175 238 238 pale turquoise
+175 238 238 PaleTurquoise
+ 0 206 209 dark turquoise
+ 0 206 209 DarkTurquoise
+ 72 209 204 medium turquoise
+ 72 209 204 MediumTurquoise
+ 64 224 208 turquoise
+ 0 255 255 cyan
+224 255 255 light cyan
+224 255 255 LightCyan
+ 95 158 160 cadet blue
+ 95 158 160 CadetBlue
+102 205 170 medium aquamarine
+102 205 170 MediumAquamarine
+127 255 212 aquamarine
+ 0 100 0 dark green
+ 0 100 0 DarkGreen
+ 85 107 47 dark olive green
+ 85 107 47 DarkOliveGreen
+143 188 143 dark sea green
+143 188 143 DarkSeaGreen
+ 46 139 87 sea green
+ 46 139 87 SeaGreen
+ 60 179 113 medium sea green
+ 60 179 113 MediumSeaGreen
+ 32 178 170 light sea green
+ 32 178 170 LightSeaGreen
+152 251 152 pale green
+152 251 152 PaleGreen
+ 0 255 127 spring green
+ 0 255 127 SpringGreen
+124 252 0 lawn green
+124 252 0 LawnGreen
+ 0 255 0 green
+127 255 0 chartreuse
+ 0 250 154 medium spring green
+ 0 250 154 MediumSpringGreen
+173 255 47 green yellow
+173 255 47 GreenYellow
+ 50 205 50 lime green
+ 50 205 50 LimeGreen
+154 205 50 yellow green
+154 205 50 YellowGreen
+ 34 139 34 forest green
+ 34 139 34 ForestGreen
+107 142 35 olive drab
+107 142 35 OliveDrab
+189 183 107 dark khaki
+189 183 107 DarkKhaki
+240 230 140 khaki
+238 232 170 pale goldenrod
+238 232 170 PaleGoldenrod
+250 250 210 light goldenrod yellow
+250 250 210 LightGoldenrodYellow
+255 255 224 light yellow
+255 255 224 LightYellow
+255 255 0 yellow
+255 215 0 gold
+238 221 130 light goldenrod
+238 221 130 LightGoldenrod
+218 165 32 goldenrod
+184 134 11 dark goldenrod
+184 134 11 DarkGoldenrod
+188 143 143 rosy brown
+188 143 143 RosyBrown
+205 92 92 indian red
+205 92 92 IndianRed
+139 69 19 saddle brown
+139 69 19 SaddleBrown
+160 82 45 sienna
+205 133 63 peru
+222 184 135 burlywood
+245 245 220 beige
+245 222 179 wheat
+244 164 96 sandy brown
+244 164 96 SandyBrown
+210 180 140 tan
+210 105 30 chocolate
+178 34 34 firebrick
+165 42 42 brown
+233 150 122 dark salmon
+233 150 122 DarkSalmon
+250 128 114 salmon
+255 160 122 light salmon
+255 160 122 LightSalmon
+255 165 0 orange
+255 140 0 dark orange
+255 140 0 DarkOrange
+255 127 80 coral
+240 128 128 light coral
+240 128 128 LightCoral
+255 99 71 tomato
+255 69 0 orange red
+255 69 0 OrangeRed
+255 0 0 red
+255 105 180 hot pink
+255 105 180 HotPink
+255 20 147 deep pink
+255 20 147 DeepPink
+255 192 203 pink
+255 182 193 light pink
+255 182 193 LightPink
+219 112 147 pale violet red
+219 112 147 PaleVioletRed
+176 48 96 maroon
+199 21 133 medium violet red
+199 21 133 MediumVioletRed
+208 32 144 violet red
+208 32 144 VioletRed
+255 0 255 magenta
+238 130 238 violet
+221 160 221 plum
+218 112 214 orchid
+186 85 211 medium orchid
+186 85 211 MediumOrchid
+153 50 204 dark orchid
+153 50 204 DarkOrchid
+148 0 211 dark violet
+148 0 211 DarkViolet
+138 43 226 blue violet
+138 43 226 BlueViolet
+160 32 240 purple
+147 112 219 medium purple
+147 112 219 MediumPurple
+216 191 216 thistle
+255 250 250 snow1
+238 233 233 snow2
+205 201 201 snow3
+139 137 137 snow4
+255 245 238 seashell1
+238 229 222 seashell2
+205 197 191 seashell3
+139 134 130 seashell4
+255 239 219 AntiqueWhite1
+238 223 204 AntiqueWhite2
+205 192 176 AntiqueWhite3
+139 131 120 AntiqueWhite4
+255 228 196 bisque1
+238 213 183 bisque2
+205 183 158 bisque3
+139 125 107 bisque4
+255 218 185 PeachPuff1
+238 203 173 PeachPuff2
+205 175 149 PeachPuff3
+139 119 101 PeachPuff4
+255 222 173 NavajoWhite1
+238 207 161 NavajoWhite2
+205 179 139 NavajoWhite3
+139 121 94 NavajoWhite4
+255 250 205 LemonChiffon1
+238 233 191 LemonChiffon2
+205 201 165 LemonChiffon3
+139 137 112 LemonChiffon4
+255 248 220 cornsilk1
+238 232 205 cornsilk2
+205 200 177 cornsilk3
+139 136 120 cornsilk4
+255 255 240 ivory1
+238 238 224 ivory2
+205 205 193 ivory3
+139 139 131 ivory4
+240 255 240 honeydew1
+224 238 224 honeydew2
+193 205 193 honeydew3
+131 139 131 honeydew4
+255 240 245 LavenderBlush1
+238 224 229 LavenderBlush2
+205 193 197 LavenderBlush3
+139 131 134 LavenderBlush4
+255 228 225 MistyRose1
+238 213 210 MistyRose2
+205 183 181 MistyRose3
+139 125 123 MistyRose4
+240 255 255 azure1
+224 238 238 azure2
+193 205 205 azure3
+131 139 139 azure4
+131 111 255 SlateBlue1
+122 103 238 SlateBlue2
+105 89 205 SlateBlue3
+ 71 60 139 SlateBlue4
+ 72 118 255 RoyalBlue1
+ 67 110 238 RoyalBlue2
+ 58 95 205 RoyalBlue3
+ 39 64 139 RoyalBlue4
+ 0 0 255 blue1
+ 0 0 238 blue2
+ 0 0 205 blue3
+ 0 0 139 blue4
+ 30 144 255 DodgerBlue1
+ 28 134 238 DodgerBlue2
+ 24 116 205 DodgerBlue3
+ 16 78 139 DodgerBlue4
+ 99 184 255 SteelBlue1
+ 92 172 238 SteelBlue2
+ 79 148 205 SteelBlue3
+ 54 100 139 SteelBlue4
+ 0 191 255 DeepSkyBlue1
+ 0 178 238 DeepSkyBlue2
+ 0 154 205 DeepSkyBlue3
+ 0 104 139 DeepSkyBlue4
+135 206 255 SkyBlue1
+126 192 238 SkyBlue2
+108 166 205 SkyBlue3
+ 74 112 139 SkyBlue4
+176 226 255 LightSkyBlue1
+164 211 238 LightSkyBlue2
+141 182 205 LightSkyBlue3
+ 96 123 139 LightSkyBlue4
+198 226 255 SlateGray1
+185 211 238 SlateGray2
+159 182 205 SlateGray3
+108 123 139 SlateGray4
+202 225 255 LightSteelBlue1
+188 210 238 LightSteelBlue2
+162 181 205 LightSteelBlue3
+110 123 139 LightSteelBlue4
+191 239 255 LightBlue1
+178 223 238 LightBlue2
+154 192 205 LightBlue3
+104 131 139 LightBlue4
+224 255 255 LightCyan1
+209 238 238 LightCyan2
+180 205 205 LightCyan3
+122 139 139 LightCyan4
+187 255 255 PaleTurquoise1
+174 238 238 PaleTurquoise2
+150 205 205 PaleTurquoise3
+102 139 139 PaleTurquoise4
+152 245 255 CadetBlue1
+142 229 238 CadetBlue2
+122 197 205 CadetBlue3
+ 83 134 139 CadetBlue4
+ 0 245 255 turquoise1
+ 0 229 238 turquoise2
+ 0 197 205 turquoise3
+ 0 134 139 turquoise4
+ 0 255 255 cyan1
+ 0 238 238 cyan2
+ 0 205 205 cyan3
+ 0 139 139 cyan4
+151 255 255 DarkSlateGray1
+141 238 238 DarkSlateGray2
+121 205 205 DarkSlateGray3
+ 82 139 139 DarkSlateGray4
+127 255 212 aquamarine1
+118 238 198 aquamarine2
+102 205 170 aquamarine3
+ 69 139 116 aquamarine4
+193 255 193 DarkSeaGreen1
+180 238 180 DarkSeaGreen2
+155 205 155 DarkSeaGreen3
+105 139 105 DarkSeaGreen4
+ 84 255 159 SeaGreen1
+ 78 238 148 SeaGreen2
+ 67 205 128 SeaGreen3
+ 46 139 87 SeaGreen4
+154 255 154 PaleGreen1
+144 238 144 PaleGreen2
+124 205 124 PaleGreen3
+ 84 139 84 PaleGreen4
+ 0 255 127 SpringGreen1
+ 0 238 118 SpringGreen2
+ 0 205 102 SpringGreen3
+ 0 139 69 SpringGreen4
+ 0 255 0 green1
+ 0 238 0 green2
+ 0 205 0 green3
+ 0 139 0 green4
+127 255 0 chartreuse1
+118 238 0 chartreuse2
+102 205 0 chartreuse3
+ 69 139 0 chartreuse4
+192 255 62 OliveDrab1
+179 238 58 OliveDrab2
+154 205 50 OliveDrab3
+105 139 34 OliveDrab4
+202 255 112 DarkOliveGreen1
+188 238 104 DarkOliveGreen2
+162 205 90 DarkOliveGreen3
+110 139 61 DarkOliveGreen4
+255 246 143 khaki1
+238 230 133 khaki2
+205 198 115 khaki3
+139 134 78 khaki4
+255 236 139 LightGoldenrod1
+238 220 130 LightGoldenrod2
+205 190 112 LightGoldenrod3
+139 129 76 LightGoldenrod4
+255 255 224 LightYellow1
+238 238 209 LightYellow2
+205 205 180 LightYellow3
+139 139 122 LightYellow4
+255 255 0 yellow1
+238 238 0 yellow2
+205 205 0 yellow3
+139 139 0 yellow4
+255 215 0 gold1
+238 201 0 gold2
+205 173 0 gold3
+139 117 0 gold4
+255 193 37 goldenrod1
+238 180 34 goldenrod2
+205 155 29 goldenrod3
+139 105 20 goldenrod4
+255 185 15 DarkGoldenrod1
+238 173 14 DarkGoldenrod2
+205 149 12 DarkGoldenrod3
+139 101 8 DarkGoldenrod4
+255 193 193 RosyBrown1
+238 180 180 RosyBrown2
+205 155 155 RosyBrown3
+139 105 105 RosyBrown4
+255 106 106 IndianRed1
+238 99 99 IndianRed2
+205 85 85 IndianRed3
+139 58 58 IndianRed4
+255 130 71 sienna1
+238 121 66 sienna2
+205 104 57 sienna3
+139 71 38 sienna4
+255 211 155 burlywood1
+238 197 145 burlywood2
+205 170 125 burlywood3
+139 115 85 burlywood4
+255 231 186 wheat1
+238 216 174 wheat2
+205 186 150 wheat3
+139 126 102 wheat4
+255 165 79 tan1
+238 154 73 tan2
+205 133 63 tan3
+139 90 43 tan4
+255 127 36 chocolate1
+238 118 33 chocolate2
+205 102 29 chocolate3
+139 69 19 chocolate4
+255 48 48 firebrick1
+238 44 44 firebrick2
+205 38 38 firebrick3
+139 26 26 firebrick4
+255 64 64 brown1
+238 59 59 brown2
+205 51 51 brown3
+139 35 35 brown4
+255 140 105 salmon1
+238 130 98 salmon2
+205 112 84 salmon3
+139 76 57 salmon4
+255 160 122 LightSalmon1
+238 149 114 LightSalmon2
+205 129 98 LightSalmon3
+139 87 66 LightSalmon4
+255 165 0 orange1
+238 154 0 orange2
+205 133 0 orange3
+139 90 0 orange4
+255 127 0 DarkOrange1
+238 118 0 DarkOrange2
+205 102 0 DarkOrange3
+139 69 0 DarkOrange4
+255 114 86 coral1
+238 106 80 coral2
+205 91 69 coral3
+139 62 47 coral4
+255 99 71 tomato1
+238 92 66 tomato2
+205 79 57 tomato3
+139 54 38 tomato4
+255 69 0 OrangeRed1
+238 64 0 OrangeRed2
+205 55 0 OrangeRed3
+139 37 0 OrangeRed4
+255 0 0 red1
+238 0 0 red2
+205 0 0 red3
+139 0 0 red4
+255 20 147 DeepPink1
+238 18 137 DeepPink2
+205 16 118 DeepPink3
+139 10 80 DeepPink4
+255 110 180 HotPink1
+238 106 167 HotPink2
+205 96 144 HotPink3
+139 58 98 HotPink4
+255 181 197 pink1
+238 169 184 pink2
+205 145 158 pink3
+139 99 108 pink4
+255 174 185 LightPink1
+238 162 173 LightPink2
+205 140 149 LightPink3
+139 95 101 LightPink4
+255 130 171 PaleVioletRed1
+238 121 159 PaleVioletRed2
+205 104 137 PaleVioletRed3
+139 71 93 PaleVioletRed4
+255 52 179 maroon1
+238 48 167 maroon2
+205 41 144 maroon3
+139 28 98 maroon4
+255 62 150 VioletRed1
+238 58 140 VioletRed2
+205 50 120 VioletRed3
+139 34 82 VioletRed4
+255 0 255 magenta1
+238 0 238 magenta2
+205 0 205 magenta3
+139 0 139 magenta4
+255 131 250 orchid1
+238 122 233 orchid2
+205 105 201 orchid3
+139 71 137 orchid4
+255 187 255 plum1
+238 174 238 plum2
+205 150 205 plum3
+139 102 139 plum4
+224 102 255 MediumOrchid1
+209 95 238 MediumOrchid2
+180 82 205 MediumOrchid3
+122 55 139 MediumOrchid4
+191 62 255 DarkOrchid1
+178 58 238 DarkOrchid2
+154 50 205 DarkOrchid3
+104 34 139 DarkOrchid4
+155 48 255 purple1
+145 44 238 purple2
+125 38 205 purple3
+ 85 26 139 purple4
+171 130 255 MediumPurple1
+159 121 238 MediumPurple2
+137 104 205 MediumPurple3
+ 93 71 139 MediumPurple4
+255 225 255 thistle1
+238 210 238 thistle2
+205 181 205 thistle3
+139 123 139 thistle4
+ 0 0 0 gray0
+ 0 0 0 grey0
+ 3 3 3 gray1
+ 3 3 3 grey1
+ 5 5 5 gray2
+ 5 5 5 grey2
+ 8 8 8 gray3
+ 8 8 8 grey3
+ 10 10 10 gray4
+ 10 10 10 grey4
+ 13 13 13 gray5
+ 13 13 13 grey5
+ 15 15 15 gray6
+ 15 15 15 grey6
+ 18 18 18 gray7
+ 18 18 18 grey7
+ 20 20 20 gray8
+ 20 20 20 grey8
+ 23 23 23 gray9
+ 23 23 23 grey9
+ 26 26 26 gray10
+ 26 26 26 grey10
+ 28 28 28 gray11
+ 28 28 28 grey11
+ 31 31 31 gray12
+ 31 31 31 grey12
+ 33 33 33 gray13
+ 33 33 33 grey13
+ 36 36 36 gray14
+ 36 36 36 grey14
+ 38 38 38 gray15
+ 38 38 38 grey15
+ 41 41 41 gray16
+ 41 41 41 grey16
+ 43 43 43 gray17
+ 43 43 43 grey17
+ 46 46 46 gray18
+ 46 46 46 grey18
+ 48 48 48 gray19
+ 48 48 48 grey19
+ 51 51 51 gray20
+ 51 51 51 grey20
+ 54 54 54 gray21
+ 54 54 54 grey21
+ 56 56 56 gray22
+ 56 56 56 grey22
+ 59 59 59 gray23
+ 59 59 59 grey23
+ 61 61 61 gray24
+ 61 61 61 grey24
+ 64 64 64 gray25
+ 64 64 64 grey25
+ 66 66 66 gray26
+ 66 66 66 grey26
+ 69 69 69 gray27
+ 69 69 69 grey27
+ 71 71 71 gray28
+ 71 71 71 grey28
+ 74 74 74 gray29
+ 74 74 74 grey29
+ 77 77 77 gray30
+ 77 77 77 grey30
+ 79 79 79 gray31
+ 79 79 79 grey31
+ 82 82 82 gray32
+ 82 82 82 grey32
+ 84 84 84 gray33
+ 84 84 84 grey33
+ 87 87 87 gray34
+ 87 87 87 grey34
+ 89 89 89 gray35
+ 89 89 89 grey35
+ 92 92 92 gray36
+ 92 92 92 grey36
+ 94 94 94 gray37
+ 94 94 94 grey37
+ 97 97 97 gray38
+ 97 97 97 grey38
+ 99 99 99 gray39
+ 99 99 99 grey39
+102 102 102 gray40
+102 102 102 grey40
+105 105 105 gray41
+105 105 105 grey41
+107 107 107 gray42
+107 107 107 grey42
+110 110 110 gray43
+110 110 110 grey43
+112 112 112 gray44
+112 112 112 grey44
+115 115 115 gray45
+115 115 115 grey45
+117 117 117 gray46
+117 117 117 grey46
+120 120 120 gray47
+120 120 120 grey47
+122 122 122 gray48
+122 122 122 grey48
+125 125 125 gray49
+125 125 125 grey49
+127 127 127 gray50
+127 127 127 grey50
+130 130 130 gray51
+130 130 130 grey51
+133 133 133 gray52
+133 133 133 grey52
+135 135 135 gray53
+135 135 135 grey53
+138 138 138 gray54
+138 138 138 grey54
+140 140 140 gray55
+140 140 140 grey55
+143 143 143 gray56
+143 143 143 grey56
+145 145 145 gray57
+145 145 145 grey57
+148 148 148 gray58
+148 148 148 grey58
+150 150 150 gray59
+150 150 150 grey59
+153 153 153 gray60
+153 153 153 grey60
+156 156 156 gray61
+156 156 156 grey61
+158 158 158 gray62
+158 158 158 grey62
+161 161 161 gray63
+161 161 161 grey63
+163 163 163 gray64
+163 163 163 grey64
+166 166 166 gray65
+166 166 166 grey65
+168 168 168 gray66
+168 168 168 grey66
+171 171 171 gray67
+171 171 171 grey67
+173 173 173 gray68
+173 173 173 grey68
+176 176 176 gray69
+176 176 176 grey69
+179 179 179 gray70
+179 179 179 grey70
+181 181 181 gray71
+181 181 181 grey71
+184 184 184 gray72
+184 184 184 grey72
+186 186 186 gray73
+186 186 186 grey73
+189 189 189 gray74
+189 189 189 grey74
+191 191 191 gray75
+191 191 191 grey75
+194 194 194 gray76
+194 194 194 grey76
+196 196 196 gray77
+196 196 196 grey77
+199 199 199 gray78
+199 199 199 grey78
+201 201 201 gray79
+201 201 201 grey79
+204 204 204 gray80
+204 204 204 grey80
+207 207 207 gray81
+207 207 207 grey81
+209 209 209 gray82
+209 209 209 grey82
+212 212 212 gray83
+212 212 212 grey83
+214 214 214 gray84
+214 214 214 grey84
+217 217 217 gray85
+217 217 217 grey85
+219 219 219 gray86
+219 219 219 grey86
+222 222 222 gray87
+222 222 222 grey87
+224 224 224 gray88
+224 224 224 grey88
+227 227 227 gray89
+227 227 227 grey89
+229 229 229 gray90
+229 229 229 grey90
+232 232 232 gray91
+232 232 232 grey91
+235 235 235 gray92
+235 235 235 grey92
+237 237 237 gray93
+237 237 237 grey93
+240 240 240 gray94
+240 240 240 grey94
+242 242 242 gray95
+242 242 242 grey95
+245 245 245 gray96
+245 245 245 grey96
+247 247 247 gray97
+247 247 247 grey97
+250 250 250 gray98
+250 250 250 grey98
+252 252 252 gray99
+252 252 252 grey99
+255 255 255 gray100
+255 255 255 grey100
+169 169 169 dark grey
+169 169 169 DarkGrey
+169 169 169 dark gray
+169 169 169 DarkGray
+0 0 139 dark blue
+0 0 139 DarkBlue
+0 139 139 dark cyan
+0 139 139 DarkCyan
+139 0 139 dark magenta
+139 0 139 DarkMagenta
+139 0 0 dark red
+139 0 0 DarkRed
+144 238 144 light green
+144 238 144 LightGreen
diff --git a/runtime/tutor/runtime/tutor.info b/runtime/tutor/runtime/tutor.info
new file mode 100755
index 00000000..f8ceda36
--- /dev/null
+++ b/runtime/tutor/runtime/tutor.info
Binary files differ
diff --git a/runtime/tutor/runtime/vim16x16.gif b/runtime/tutor/runtime/vim16x16.gif
new file mode 100644
index 00000000..505a855a
--- /dev/null
+++ b/runtime/tutor/runtime/vim16x16.gif
Binary files differ
diff --git a/runtime/tutor/runtime/vim32x32.gif b/runtime/tutor/runtime/vim32x32.gif
new file mode 100644
index 00000000..523821b4
--- /dev/null
+++ b/runtime/tutor/runtime/vim32x32.gif
Binary files differ
diff --git a/runtime/tutor/tutor.no.utf-8 b/runtime/tutor/tutor.no.utf-8
new file mode 100644
index 00000000..a7826b78
--- /dev/null
+++ b/runtime/tutor/tutor.no.utf-8
@@ -0,0 +1,973 @@
+===============================================================================
+= V e l k o m m e n t i l i n n f ø r i n g e n i V i m -- Ver. 1.7 =
+===============================================================================
+
+ Vim er en meget kraftig editor med mange kommandoer, alt for mange til å
+ kunne gå gjennom alle i en innføring som denne. Den er beregnet på å
+ sette deg inn i bruken av nok kommandoer så du vil være i stand til lett
+ å kunne bruke Vim som en editor til alle formål.
+
+ Tiden som kreves for å gå gjennom denne innføringen tar ca. 25-30
+ minutter, avhengig av hvor mye tid du bruker til eksperimentering.
+
+ MERK:
+ Kommandoene i leksjonene vil modifisere teksten. Lag en kopi av denne
+ filen som du kan øve deg på (hvis du kjørte «vimtutor»-kommandoen, er
+ dette allerede en kopi).
+
+ Det er viktig å huske at denne innføringen er beregnet på læring gjennom
+ bruk. Det betyr at du må utføre kommandoene for å lære dem skikkelig.
+ Hvis du bare leser teksten, vil du glemme kommandoene!
+
+ Først av alt, sjekk at «Caps Lock» IKKE er aktiv og trykk «j»-tasten for
+ å flytte markøren helt til leksjon 1.1 fyller skjermen.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 1.1: FLYTTING AV MARKØREN
+
+
+ ** For å flytte markøren, trykk tastene h, j, k, l som vist. **
+ ^
+ k Tips: h-tasten er til venstre og flytter til venstre.
+ < h l > l-tasten er til høyre og flytter til høyre.
+ j j-tasten ser ut som en pil som peker nedover.
+ v
+ 1. Flytt markøren rundt på skjermen til du har fått det inn i fingrene.
+
+ 2. Hold inne nedovertasten (j) til den repeterer.
+ Nå vet du hvordan du beveger deg til neste leksjon.
+
+ 3. Gå til leksjon 1.2 ved hjelp av nedovertasten.
+
+Merk: Hvis du blir usikker på noe du har skrevet, trykk <ESC> for å gå til
+ normalmodus. Skriv deretter kommandoen du ønsket på nytt.
+
+Merk: Piltastene skal også virke. Men ved å bruke hjkl vil du være i stand til
+ å bevege markøren mye raskere når du er blitt vant til det. Helt sant!
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 1.2: AVSLUTTE VIM
+
+
+ !! MERK: Før du utfører noen av punktene nedenfor, les hele leksjonen!!
+
+ 1. Trykk <ESC>-tasten (for å forsikre deg om at du er i normalmodus).
+
+ 2. Skriv: :q! <ENTER>.
+ Dette avslutter editoren og FORKASTER alle forandringer som du har gjort.
+
+ 3. Når du ser kommandolinjen i skallet, skriv kommandoen som startet denne
+ innføringen. Den er: vimtutor <ENTER>
+
+ 4. Hvis du er sikker på at du husker dette, utfør punktene 1 til 3 for å
+ avslutte og starte editoren på nytt.
+
+MERK: :q! <ENTER> forkaster alle forandringer som du gjorde. I løpet av noen
+ få leksjoner vil du lære hvordan du lagrer forandringene til en fil.
+
+ 5. Flytt markøren ned til leksjon 1.3.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 1.3: REDIGERING AV TEKST -- SLETTING
+
+
+ ** Trykk x for å slette tegnet under markøren. **
+
+ 1. Flytt markøren til den første linjen merket med --->.
+
+ 2. For å ordne feilene på linjen, flytt markøren til den er oppå tegnet som
+ skal slettes.
+
+ 3. Trykk tasten x for å slette det uønskede tegnet.
+
+ 4. Repeter punkt 2 til 4 til setningen er lik den som er under.
+
+---> Hessstennnn brrråsnudddde ii gaaata.
+---> Hesten bråsnudde i gata.
+
+ 5. Nå som linjen er korrekt, gå til leksjon 1.4.
+
+MERK: Når du går gjennom innføringen, ikke bare prøv å huske kommandoene, men
+ bruk dem helt til de sitter.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 1.4: REDIGERING AV TEKST -- INNSETTING
+
+
+ ** Trykk i for å sette inn tekst. **
+
+ 1. Flytt markøren til den første linjen som er merket med --->.
+
+ 2. For å gjøre den første linjen lik den andre, flytt markøren til den står
+ på tegnet ETTER posisjonen der teksten skal settes inn.
+
+ 3. Trykk i og skriv inn teksten som mangler.
+
+ 4. Etterhvert som hver feil er fikset, trykk <ESC> for å returnere til
+ normalmodus. Repeter punkt 2 til 4 til setningen er korrekt.
+
+---> Det er tkst som mnglr .
+---> Det er ganske mye tekst som mangler her.
+
+ 5. Når du føler deg komfortabel med å sette inn tekst, gå til oppsummeringen
+ nedenfor.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 1.5: REDIGERING AV TEKST -- LEGGE TIL
+
+
+ ** Trykk A for å legge til tekst. **
+
+ 1. Flytt markøren til den første linjen nedenfor merket --->.
+ Det har ikke noe å si hvor markøren er plassert på den linjen.
+
+ 2. Trykk A og skriv inn det som skal legges til.
+
+ 3. Når teksten er lagt til, trykk <ESC> for å returnere til normalmodusen.
+
+ 4. Flytt markøren til den andre linjen markert med ---> og repeter steg 2 og
+ 3 for å reparere denne setningen.
+
+---> Det mangler noe tekst p
+ Det mangler noe tekst på denne linjen.
+---> Det mangler også litt tek
+ Det mangler også litt tekst på denne linjen.
+
+ 5. Når du føler at du behersker å legge til tekst, gå til leksjon 1.6.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 1.6: REDIGERE EN FIL
+
+
+ ** Bruk :wq for å lagre en fil og avslutte. **
+
+ !! MERK: Før du utfører noen av stegene nedenfor, les hele denne leksjonen!!
+
+ 1. Avslutt denne innføringen som du gjorde i leksjon 1.2: :q!
+
+ 2. Skriv denne kommandoen på kommandolinja: vim tutor <ENTER>
+ «vim» er kommandoen for å starte Vim-editoren, «tutor» er navnet på fila
+ som du vil redigere. Bruk en fil som kan forandres.
+
+ 3. Sett inn og slett tekst som du lærte i de foregående leksjonene.
+
+ 4. Lagre filen med forandringene og avslutt Vim med: :wq <ENTER>
+
+ 5. Start innføringen på nytt og flytt ned til oppsummeringen som følger.
+
+ 6. Etter å ha lest og forstått stegene ovenfor: Sett i gang.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 1
+
+
+ 1. Markøren beveges ved hjelp av piltastene eller hjkl-tastene.
+ h (venstre) j (ned) k (opp) l (høyre)
+
+ 2. For å starte Vim fra skall-kommandolinjen, skriv: vim FILNAVN <ENTER>
+
+ 3. For å avslutte Vim, skriv: <ESC> :q! <ENTER> for å forkaste endringer.
+ ELLER skriv: <ESC> :wq <ENTER> for å lagre forandringene.
+
+ 4. For å slette tegnet under markøren, trykk: x
+
+ 5. For å sette inn eller legge til tekst, trykk:
+ i skriv innsatt tekst <ESC> sett inn før markøren
+ A skriv tillagt tekst <ESC> legg til på slutten av linjen
+
+MERK: Når du trykker <ESC> går du til normalmodus eller du avbryter en uønsket
+ og delvis fullført kommando.
+
+ Nå kan du gå videre til leksjon 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.1: SLETTEKOMMANDOER
+
+
+ ** Trykk dw for å slette et ord. **
+
+ 1. Trykk <ESC> for å være sikker på at du er i normalmodus.
+
+ 2. Flytt markøren til den første linjen nedenfor merket --->.
+
+ 3. Flytt markøren til begynnelsen av ordet som skal slettes.
+
+ 4. Trykk dw og ordet vil forsvinne.
+
+MERK: Bokstaven d vil komme til syne på den nederste linjen på skjermen når
+ du skriver den. Vim venter på at du skal skrive w . Hvis du ser et annet
+ tegn enn d har du skrevet noe feil; trykk <ESC> og start på nytt.
+
+---> Det er agurk tre ord eple som ikke hører pære hjemme i denne setningen.
+---> Det er tre ord som ikke hører hjemme i denne setningen.
+
+ 5. Repeter punkt 3 og 4 til den første setningen er lik den andre. Gå
+ deretter til leksjon 2.2.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.2: FLERE SLETTEKOMMANDOER
+
+
+ ** Trykk d$ for å slette til slutten av linjen. **
+
+ 1. Trykk <ESC> for å være sikker på at du er i normalmodus.
+
+ 2. Flytt markøren til linjen nedenfor merket --->.
+
+ 3. Flytt markøren til punktet der linjen skal kuttes (ETTER første punktum).
+
+ 4. Trykk d$ for å slette alt til slutten av linjen.
+
+---> Noen skrev slutten på linjen en gang for mye. linjen en gang for mye.
+
+ 5. Gå til leksjon 2.3 for å forstå hva som skjer.
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.3: OM OPERATORER OG BEVEGELSER
+
+
+ Mange kommandoer som forandrer teksten er laget ut i fra en operator og en
+ bevegelse. Formatet for en slettekommando med sletteoperatoren d er:
+
+ d bevegelse
+
+ Der:
+ d - er sletteoperatoren.
+ bevegelse - er hva operatoren vil opere på (listet nedenfor).
+
+ En kort liste med bevegelser:
+ w - til starten av det neste ordet, UNNTATT det første tegnet.
+ e - til slutten av det nåværende ordet, INKLUDERT det siste tegnet.
+ $ - til slutten av linjen, INKLUDERT det siste tegnet.
+
+ Ved å skrive de vil altså alt fra markøren til slutten av ordet bli
+ slettet.
+
+MERK: Ved å skrive kun bevegelsen i normalmodusen uten en operator vil
+ markøren flyttes som spesifisert.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ LEKSJON 2.4: BRUK AV TELLER FOR EN BEVEGELSE
+
+
+ ** Ved å skrive et tall foran en bevegelse repeterer den så mange ganger. **
+
+ 1. Flytt markøren til starten av linjen markert ---> nedenfor.
+
+ 2. Skriv 2w for å flytte markøren to ord framover.
+
+ 3. Skriv 3e for å flytte markøren framover til slutten av det tredje
+ ordet.
+
+ 4. Skriv 0 (null) for å flytte til starten av linjen.
+
+ 5. Repeter steg 2 og 3 med forskjellige tall.
+
+---> Dette er en linje med noen ord som du kan bevege deg rundt på.
+
+ 6. Gå videre til leksjon 2.5.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.5: BRUK AV ANTALL FOR Å SLETTE MER
+
+
+ ** Et tall sammen med en operator repeterer den så mange ganger. **
+
+ I kombinasjonen med sletteoperatoren og en bevegelse nevnt ovenfor setter du
+ inn antall før bevegelsen for å slette mer:
+ d nummer bevegelse
+
+ 1. Flytt markøren til det første ordet med STORE BOKSTAVER på linjen markert
+ med --->.
+
+ 2. Skriv 2dw for å slette de to ordene med store bokstaver.
+
+ 3. Repeter steg 1 og 2 med forskjelling antall for å slette de etterfølgende
+ ordene som har store bokstaver.
+
+---> Denne ABC DE linjen FGHI JK LMN OP er nå Q RS TUV litt mer lesbar.
+
+MERK: Et antall mellom operatoren d og bevegelsen virker på samme måte som å
+ bruke bevegelsen uten en operator.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.6: OPERERE PÅ LINJER
+
+
+ ** Trykk dd for å slette en hel linje. **
+
+ På grunn av at sletting av linjer er mye brukt, fant utviklerne av Vi ut at
+ det vil være lettere å rett og slett trykke to d-er for å slette en linje.
+
+ 1. Flytt markøren til den andre linjen i verset nedenfor.
+ 2. Trykk dd å slette linjen.
+ 3. Flytt deretter til den fjerde linjen.
+ 4. Trykk 2dd for å slette to linjer.
+
+---> 1) Roser er røde,
+---> 2) Gjørme er gøy,
+---> 3) Fioler er blå,
+---> 4) Jeg har en bil,
+---> 5) Klokker viser tiden,
+---> 6) Druer er søte
+---> 7) Og du er likeså.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 2.7: ANGRE-KOMMANDOEN
+
+
+ ** Trykk u for å angre siste kommando, U for å fikse en hel linje. **
+
+ 1. Flytt markøren til linjen nedenfor merket ---> og plasser den på den
+ første feilen.
+ 2. Trykk x for å slette det første uønskede tegnet.
+ 3. Trykk så u for å angre den siste utførte kommandoen.
+ 4. Deretter ordner du alle feilene på linjene ved å bruke kommandoen x .
+ 5. Trykk nå en stor U for å sette linjen tilbake til det den var
+ originalt.
+ 6. Trykk u noen ganger for å angre U og foregående kommandoer.
+ 7. Deretter trykker du CTRL-R (hold CTRL nede mens du trykker R) noen
+ ganger for å gjenopprette kommandoene (omgjøre angrekommandoene).
+
+---> RReparer feiilene påå denne linnnjen oog erssstatt dem meed angre.
+
+ 8. Dette er meget nyttige kommandoer. Nå kan du gå til oppsummeringen av
+ leksjon 2.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 2
+
+
+ 1. For å slette fra markøren fram til det neste ordet, trykk: dw
+ 2. For å slette fra markøren til slutten av en linje, trykk: d$
+ 3. For å slette en hel linje, trykk: dd
+
+ 4. For å repetere en bevegelse, sett et nummer foran: 2w
+ 5. Formatet for en forandringskommando er:
+ operator [nummer] bevegelse
+ der:
+ operator - hva som skal gjøres, f.eks. d for å slette
+ [nummer] - et valgfritt antall for å repetere bevegelsen
+ bevegelse - hva kommandoen skal operere på, eksempelvis w (ord),
+ $ (til slutten av linjen) og så videre.
+
+ 6. For å gå til starten av en linje, bruk en null: 0
+
+ 7. For å angre tidligere endringer, skriv: u (liten u)
+ For å angre alle forandringer på en linje, skriv: U (stor U)
+ For å omgjøre angringen, trykk: CTRL-R
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 3.1: «LIM INN»-KOMMANDOEN
+
+
+ ** Trykk p for å lime inn tidligere slettet tekst etter markøren **
+
+ 1. Flytt markøren til den første linjen med ---> nedenfor.
+
+ 2. Trykk dd for å slette linjen og lagre den i et Vim-register.
+
+ 3. Flytt markøren til c)-linjen, OVER posisjonen linjen skal settes inn.
+
+ 4. Trykk p for å legge linjen under markøren.
+
+ 5. Repeter punkt 2 til 4 helt til linjene er i riktig rekkefølge.
+
+---> d) Kan du også lære?
+---> b) Fioler er blå,
+---> c) Intelligens må læres,
+---> a) Roser er røde,
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 3.2: «ERSTATT»-KOMMANDOEN
+
+
+ ** Trykk rx for å erstatte tegnet under markøren med x. **
+
+ 1. Flytt markøren til den første linjen nedenfor merket --->.
+
+ 2. Flytt markøren så den står oppå den første feilen.
+
+ 3. Trykk r og deretter tegnet som skal være der.
+
+ 4. Repeter punkt 2 og 3 til den første linjen er lik den andre.
+
+---> Da dfnne lynjxn ble zkrevet, var det nøen som tjykket feite taster!
+---> Da denne linjen ble skrevet, var det noen som trykket feile taster!
+
+ 5. Gå videre til leksjon 3.2.
+
+MERK: Husk at du bør lære ved å BRUKE, ikke pugge.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 3.3: «FORANDRE»-OPERATOREN
+
+
+ ** For å forandre til slutten av et ord, trykk ce . **
+
+ 1. Flytt markøren til den første linjen nedenfor som er merket --->.
+
+ 2. Plasser markøren på u i «lubjwr».
+
+ 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv «injen»).
+
+ 4. Trykk <ESC> og gå til det neste tegnet som skal forandres.
+
+ 5. Repeter punkt 3 og 4 helt til den første setningen er lik den andre.
+
+---> Denne lubjwr har noen wgh som må forkwåp med «forækzryas»-kommandoen.
+---> Denne linjen har noen ord som må forandres med «forandre»-kommandoen.
+
+Vær oppmerksom på at ce sletter ordet og går inn i innsettingsmodus.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 3.4: FLERE FORANDRINGER VED BRUK AV c
+
+
+ ** Forandringskommandoen blir brukt med de samme bevegelser som «slett». **
+
+ 1. Forandringsoperatoren fungerer på samme måte som «slett». Formatet er:
+
+ c [nummer] bevegelse
+
+ 2. Bevegelsene er de samme, som for eksempel w (ord) og $ (slutten av en
+ linje).
+
+ 3. Gå til den første linjen nedenfor som er merket --->.
+
+ 4. Flytt markøren til den første feilen.
+
+ 5. Skriv c$ og skriv resten av linjen lik den andre og trykk <ESC>.
+
+---> Slutten på denne linjen trenger litt hjelp for å gjøre den lik den neste.
+---> Slutten på denne linjen trenger å bli rettet ved bruk av c$-kommandoen.
+
+MERK: Du kan bruke slettetasten for å rette feil mens du skriver.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 3
+
+
+ 1. For å legge tilbake tekst som nettopp er blitt slettet, trykk p . Dette
+ limer inn den slettede teksten ETTER markøren (hvis en linje ble slettet
+ vil den bli limt inn på linjen under markøren).
+
+ 2. For å erstatte et tegn under markøren, trykk r og deretter tegnet som
+ du vil ha der.
+
+ 3. Forandringsoperatoren lar deg forandre fra markøren til dit bevegelsen
+ tar deg. Det vil si, skriv ce for å forandre fra markøren til slutten
+ av ordet, c$ for å forandre til slutten av linjen.
+
+ 4. Formatet for «forandre» er:
+
+ c [nummer] bevegelse
+
+Nå kan du gå til neste leksjon.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 4.1: POSISJONERING AV MARKØREN OG FILSTATUS
+
+ ** Trykk CTRL-G for å vise posisjonen i filen og filstatusen.
+ Trykk G for å gå til en spesifikk linje i filen. **
+
+ Merk: Les hele leksjonen før du utfører noen av punktene!
+
+ 1. Hold nede Ctrl-tasten og trykk g . Vi kaller dette CTRL-G. En melding
+ vil komme til syne på bunnen av skjermen med filnavnet og posisjonen i
+ filen. Husk linjenummeret for bruk i steg 3.
+
+Merk: Du kan se markørposisjonen i nederste høyre hjørne av skjermen. Dette
+ skjer når «ruler»-valget er satt (forklart i leksjon 6).
+
+ 2. Trykk G for å gå til bunnen av filen.
+ Skriv gg for å gå til begynnelsen av filen.
+
+ 3. Skriv inn linjenummeret du var på og deretter G . Dette vil føre deg
+ tilbake til linjen du var på da du først trykket CTRL-G.
+
+ 4. Utfør steg 1 til 3 hvis du føler deg sikker på prosedyren.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 4.2: SØKEKOMMANDOEN
+
+ ** Skriv / etterfulgt av en søkestreng som du vil lete etter. **
+
+ 1. Trykk / når du er i normalmodusen. Legg merke til at skråstreken og
+ markøren kommer til syne på bunnen av skjermen i likhet med
+ «:»-kommandoene.
+
+ 2. Skriv «feeeiil» og trykk <ENTER>. Dette er teksten du vil lete etter.
+
+ 3. For å finne neste forekomst av søkestrengen, trykk n .
+ For å lete etter samme søketeksten i motsatt retning, trykk N .
+
+ 4. For å lete etter en tekst bakover i filen, bruk ? istedenfor / .
+
+ 5. For å gå tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens
+ du trykker bokstaven o ). Repeter for å gå enda lengre tilbake. CTRL-I
+ går framover.
+
+---> «feeeiil» er ikke måten å skrive «feil» på, feeeiil er helt feil.
+Merk: Når søkingen når slutten av filen, vil den fortsette fra starten unntatt
+ hvis «wrapscan»-valget er resatt.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 4.3: FINN SAMSVARENDE PARENTESER
+
+
+ ** Trykk % for å finne en samsvarende ), ] eller } . **
+
+ 1. Plasser markøren på en (, [ eller { på linjen nedenfor merket --->.
+
+ 2. Trykk % .
+
+ 3. Markøren vil gå til den samsvarende parentesen eller hakeparentesen.
+
+ 4. Trykk % for å flytte markøren til den andre samsvarende parentesen.
+
+ 5. Flytt markøren til en annen (, ), [, ], { eller } og se hva % gjør.
+
+---> Dette ( er en testlinje med (, [ ] og { } i den )).
+
+Merk: Dette er veldig nyttig til feilsøking i programmer som har ubalansert
+ antall parenteser!
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 4.4: ERSTATT-KOMMANDOEN
+
+
+ ** Skriv :s/gammel/ny/g for å erstatte «gammel» med «ny». **
+
+ 1. Flytt markøren til linjen nedenfor som er merket med --->.
+
+ 2. Skriv :s/deen/den/ <ENTER> . Legg merke til at denne kommandoen bare
+ forandrer den første forekomsten av «deen» på linjen.
+
+ 3. Skriv :s/deen/den/g . Når g-flagget legges til, betyr dette global
+ erstatning på linjen og erstatter alle forekomster av «deen» på linjen.
+
+---> deen som kan kaste deen tyngste steinen lengst er deen beste
+
+ 4. For å erstatte alle forekomster av en tekststreng mellom to linjer,
+ skriv :#,#s/gammel/ny/g der #,# er linjenumrene på de to linjene for
+ linjeområdet erstatningen skal gjøres.
+ Skriv :%s/gammel/ny/g for å erstatte tekst i hele filen.
+ Skriv :%s/gammel/ny/gc for å finne alle forekomster i hele filen, og
+ deretter spørre om teksten skal erstattes eller
+ ikke.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 4
+
+
+ 1. Ctrl-G viser nåværende posisjon i filen og filstatusen.
+ G går til slutten av filen.
+ nummer G går til det linjenummeret.
+ gg går til den første linjen.
+
+ 2. Skriv / etterfulgt av en søketekst for å lete FRAMOVER etter teksten.
+ Skriv ? etterfulgt av en søketekst for å lete BAKOVER etter teksten.
+ Etter et søk kan du trykke n for å finne neste forekomst i den samme
+ retningen eller N for å lete i motsatt retning.
+ CTRL-O tar deg tilbake til gamle posisjoner, CTRL-I til nyere posisjoner.
+
+ 3. Skriv % når markøren står på en (, ), [, ], { eller } for å finne den
+ som samsvarer.
+
+ 4. Erstatte «gammel» med første «ny» på en linje: :s/gammel/ny
+ Erstatte alle «gammel» med «ny» på en linje: :s/gammel/ny/g
+ Erstatte tekst mellom to linjenumre: :#,#s/gammel/ny/g
+ Erstatte alle forekomster i en fil: :%s/gammel/ny/g
+ For å godkjenne hver erstatning, legg til «c»: :%s/gammel/ny/gc
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 5.1: HVORDAN UTFØRE EN EKSTERN KOMMANDO
+
+
+ ** Skriv :! etterfulgt av en ekstern kommando for å utføre denne. **
+
+ 1. Skriv den velkjente kommandoen : for å plassere markøren på bunnen av
+ skjermen. Dette lar deg skrive en kommandolinjekommando.
+
+ 2. Nå kan du skrive tegnet ! . Dette lar deg utføre en hvilken som helst
+ ekstern kommando.
+
+ 3. Som et eksempel, skriv ls etter utropstegnet og trykk <ENTER>. Du vil
+ nå få en liste over filene i katalogen, akkurat som om du hadde kjørt
+ kommandoen direkte fra kommandolinjen i skallet. Eller bruk :!dir hvis
+ «ls» ikke virker.
+
+MERK: Det er mulig å kjøre alle eksterne kommandoer på denne måten, også med
+ parametere.
+
+MERK: Alle «:»-kommandoer må avsluttes med <ENTER>. Fra dette punktet er det
+ ikke alltid vi nevner det.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 5.2: MER OM LAGRING AV FILER
+
+
+ ** For å lagre endringene gjort i en tekst, skriv :w FILNAVN. **
+
+ 1. Skriv :!dir eller :!ls for å få en liste over filene i katalogen. Du
+ vet allerede at du må trykke <ENTER> etter dette.
+
+ 2. Velg et filnavn på en fil som ikke finnes, som for eksempel TEST .
+
+ 3. Skriv :w TEST (der TEST er filnavnet du velger).
+
+ 4. Dette lagrer hele filen (denne innføringen) under navnet TEST . For å
+ sjekke dette, skriv :!dir eller :!ls igjen for å se innholdet av
+ katalogen.
+
+Merk: Hvis du nå hadde avsluttet Vim og startet på nytt igjen med «vim TEST»,
+ ville filen vært en eksakt kopi av innføringen da du lagret den.
+
+ 5. Fjern filen ved å skrive :!rm TEST hvis du er på et Unix-lignende
+ operativsystem, eller :!del TEST hvis du bruker MS-DOS.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 5.3: VELGE TEKST SOM SKAL LAGRES
+
+
+ ** For å lagre en del av en fil, skriv v bevegelse :w FILNAVN **
+
+ 1. Flytt markøren til denne linjen.
+
+ 2. Trykk v og flytt markøren til det femte elementet nedenfor. Legg merke
+ til at teksten blir markert.
+
+ 3. Trykk : (kolon). På bunnen av skjermen vil :'<,'> komme til syne.
+
+ 4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller
+ at du ser :'<,'>w TEST før du trykker Enter.
+
+ 5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller !ls
+ for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon.
+
+MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for
+ å gjøre det valgte området større eller mindre. Deretter kan du bruke en
+ operator for å gjøre noe med teksten. For eksempel sletter d teksten.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 5.4: HENTING OG SAMMENSLÅING AV FILER
+
+
+ ** For å lese inn en annen fil inn i nåværende buffer, skriv :r FILNAVN **
+
+ 1. Plasser markøren like over denne linjen.
+
+MERK: Etter å ha utført steg 2 vil du se teksten fra leksjon 5.3. Gå deretter
+ NED for å se denne leksjonen igjen.
+
+ 2. Hent TEST-filen ved å bruke kommandoen :r TEST der TEST er navnet på
+ filen du brukte. Filen du henter blir plassert nedenfor markørlinjen.
+
+ 3. For å sjekke at filen ble hentet, gå tilbake og se at det er to kopier av
+ leksjon 5.3, originalen og denne versjonen.
+
+MERK: Du kan også lese utdataene av en ekstern kommando. For eksempel, :r !ls
+ leser utdataene av ls-kommandoen og legger dem nedenfor markøren.
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 5
+
+
+ 1. :!kommando utfører en ekstern kommandio.
+
+ Noen nyttige eksempler er:
+ (MS-DOS) (Unix)
+ :!dir :!ls - List filene i katalogen.
+ :!del FILNAVN :!rm FILNAVN - Slett filen FILNAVN.
+
+ 2. :w FILNAVN skriver den nåværende Vim-filen disken med navnet FILNAVN .
+
+ 3. v bevegelse :w FILNAVN lagrer de visuelt valgte linjene til filen
+ FILNAVN.
+
+ 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor markøren.
+
+ 5. :r !dir leser utdataene fra «dir»-kommandoen og legger dem nedenfor
+ markørposisjonen.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 6.1: «ÅPNE LINJE»-KOMMANDOEN
+
+
+ ** Skriv o for å «åpne opp» for en ny linje etter markøren og gå til
+ innsettingsmodus **
+
+ 1. Flytt markøren til linjen nedenfor merket --->.
+
+ 2. Skriv o (liten o) for å åpne opp en linje NEDENFOR markøren og gå inn i
+ innsettingsmodus.
+
+ 3. Skriv litt tekst og trykk <ESC> for å gå ut av innsettingsmodusen.
+
+---> Etter at o er skrevet blir markøren plassert på den tomme linjen.
+
+ 4. For å åpne en ny linje OVER markøren, trykk rett og slett en stor O
+ istedenfor en liten o . Prøv dette på linjen nedenfor.
+
+---> Lag ny linje over denne ved å trykke O mens markøren er på denne linjen.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 6.2: «LEGG TIL»-KOMMANDOEN
+
+
+ ** Skriv a for å legge til tekst ETTER markøren. **
+
+ 1. Flytt markøren til starten av linjen merket ---> nedenfor.
+
+ 2. Trykk e til markøren er på slutten av «li».
+
+ 3. Trykk a (liten a) for å legge til tekst ETTER markøren.
+
+ 4. Fullfør ordet sånn som på linjen nedenfor. Trykk <ESC> for å gå ut av
+ innsettingsmodusen.
+
+ 5. Bruk e for å gå til det neste ufullstendige ordet og repeter steg 3 og
+ 4.
+
+---> Denne li lar deg øve på å leg til tek på en linje.
+---> Denne linjen lar deg øve på å legge til tekst på en linje.
+
+Merk: a, i og A går alle til den samme innsettingsmodusen, den eneste
+ forskjellen er hvor tegnene blir satt inn.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 6.3: EN ANNEN MÅTE Å ERSTATTE PÅ
+
+
+ ** Skriv en stor R for å erstatte mer enn ett tegn. **
+
+ 1. Flytt markøren til den første linjen nedenfor merket --->. Flytt markøren
+ til begynnelsen av den første «xxx»-en.
+
+ 2. Trykk R og skriv inn tallet som står nedenfor på den andre linjen så
+ det erstatter xxx.
+
+ 3. Trykk <ESC> for å gå ut av erstatningsmodusen. Legg merke til at resten
+ av linjen forblir uforandret.
+
+ 4. Repeter stegene for å erstatte den gjenværende xxx.
+
+---> Ved å legge 123 til xxx får vi xxx.
+---> Ved å legge 123 til 456 får vi 579.
+
+MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives
+ erstatter et eksisterende tegn.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 6.4: KOPIERE OG LIME INN TEKST
+
+
+ ** Bruk y-operatoren for å kopiere tekst og p for å lime den inn **
+
+ 1. Gå til linjen merket ---> nedenfor og plasser markøren etter «a)».
+
+ 2. Gå inn i visuell modus med v og flytt markøren til like før «første».
+
+ 3. Trykk y for å kopiere (engelsk: «yank») den uthevede teksten.
+
+ 4. Flytt markøren til slutten av den neste linjen: j$
+
+ 5. Trykk p for å lime inn teksten. Trykk deretter: a andre <ESC> .
+
+ 6. Bruk visuell modus for å velge « valget.», kopier det med y , gå til
+ slutten av den neste linjen med j$ og legg inn teksten der med p .
+
+---> a) Dette er det første valget.
+ b)
+
+Merk: Du kan også bruke y som en operator; yw kopierer ett ord.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 6.5: SETT VALG
+
+
+ ** Sett et valg så søk eller erstatning ignorerer store/små bokstaver. **
+
+ 1. Let etter «ignore» ved å skrive: /ignore <ENTER>
+ Repeter flere ganger ved å trykke n .
+
+ 2. Sett «ic»-valget (Ignore Case) ved å skrive: :set ic
+
+ 3. Søk etter «ignore» igjen ved å trykke n .
+ Legg merke til at både «Ignore» og «IGNORE» blir funnet.
+
+ 4. Sett «hlsearch»- og «incsearch»-valgene: :set hls is
+
+ 5. Skriv søkekommandoen igjen og se hva som skjer: /ignore <ENTER>
+
+ 6. For å slå av ignorering av store/små bokstaver, skriv: :set noic
+
+Merk: For å fjerne uthevingen av treff, skriv: :nohlsearch
+Merk: Hvis du vil ignorere store/små bokstaver for kun en søkekommando, bruk
+ \c i uttrykket: /ignore\c <ENTER>
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 6
+
+ 1. Trykk o for å legge til en linje NEDENFOR markøren og gå inn i
+ innsettingsmodus.
+ Trykk O for å åpne en linje OVER markøren.
+
+ 2. Skriv a for å sette inn tekst ETTER markøren.
+ Skriv A for å sette inn tekst etter slutten av linjen.
+
+ 3. Kommandoen e går til slutten av et ord.
+
+ 4. Operatoren y («yank») kopierer tekst, p («paste») limer den inn.
+
+ 5. Ved å trykke R går du inn i erstatningsmodus helt til <ESC> trykkes.
+
+ 6. Skriv «:set xxx» for å sette valget «xxx». Noen valg er:
+ «ic» «ignorecase» ignorer store/små bokstaver under søk
+ «is» «incsearch» vis delvise treff for en søketekst
+ «hls» «hlsearch» uthev alle søketreff
+
+ 7. Legg til «no» foran valget for å slå det av: :set noic
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 7.1: FÅ HJELP
+
+
+ ** Bruk det innebygde hjelpesystemet. **
+
+ Vim har et omfattende innebygget hjelpesystem. For å starte det, prøv en av
+ disse måtene:
+ - Trykk Hjelp-tasten (hvis du har en)
+ - Trykk F1-tasten (hvis du har en)
+ - Skriv :help <ENTER>
+
+ Les teksten i hjelpevinduet for å finne ut hvordan hjelpen virker.
+ Skriv CTRL-W CTRL-W for å hoppe fra et vindu til et annet
+ Skriv :q <ENTER> for å lukke hjelpevinduet.
+
+ Du kan få hjelp for omtrent alle temaer om Vim ved å skrive et parameter til
+ «:help»-kommandoen. Prøv disse (ikke glem å trykke <ENTER>):
+
+ :help w
+ :help c_CTRL-D
+ :help insert-index
+ :help user-manual
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 7.2: LAG ET OPPSTARTSSKRIPT
+
+
+ ** Slå på funksjoner i Vim **
+
+ Vim har mange flere funksjoner enn Vi, men flesteparten av dem er slått av
+ som standard. For å begynne å bruke flere funksjoner må du lage en
+ «vimrc»-fil.
+
+ 1. Start redigeringen av «vimrc»-filen. Dette avhenger av systemet ditt:
+ :e ~/.vimrc for Unix
+ :e $VIM/_vimrc for MS Windows
+
+ 2. Les inn eksempelfilen for «vimrc»:
+ :r $VIMRUNTIME/vimrc_example.vim
+
+ 3. Lagre filen med:
+ :w
+
+ Neste gang du starter Vim vil den bruke syntaks-utheving. Du kan legge til
+ alle dine foretrukne oppsett i denne «vimrc»-filen.
+ For mer informasjon, skriv :help vimrc-intro
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Leksjon 7.3: FULLFØRING
+
+
+ ** Kommandolinjefullføring med CTRL-D og <TAB> **
+
+ 1. Vær sikker på at Vim ikke er i Vi-kompatibel modus: :set nocp
+
+ 2. Se hvilke filer som er i katalogen: :!ls eller :!dir
+
+ 3. Skriv starten på en kommando: :e
+
+ 4. Trykk CTRL-D og Vim vil vise en liste over kommandoer som starter med
+ «e».
+
+ 5. Trykk <TAB> og Vim vil fullføre kommandonavnet til «:edit».
+
+ 6. Legg til et mellomrom og starten på et eksisterende filnavn: :edit FIL
+
+ 7. Trykk <TAB>. Vim vil fullføre navnet (hvis det er unikt).
+
+MERK: Fullføring fungerer for mange kommandoer. Prøv ved å trykke CTRL-D og
+ <TAB>. Det er spesielt nyttig for bruk sammen med :help .
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ OPPSUMMERING AV LEKSJON 7
+
+
+ 1. Skriv :help eller trykk <F1> eller <Help> for å åpne et hjelpevindu.
+
+ 2. Skriv :help kommando for å få hjelp om kommando .
+
+ 3. Trykk CTRL-W CTRL-W for å hoppe til et annet vindu.
+
+ 4. Trykk :q for å lukke hjelpevinduet.
+
+ 5. Opprett et vimrc-oppstartsskript for å lagre favorittvalgene dine.
+
+ 6. Når du skriver en «:»-kommando, trykk CTRL-D for å se mulige
+ fullføringer. Trykk <TAB> for å bruke en fullføring.
+
+
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ Her slutter innføringen i Vim. Den var ment som en rask oversikt over
+ editoren, akkurat nok til å la deg sette i gang med enkel bruk. Den er på
+ langt nær komplett, da Vim har mange flere kommandoer. Les bruksanvisningen
+ ved å skrive :help user-manual .
+
+ For videre lesing og studier, kan denne boken anbefales:
+ «Vim - Vi Improved» av Steve Oualline
+ Utgiver: New Riders
+ Den første boken som er fullt og helt dedisert til Vim. Spesielt nyttig for
+ nybegynnere. Inneholder mange eksempler og illustrasjoner.
+ Se http://iccf-holland.org/click5.html
+
+ Denne boken er eldre og handler mer om Vi enn Vim, men anbefales også:
+ «Learning the Vi Editor» av Linda Lamb
+ Utgiver: O'Reilly & Associates Inc.
+ Det er en god bok for å få vite omtrent hva som helst om Vi.
+ Den sjette utgaven inneholder også informasjon om Vim.
+
+ Denne innføringen er skrevet av Michael C. Pierce og Robert K. Ware,
+ Colorado School of Mines med idéer av Charles Smith, Colorado State
+ University. E-mail: bware@mines.colorado.edu .
+
+ Modifisert for Vim av Bram Moolenaar.
+ Oversatt av Øyvind A. Holm. E-mail: vimtutor _AT_ sunbase.org
+ Id: tutor.no 406 2007-03-18 22:48:36Z sunny
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+vim: set ts=8 :
diff --git a/runtime/tutor/tutor.vim b/runtime/tutor/tutor.vim
index 3dda1ea0..81e5a191 100644
--- a/runtime/tutor/tutor.vim
+++ b/runtime/tutor/tutor.vim
@@ -1,6 +1,6 @@
" Vim tutor support file
" Author: Eduardo F. Amatria <eferna1@platea.pntic.mec.es>
-" Last Change: 2007 Mar 01
+" Last Change: 2008 Jun 21
" This small source file is used for detecting if a translation of the
" tutor file exist, i.e., a tutor.xx file, where xx is the language.
@@ -45,23 +45,28 @@ else
endif
endif
+" Somehow ".ge" (Germany) is sometimes used for ".de" (Deutsch).
+if s:ext =~? '\.ge'
+ let s:ext = ".de"
+endif
+
+if s:ext =~? '\.en'
+ let s:ext = ""
+endif
+
" The japanese tutor is available in two encodings, guess which one to use
" The "sjis" one is actually "cp932", it doesn't matter for this text.
if s:ext =~? '\.ja'
if &enc =~ "euc"
let s:ext = ".ja.euc"
- elseif &enc =~ "utf-8$"
- let s:ext = ".ja.utf-8"
- else
+ elseif &enc != "utf-8"
let s:ext = ".ja.sjis"
endif
endif
" The korean tutor is available in two encodings, guess which one to use
if s:ext =~? '\.ko'
- if &enc =~ "utf-8$"
- let s:ext = ".ko.utf-8"
- else
+ if &enc != "utf-8"
let s:ext = ".ko.euc"
endif
endif
@@ -72,7 +77,7 @@ endif
if s:ext =~? '\.zh'
if &enc =~ 'big5\|cp950'
let s:ext = ".zh.big5"
- else
+ elseif &enc != 'utf-8'
let s:ext = ".zh.euc"
endif
endif
@@ -81,16 +86,12 @@ endif
if s:ext =~? '\.pl'
if &enc =~ 1250
let s:ext = ".pl.cp1250"
- elseif &enc =~ "utf-8$"
- let s:ext = ".pl.utf-8"
endif
endif
" The Turkish tutor is available in two encodings, guess which one to use
if s:ext =~? '\.tr'
- if &enc == "utf-8"
- let s:ext = ".tr.utf-8"
- elseif &enc == "iso-8859-9"
+ if &enc == "iso-8859-9"
let s:ext = ".tr.iso9"
endif
endif
@@ -99,59 +100,67 @@ endif
" We used ".gr" (Greece) instead of ".el" (Greek); accept both.
if s:ext =~? '\.gr\|\.el'
if &enc == "iso-8859-7"
- let s:ext = ".gr"
+ let s:ext = ".el"
elseif &enc == "utf-8"
- let s:ext = ".gr.utf-8"
+ let s:ext = ".el.utf-8"
elseif &enc =~ 737
- let s:ext = ".gr.cp737"
+ let s:ext = ".el.cp737"
endif
endif
" The Slovak tutor is available in three encodings, guess which one to use
if s:ext =~? '\.sk'
- if &enc == 'utf-8'
- let s:ext = ".sk.utf-8"
- elseif &enc =~ 1250
+ if &enc =~ 1250
let s:ext = ".sk.cp1250"
endif
endif
" The Czech tutor is available in three encodings, guess which one to use
if s:ext =~? '\.cs'
- if &enc == 'utf-8'
- let s:ext = ".cs.utf-8"
- elseif &enc =~ 1250
+ if &enc =~ 1250
let s:ext = ".cs.cp1250"
endif
endif
" The Russian tutor is available in three encodings, guess which one to use.
if s:ext =~? '\.ru'
- if &enc == 'utf-8'
- let s:ext = '.ru.utf-8'
- elseif &enc =~ '1251'
+ if &enc =~ '1251'
let s:ext = '.ru.cp1251'
elseif &enc =~ 'koi8'
let s:ext = '.ru'
endif
endif
-" The Hungarian tutor is available in two encodings, guess which one to use.
+" The Hungarian tutor is available in three encodings, guess which one to use.
if s:ext =~? '\.hu'
- if &enc == 'utf-8'
- let s:ext = '.hu.utf-8'
+ if &enc =~ 1250
+ let s:ext = ".hu.cp1250"
elseif &enc =~ 'iso-8859-2'
let s:ext = '.hu'
endif
endif
-" Somehow ".ge" (Germany) is sometimes used for ".de" (Deutsch).
-if s:ext =~? '\.ge'
- let s:ext = ".de"
+" The Croatian tutor is available in three encodings, guess which one to use.
+if s:ext =~? '\.hr'
+ if &enc =~ 1250
+ let s:ext = ".hr.cp1250"
+ elseif &enc =~ 'iso-8859-2'
+ let s:ext = '.hr'
+ endif
endif
-if s:ext =~? '\.en'
- let s:ext = ""
+" Esperanto is only available in utf-8
+if s:ext =~? '\.eo'
+ let s:ext = ".eo.utf-8"
+endif
+" Vietnamese is only available in utf-8
+if s:ext =~? '\.vi'
+ let s:ext = ".vi.utf-8"
+endif
+
+" If 'encoding' is utf-8 s:ext must end in utf-8.
+if &enc == 'utf-8' && s:ext !~ '\.utf-8'
+ s:ext .= '.utf-8'
endif
" 2. Build the name of the file: