aboutsummaryrefslogtreecommitdiff
path: root/runtime/plugin
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-07-11 04:05:51 +0000
committerJustin M. Keyes <justinkz@gmail.com>2014-07-29 02:12:31 +0000
commita98a6996c291b3e300d27b791eded9eed333d677 (patch)
tree51d92f6cac128f938cd0aaa9a8dd0ce7a83d63a9 /runtime/plugin
parent66bc13163398786c88e20b7cdd61c66978b4d3fb (diff)
downloadrneovim-a98a6996c291b3e300d27b791eded9eed333d677.tar.gz
rneovim-a98a6996c291b3e300d27b791eded9eed333d677.tar.bz2
rneovim-a98a6996c291b3e300d27b791eded9eed333d677.zip
re-integrate runtime/ vim-patch:0 #938
Vim runtime files based on 7.4.384 / hg changeset 7090d7f160f7 Excluding: Amiga icons (*.info, icons/) doc/hangulin.txt tutor/ spell/ lang/ (only used for menu translations) macros/maze/, macros/hanoi/, macros/life/, macros/urm/ These were used to test vi compatibility. termcap "Demonstration of a termcap file (for the Amiga and Archimedes)" Helped-by: Rich Wareham <rjw57@cam.ac.uk> Helped-by: John <john.schmidt.h@gmail.com> Helped-by: Yann <yann@yann-salaun.com> Helped-by: Christophe Badoit <c.badoit@lesiteimmo.com> Helped-by: drasill <github@tof2k.com> Helped-by: Tae Sandoval Murgan <taecilla@gmail.com> Helped-by: Lowe Thiderman <lowe.thiderman@gmail.com>
Diffstat (limited to 'runtime/plugin')
-rw-r--r--runtime/plugin/README.txt19
-rw-r--r--runtime/plugin/getscriptPlugin.vim41
-rw-r--r--runtime/plugin/gzip.vim44
-rw-r--r--runtime/plugin/matchparen.vim182
-rw-r--r--runtime/plugin/netrwPlugin.vim207
-rw-r--r--runtime/plugin/rrhelper.vim48
-rw-r--r--runtime/plugin/spellfile.vim15
-rw-r--r--runtime/plugin/tarPlugin.vim53
-rw-r--r--runtime/plugin/tohtml.vim179
-rw-r--r--runtime/plugin/vimballPlugin.vim40
-rw-r--r--runtime/plugin/zipPlugin.vim56
11 files changed, 884 insertions, 0 deletions
diff --git a/runtime/plugin/README.txt b/runtime/plugin/README.txt
new file mode 100644
index 0000000000..37e22e57c0
--- /dev/null
+++ b/runtime/plugin/README.txt
@@ -0,0 +1,19 @@
+The plugin directory is for standard Vim plugin scripts.
+
+All files here ending in .vim will be sourced by Vim when it starts up.
+Look in the file for hints on how it can be disabled without deleting it.
+
+getscriptPlugin.vim get latest version of Vim scripts
+gzip.vim edit compressed files
+matchparen.vim highlight paren matching the one under the cursor
+netrwPlugin.vim edit files over a network and browse (remote) directories
+rrhelper.vim used for --remote-wait editing
+spellfile.vim download a spellfile when it's missing
+tarPlugin.vim edit (compressed) tar files
+tohtml.vim convert a file with syntax highlighting to HTML
+vimballPlugin.vim create and unpack .vba files
+zipPlugin.vim edit zip archives
+
+Note: the explorer.vim plugin is no longer here, the netrw.vim plugin has
+taken over browsing directories (also for remote directories).
+
diff --git a/runtime/plugin/getscriptPlugin.vim b/runtime/plugin/getscriptPlugin.vim
new file mode 100644
index 0000000000..fb0fbeab7b
--- /dev/null
+++ b/runtime/plugin/getscriptPlugin.vim
@@ -0,0 +1,41 @@
+" ---------------------------------------------------------------------
+" getscriptPlugin.vim
+" Author: Charles E. Campbell
+" Date: Nov 29, 2013
+" Installing: :help glvs-install
+" Usage: :help glvs
+"
+" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
+"
+" (Rom 15:11 WEB) Again, "Praise the Lord, all you Gentiles! Let
+" all the peoples praise Him."
+" ---------------------------------------------------------------------
+" Initialization: {{{1
+" if you're sourcing this file, surely you can't be
+" expecting vim to be in its vi-compatible mode
+if exists("g:loaded_getscriptPlugin")
+ finish
+endif
+if &cp
+ if &verbose
+ echo "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
+ endif
+ finish
+endif
+let g:loaded_getscriptPlugin = "v36"
+let s:keepcpo = &cpo
+set cpo&vim
+
+" ---------------------------------------------------------------------
+" Public Interface: {{{1
+com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
+com! -nargs=0 GetScripts call getscript#GetLatestVimScripts()
+silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
+
+" ---------------------------------------------------------------------
+" Restore Options: {{{1
+let &cpo= s:keepcpo
+unlet s:keepcpo
+
+" ---------------------------------------------------------------------
+" vim: ts=8 sts=2 fdm=marker nowrap
diff --git a/runtime/plugin/gzip.vim b/runtime/plugin/gzip.vim
new file mode 100644
index 0000000000..edef149537
--- /dev/null
+++ b/runtime/plugin/gzip.vim
@@ -0,0 +1,44 @@
+" Vim plugin for editing compressed files.
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2010 Mar 10
+
+" Exit quickly when:
+" - this plugin was already loaded
+" - when 'compatible' is set
+" - some autocommands are already taking care of compressed files
+if exists("loaded_gzip") || &cp || exists("#BufReadPre#*.gz")
+ finish
+endif
+let loaded_gzip = 1
+
+augroup gzip
+ " Remove all gzip autocommands
+ au!
+
+ " Enable editing of gzipped files.
+ " The functions are defined in autoload/gzip.vim.
+ "
+ " Set binary mode before reading the file.
+ " Use "gzip -d", gunzip isn't always available.
+ autocmd BufReadPre,FileReadPre *.gz,*.bz2,*.Z,*.lzma,*.xz setlocal bin
+ autocmd BufReadPost,FileReadPost *.gz call gzip#read("gzip -dn")
+ autocmd BufReadPost,FileReadPost *.bz2 call gzip#read("bzip2 -d")
+ autocmd BufReadPost,FileReadPost *.Z call gzip#read("uncompress")
+ autocmd BufReadPost,FileReadPost *.lzma call gzip#read("lzma -d")
+ autocmd BufReadPost,FileReadPost *.xz call gzip#read("xz -d")
+ autocmd BufWritePost,FileWritePost *.gz call gzip#write("gzip")
+ autocmd BufWritePost,FileWritePost *.bz2 call gzip#write("bzip2")
+ autocmd BufWritePost,FileWritePost *.Z call gzip#write("compress -f")
+ autocmd BufWritePost,FileWritePost *.lzma call gzip#write("lzma -z")
+ autocmd BufWritePost,FileWritePost *.xz call gzip#write("xz -z")
+ autocmd FileAppendPre *.gz call gzip#appre("gzip -dn")
+ autocmd FileAppendPre *.bz2 call gzip#appre("bzip2 -d")
+ autocmd FileAppendPre *.Z call gzip#appre("uncompress")
+ autocmd FileAppendPre *.lzma call gzip#appre("lzma -d")
+ autocmd FileAppendPre *.xz call gzip#appre("xz -d")
+ autocmd FileAppendPost *.gz call gzip#write("gzip")
+ autocmd FileAppendPost *.bz2 call gzip#write("bzip2")
+ autocmd FileAppendPost *.Z call gzip#write("compress -f")
+ autocmd FileAppendPost *.lzma call gzip#write("lzma -z")
+ autocmd FileAppendPost *.xz call gzip#write("xz -z")
+augroup END
diff --git a/runtime/plugin/matchparen.vim b/runtime/plugin/matchparen.vim
new file mode 100644
index 0000000000..817ce62b28
--- /dev/null
+++ b/runtime/plugin/matchparen.vim
@@ -0,0 +1,182 @@
+" Vim plugin for showing matching parens
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2014 Jul 19
+
+" Exit quickly when:
+" - this plugin was already loaded (or disabled)
+" - when 'compatible' is set
+" - the "CursorMoved" autocmd event is not available.
+if exists("g:loaded_matchparen") || &cp || !exists("##CursorMoved")
+ finish
+endif
+let g:loaded_matchparen = 1
+
+if !exists("g:matchparen_timeout")
+ let g:matchparen_timeout = 300
+endif
+if !exists("g:matchparen_insert_timeout")
+ let g:matchparen_insert_timeout = 60
+endif
+
+augroup matchparen
+ " Replace all matchparen autocommands
+ autocmd! CursorMoved,CursorMovedI,WinEnter * call s:Highlight_Matching_Pair()
+ if exists('##TextChanged')
+ autocmd! TextChanged,TextChangedI * call s:Highlight_Matching_Pair()
+ endif
+augroup END
+
+" Skip the rest if it was already done.
+if exists("*s:Highlight_Matching_Pair")
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+" The function that is invoked (very often) to define a ":match" highlighting
+" for any matching paren.
+function! s:Highlight_Matching_Pair()
+ " Remove any previous match.
+ if exists('w:paren_hl_on') && w:paren_hl_on
+ silent! call matchdelete(3)
+ let w:paren_hl_on = 0
+ endif
+
+ " Avoid that we remove the popup menu.
+ " Return when there are no colors (looks like the cursor jumps).
+ if pumvisible() || (&t_Co < 8 && !has("gui_running"))
+ return
+ endif
+
+ " Get the character under the cursor and check if it's in 'matchpairs'.
+ let c_lnum = line('.')
+ let c_col = col('.')
+ let before = 0
+
+ let text = getline(c_lnum)
+ let c = text[c_col - 1]
+ let plist = split(&matchpairs, '.\zs[:,]')
+ let i = index(plist, c)
+ if i < 0
+ " not found, in Insert mode try character before the cursor
+ if c_col > 1 && (mode() == 'i' || mode() == 'R')
+ let before = 1
+ let c = text[c_col - 2]
+ let i = index(plist, c)
+ endif
+ if i < 0
+ " not found, nothing to do
+ return
+ endif
+ endif
+
+ " Figure out the arguments for searchpairpos().
+ if i % 2 == 0
+ let s_flags = 'nW'
+ let c2 = plist[i + 1]
+ else
+ let s_flags = 'nbW'
+ let c2 = c
+ let c = plist[i - 1]
+ endif
+ if c == '['
+ let c = '\['
+ let c2 = '\]'
+ endif
+
+ " Find the match. When it was just before the cursor move it there for a
+ " moment.
+ if before > 0
+ let has_getcurpos = exists("*getcurpos")
+ if has_getcurpos
+ " getcurpos() is more efficient but doesn't exist before 7.4.313.
+ let save_cursor = getcurpos()
+ else
+ let save_cursor = winsaveview()
+ endif
+ call cursor(c_lnum, c_col - before)
+ endif
+
+ " When not in a string or comment ignore matches inside them.
+ " We match "escape" for special items, such as lispEscapeSpecial.
+ let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
+ \ '=~? "string\\|character\\|singlequote\\|escape\\|comment"'
+ execute 'if' s_skip '| let s_skip = 0 | endif'
+
+ " Limit the search to lines visible in the window.
+ let stoplinebottom = line('w$')
+ let stoplinetop = line('w0')
+ if i % 2 == 0
+ let stopline = stoplinebottom
+ else
+ let stopline = stoplinetop
+ endif
+
+ " Limit the search time to 300 msec to avoid a hang on very long lines.
+ " This fails when a timeout is not supported.
+ if mode() == 'i' || mode() == 'R'
+ let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
+ else
+ let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
+ endif
+ try
+ let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, timeout)
+ catch /E118/
+ " Can't use the timeout, restrict the stopline a bit more to avoid taking
+ " a long time on closed folds and long lines.
+ " The "viewable" variables give a range in which we can scroll while
+ " keeping the cursor at the same position.
+ " adjustedScrolloff accounts for very large numbers of scrolloff.
+ let adjustedScrolloff = min([&scrolloff, (line('w$') - line('w0')) / 2])
+ let bottom_viewable = min([line('$'), c_lnum + &lines - adjustedScrolloff - 2])
+ let top_viewable = max([1, c_lnum-&lines+adjustedScrolloff + 2])
+ " one of these stoplines will be adjusted below, but the current values are
+ " minimal boundaries within the current window
+ if i % 2 == 0
+ if has("byte_offset") && has("syntax_items") && &smc > 0
+ let stopbyte = min([line2byte("$"), line2byte(".") + col(".") + &smc * 2])
+ let stopline = min([bottom_viewable, byte2line(stopbyte)])
+ else
+ let stopline = min([bottom_viewable, c_lnum + 100])
+ endif
+ let stoplinebottom = stopline
+ else
+ if has("byte_offset") && has("syntax_items") && &smc > 0
+ let stopbyte = max([1, line2byte(".") + col(".") - &smc * 2])
+ let stopline = max([top_viewable, byte2line(stopbyte)])
+ else
+ let stopline = max([top_viewable, c_lnum - 100])
+ endif
+ let stoplinetop = stopline
+ endif
+ let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline)
+ endtry
+
+ if before > 0
+ if has_getcurpos
+ call setpos('.', save_cursor)
+ else
+ call winrestview(save_cursor)
+ endif
+ endif
+
+ " If a match is found setup match highlighting.
+ if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom
+ if exists('*matchaddpos')
+ call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3)
+ else
+ exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) .
+ \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
+ endif
+ let w:paren_hl_on = 1
+ endif
+endfunction
+
+" Define commands that will disable and enable the plugin.
+command! NoMatchParen windo silent! call matchdelete(3) | unlet! g:loaded_matchparen |
+ \ au! matchparen
+command! DoMatchParen runtime plugin/matchparen.vim | windo doau CursorMoved
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim
new file mode 100644
index 0000000000..e3e79ddea8
--- /dev/null
+++ b/runtime/plugin/netrwPlugin.vim
@@ -0,0 +1,207 @@
+" netrwPlugin.vim: Handles file transfer and remote directory listing across a network
+" PLUGIN SECTION
+" Date: Jan 22, 2014
+" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
+" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
+" Copyright: Copyright (C) 1999-2013 Charles E. Campbell {{{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
+" 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.
+"
+" But be doers of the Word, and not only hearers, deluding your own selves {{{1
+" (James 1:22 RSV)
+" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+" Load Once: {{{1
+if &cp || exists("g:loaded_netrwPlugin")
+ finish
+endif
+let g:loaded_netrwPlugin = "v152"
+if v:version < 702
+ echohl WarningMsg
+ echo "***warning*** you need vim version 7.2 for this version of netrw"
+ echohl None
+ finish
+endif
+if v:version < 703 || (v:version == 703 && !has("patch465"))
+ echohl WarningMsg
+ echo "***warning*** this version of netrw needs vim 7.3.465 or later"
+ echohl Normal
+ finish
+endif
+let s:keepcpo = &cpo
+set cpo&vim
+"DechoRemOn
+
+" ---------------------------------------------------------------------
+" Public Interface: {{{1
+
+" Local Browsing Autocmds: {{{2
+augroup FileExplorer
+ au!
+ au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif
+ au BufEnter * sil call s:LocalBrowse(expand("<amatch>"))
+ au VimEnter * sil call s:VimEnter(expand("<amatch>"))
+ if has("win32") || has("win95") || has("win64") || has("win16")
+ au BufEnter .* sil call s:LocalBrowse(expand("<amatch>"))
+ endif
+augroup END
+
+" Network Browsing Reading Writing: {{{2
+augroup Network
+ au!
+ au BufReadCmd file://* call netrw#FileUrlRead(expand("<amatch>"))
+ au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>"))
+ au FileReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>"))
+ au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>"))
+ au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau FileWritePost ".fnameescape(expand("<amatch>"))
+ try
+ au SourceCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
+ catch /^Vim\%((\a\+)\)\=:E216/
+ au SourcePre ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe 'Nsource '.fnameescape(expand("<amatch>"))
+ endtry
+augroup END
+
+" Commands: :Nread, :Nwrite, :NetUserPass {{{2
+com! -count=1 -nargs=* Nread call netrw#SavePosn()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call netrw#RestorePosn()
+com! -range=% -nargs=* Nwrite call netrw#SavePosn()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call netrw#RestorePosn()
+com! -nargs=* NetUserPass call NetUserPass(<f-args>)
+com! -nargs=* Nsource call netrw#SavePosn()<bar>call netrw#NetSource(<f-args>)<bar>call netrw#RestorePosn()
+com! -nargs=? Ntree call netrw#SetTreetop(<q-args>)
+
+" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2
+com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(<count>,0,0+<bang>0,<q-args>)
+com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(<count>,1,0+<bang>0,<q-args>)
+com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(<count>,1,2+<bang>0,<q-args>)
+com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(<count>,1,4+<bang>0,<q-args>)
+com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(<count>,0,6 ,<q-args>)
+com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,<q-args>)
+com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,<q-args>)
+com! -nargs=* -bar -complete=dir Lexplore call netrw#Lexplore(<q-args>)
+
+" Commands: NetrwSettings {{{2
+com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings()
+com! -bang NetrwClean call netrw#Clean(<bang>0)
+
+" Maps:
+if !exists("g:netrw_nogx") && maparg('gx','n') == ""
+ if !hasmapto('<Plug>NetrwBrowseX')
+ nmap <unique> gx <Plug>NetrwBrowseX
+ endif
+ nno <silent> <Plug>NetrwBrowseX :call netrw#NetrwBrowseX(expand("<cfile>"),0)<cr>
+endif
+
+" ---------------------------------------------------------------------
+" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2
+fun! s:LocalBrowse(dirname)
+ " Unfortunate interaction -- only DechoMsg debugging calls can be safely used here.
+ " Otherwise, the BufEnter event gets triggered when attempts to write to
+ " the DBG buffer are made.
+
+ if !exists("s:vimentered")
+ " If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will,
+ " and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined.
+" call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)")
+" call Dret("s:LocalBrowse")
+ return
+ endif
+
+" call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")")
+
+ if has("amiga")
+ " The check against '' is made for the Amiga, where the empty
+ " string is the current directory and not checking would break
+ " things such as the help command.
+" call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)")
+ if a:dirname != '' && isdirectory(a:dirname)
+ sil! call netrw#LocalBrowseCheck(a:dirname)
+ if exists("w:netrw_bannercnt")
+ exe w:netrw_bannercnt
+ endif
+ endif
+
+ elseif isdirectory(a:dirname)
+" call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)")
+" call Dredir("LocalBrowse ft last set: ","verbose set ft")
+ sil! call netrw#LocalBrowseCheck(a:dirname)
+ if exists("w:netrw_bannercnt")
+ exe w:netrw_bannercnt
+ endif
+
+ else
+ " not a directory, ignore it
+" call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...")
+ endif
+
+" call Dret("s:LocalBrowse")
+endfun
+
+" ---------------------------------------------------------------------
+" s:VimEnter: after all vim startup stuff is done, this function is called. {{{2
+" Its purpose: to look over all windows and run s:LocalBrowse() on
+" them, which checks if they're directories and will create a directory
+" listing when appropriate.
+" It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter()
+" has already been called.
+fun! s:VimEnter(dirname)
+" call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">")
+ let curwin = winnr()
+ let s:vimentered = 1
+ windo call s:LocalBrowse(expand("%:p"))
+ exe curwin."wincmd w"
+" call Dret("s:VimEnter")
+endfun
+
+" ---------------------------------------------------------------------
+" NetrwStatusLine: {{{1
+fun! NetrwStatusLine()
+" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".")
+ 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")
+ let &stl= s:netrw_explore_stl
+ 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
+
+" ------------------------------------------------------------------------
+" NetUserPass: set username and password for subsequent ftp transfer {{{1
+" Usage: :call NetUserPass() -- will prompt for userid and password
+" :call NetUserPass("uid") -- will prompt for password
+" :call NetUserPass("uid","password") -- sets global userid and password
+fun! NetUserPass(...)
+
+ " get/set userid
+ if a:0 == 0
+" call Dfunc("NetUserPass(a:0<".a:0.">)")
+ if !exists("g:netrw_uid") || g:netrw_uid == ""
+ " via prompt
+ let g:netrw_uid= input('Enter username: ')
+ endif
+ else " from command line
+" call Dfunc("NetUserPass(a:1<".a:1.">) {")
+ let g:netrw_uid= a:1
+ endif
+
+ " get password
+ if a:0 <= 1 " via prompt
+" call Decho("a:0=".a:0." case <=1:")
+ let g: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
+ endif
+" call Dret("NetUserPass")
+endfun
+
+" ------------------------------------------------------------------------
+" Modelines And Restoration: {{{1
+let &cpo= s:keepcpo
+unlet s:keepcpo
+" vim:ts=8 fdm=marker
diff --git a/runtime/plugin/rrhelper.vim b/runtime/plugin/rrhelper.vim
new file mode 100644
index 0000000000..b09cbc10b9
--- /dev/null
+++ b/runtime/plugin/rrhelper.vim
@@ -0,0 +1,48 @@
+" Vim plugin with helper function(s) for --remote-wait
+" Maintainer: Flemming Madsen <fma@cci.dk>
+" Last Change: 2008 May 29
+
+" Has this already been loaded?
+if exists("loaded_rrhelper") || !has("clientserver")
+ finish
+endif
+let loaded_rrhelper = 1
+
+" Setup answers for a --remote-wait client who will assume
+" a SetupRemoteReplies() function in the command server
+
+function SetupRemoteReplies()
+ let cnt = 0
+ let max = argc()
+
+ let id = expand("<client>")
+ if id == 0
+ return
+ endif
+ while cnt < max
+ " Handle same file from more clients and file being more than once
+ " on the command line by encoding this stuff in the group name
+ let uniqueGroup = "RemoteReply_".id."_".cnt
+
+ " Path separators are always forward slashes for the autocommand pattern.
+ " Escape special characters with a backslash.
+ let f = substitute(argv(cnt), '\\', '/', "g")
+ if exists('*fnameescape')
+ let f = fnameescape(f)
+ else
+ let f = escape(f, " \t\n*?[{`$\\%#'\"|!<")
+ endif
+ execute "augroup ".uniqueGroup
+ execute "autocmd ".uniqueGroup." BufUnload ". f ." call DoRemoteReply('".id."', '".cnt."', '".uniqueGroup."', '". f ."')"
+ let cnt = cnt + 1
+ endwhile
+ augroup END
+endfunc
+
+function DoRemoteReply(id, cnt, group, file)
+ call server2client(a:id, a:cnt)
+ execute 'autocmd! '.a:group.' BufUnload '.a:file
+ execute 'augroup! '.a:group
+endfunc
+
+" vim: set sw=2 sts=2 :
diff --git a/runtime/plugin/spellfile.vim b/runtime/plugin/spellfile.vim
new file mode 100644
index 0000000000..437296090c
--- /dev/null
+++ b/runtime/plugin/spellfile.vim
@@ -0,0 +1,15 @@
+" Vim plugin for downloading spell files
+" Maintainer: Bram Moolenaar <Bram@vim.org>
+" Last Change: 2006 Feb 01
+
+" Exit quickly when:
+" - this plugin was already loaded
+" - when 'compatible' is set
+" - some autocommands are already taking care of spell files
+if exists("loaded_spellfile_plugin") || &cp || exists("#SpellFileMissing")
+ finish
+endif
+let loaded_spellfile_plugin = 1
+
+" The function is in the autoload directory.
+autocmd SpellFileMissing * call spellfile#LoadFile(expand('<amatch>'))
diff --git a/runtime/plugin/tarPlugin.vim b/runtime/plugin/tarPlugin.vim
new file mode 100644
index 0000000000..034cbe225a
--- /dev/null
+++ b/runtime/plugin/tarPlugin.vim
@@ -0,0 +1,53 @@
+" tarPlugin.vim -- a Vim plugin for browsing tarfiles
+" Original was copyright (c) 2002, Michael C. Toren <mct@toren.net>
+" Modified by Charles E. Campbell
+" Distributed under the GNU General Public License.
+"
+" Updates are available from <http://michael.toren.net/code/>. If you
+" find this script useful, or have suggestions for improvements, please
+" let me know.
+" Also look there for further comments and documentation.
+"
+" This part only sets the autocommands. The functions are in autoload/tar.vim.
+" ---------------------------------------------------------------------
+" Load Once: {{{1
+if &cp || exists("g:loaded_tarPlugin")
+ finish
+endif
+let g:loaded_tarPlugin = "v29"
+let s:keepcpo = &cpo
+set cpo&vim
+
+" ---------------------------------------------------------------------
+" Public Interface: {{{1
+augroup tar
+ au!
+ au BufReadCmd tarfile::* call tar#Read(expand("<amatch>"), 1)
+ au FileReadCmd tarfile::* call tar#Read(expand("<amatch>"), 0)
+ au BufWriteCmd tarfile::* call tar#Write(expand("<amatch>"))
+ au FileWriteCmd tarfile::* call tar#Write(expand("<amatch>"))
+
+ if has("unix")
+ au BufReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 1)
+ au FileReadCmd tarfile::*/* call tar#Read(expand("<amatch>"), 0)
+ au BufWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
+ au FileWriteCmd tarfile::*/* call tar#Write(expand("<amatch>"))
+ endif
+
+ au BufReadCmd *.tar.gz call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.lrp call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar.bz2 call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar.Z call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tgz call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar.lzma call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.tar.xz call tar#Browse(expand("<amatch>"))
+ au BufReadCmd *.txz call tar#Browse(expand("<amatch>"))
+augroup END
+com! -nargs=? -complete=file Vimuntar call tar#Vimuntar(<q-args>)
+
+" ---------------------------------------------------------------------
+" Restoration And Modelines: {{{1
+" vim: fdm=marker
+let &cpo= s:keepcpo
+unlet s:keepcpo
diff --git a/runtime/plugin/tohtml.vim b/runtime/plugin/tohtml.vim
new file mode 100644
index 0000000000..eb47b1a7c3
--- /dev/null
+++ b/runtime/plugin/tohtml.vim
@@ -0,0 +1,179 @@
+" Vim plugin for converting a syntax highlighted file to HTML.
+" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
+" Last Change: 2013 Jul 08
+"
+" The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and
+" $VIMRUNTIME/syntax/2html.vim
+"
+" TODO: {{{
+" * Options for generating the CSS in external style sheets. New :TOcss
+" command to convert the current color scheme into a (mostly) generic CSS
+" stylesheet which can be re-used. Alternate stylesheet support? Good start
+" by Erik Falor
+" ( https://groups.google.com/d/topic/vim_use/7XTmC4D22dU/discussion ).
+" * Add optional argument to :TOhtml command to specify mode (gui, cterm,
+" term) to use for the styling. Suggestion by "nacitar".
+" * Add way to override or specify which RGB colors map to the color numbers
+" in cterm. Get better defaults than just guessing? Suggestion by "nacitar".
+" * Disable filetype detection until after all processing is done.
+" * Add option for not generating the hyperlink on stuff that looks like a
+" URL? Or just color the link to fit with the colorscheme (and only special
+" when hovering)?
+" * Bug: Opera does not allow printing more than one page if uncopyable
+" regions is turned on. Possible solution: Add normal text line numbers with
+" display:none, set to display:inline for print style sheets, and hide
+" <input> elements for print, to allow Opera printing multiple pages (and
+" other uncopyable areas?). May need to make the new text invisible to IE
+" with conditional comments to prevent copying it, IE for some reason likes
+" to copy hidden text. Other browsers too?
+" * Bug: still a 1px gap throughout the fold column when html_prevent_copy is
+" "fn" in some browsers. Specifically, in Chromium on Ubuntu (but not Chrome
+" on Windows). Perhaps it is font related?
+" * Bug: still some gaps in the fold column when html_prevent_copy contains
+" 'd' and showing the whole diff (observed in multiple browsers). Only gaps
+" on diff lines though.
+" * Undercurl support via CSS3, with fallback to dotted or something:
+" https://groups.google.com/d/topic/vim_use/BzXA6He1pHg/discussion
+" * Redo updates for modified default foldtext (v11) when/if the patch is
+" accepted to modify it.
+" * Test case +diff_one_file-dynamic_folds+expand_tabs-hover_unfold
+" +ignore_conceal-ignore_folding+no_foldcolumn+no_pre+no_progress
+" +number_lines-pre_wrap-use_css+use_xhtml+whole_filler.xhtml
+" does not show the whole diff filler as it is supposed to?
+" * Bug: when 'isprint' is wrong for the current encoding, will generate
+" invalid content. Can/should anything be done about this? Maybe a separate
+" plugin to correct 'isprint' based on encoding?
+" * Check to see if the windows-125\d encodings actually work in Unix without
+" the 8bit- prefix. Add prefix to autoload dictionaries for Unix if not.
+" * Font auto-detection similar to
+" http://www.vim.org/scripts/script.php?script_id=2384 but for a variety of
+" platforms.
+" * Error thrown when sourcing 2html.vim directly when plugins are not loaded.
+" * Pull in code from http://www.vim.org/scripts/script.php?script_id=3113 :
+" - listchars support
+" - full-line background highlight
+" - other?
+" * Make it so deleted lines in a diff don't create side-scrolling (get it
+" free with full-line background highlight above).
+" * Restore open/closed folds and cursor position after processing each file
+" with option not to restore for speed increase.
+" * Add extra meta info (generation time, etc.)?
+" * Tidy up so we can use strict doctype in even more situations
+" * Implementation detail: add threshold for writing the lines to the html
+" buffer before we're done (5000 or so lines should do it)
+" * TODO comments for code cleanup scattered throughout
+"}}}
+
+if exists('g:loaded_2html_plugin')
+ finish
+endif
+let g:loaded_2html_plugin = 'vim7.4_v1'
+
+"
+" Changelog: {{{
+" 7.4_v1 (this version): Fix modeline mangling for new "Vim:" format, and
+" also for version-specific modelines like "vim>703:".
+"
+" 7.3 updates: {{{
+" 7.3_v14 (ad6996a23e3e): Allow suppressing line number anchors using
+" g:html_line_ids=0. Allow customizing
+" important IDs (like line IDs and fold IDs) using
+" g:html_id_expr evalutated when the buffer conversion
+" is started.
+" 7.3_v13 (2eb30f341e8d): Keep foldmethod at manual in the generated file and
+" insert modeline to set it to manual.
+" Fix bug: diff mode with 2 unsaved buffers creates a
+" duplicate of one buffer instead of including both.
+" Add anchors to each line so you can put '#L123'
+" or '#123' at the end of the URL to jump to line 123
+" (idea by Andy Spencer). Add javascript to open folds
+" to show the anchor being jumped to if it is hidden.
+" Fix XML validation error: &nsbp; not part of XML.
+" Allow TOhtml to chain together with other commands
+" using |.
+" 7.3_v12 (9910cbff5f16): Fix modeline mangling to also work for when multiple
+" highlight groups make up the start-of-modeline text.
+" Improve render time of page with uncopyable regions
+" by not using one-input-per-char. Change name of
+" uncopyable option from html_unselectable to
+" html_prevent_copy. Added html_no_invalid option and
+" default to inserting invalid markup for uncopyable
+" regions to prevent MS Word from pasting undeletable
+" <input> elements. Fix 'cpo' handling (Thilo Six).
+" 7.3_v12b1: Add html_unselectable option. Rework logic to
+" eliminate post-processing substitute commands in
+" favor of doing the work up front. Remove unnecessary
+" special treatment of 'LineNr' highlight group. Minor
+" speed improvements. Fix modeline mangling in
+" generated output so it works for text in the first
+" column. Fix missing line number and fold column in
+" diff filler lines. Fix that some fonts have a 1px
+" gap (using a dirty hack, improvements welcome). Add
+" "colorscheme" meta tag. Does NOT include support for
+" the new default foldtext added in v11, as the patch
+" adding it has not yet been included in Vim.
+" 7.3_v11 ( unreleased ): Support new default foldtext from patch by Christian
+" Brabandt in
+" http://groups.google.com/d/topic/vim_dev/B6FSGfq9VoI/discussion.
+" This patch has not yet been included in Vim, thus
+" these changes are removed in the next version.
+" 7.3_v10 (fd09a9c8468e): Fix error E684 when converting a range wholly inside
+" multiple nested folds with dynamic folding on.
+" Also fix problem with foldtext in this situation.
+" 7.3_v9 (0877b8d6370e): Add html_pre_wrap option active with html_use_css
+" and without html_no_pre, default value same as
+" 'wrap' option, (Andy Spencer). Don't use
+" 'fileencoding' for converted document encoding if
+" 'buftype' indicates a special buffer which isn't
+" written.
+" 7.3_v8 (85c5a72551e2): Add html_expand_tabs option to allow leaving tab
+" characters in generated output (Andy Spencer).
+" Escape text that looks like a modeline so Vim
+" doesn't use anything in the converted HTML as a
+" modeline. Bugfixes: Fix folding when a fold starts
+" before the conversion range. Remove fold column when
+" there are no folds.
+" 7.3_v7 (840c3cadb842): see betas released on vim_dev below:
+" 7.3_v7b3: Fixed bug, convert Unicode to UTF-8 all the way.
+" 7.3_v7b2: Remove automatic detection of encodings that are not
+" supported by all major browsers according to
+" http://wiki.whatwg.org/wiki/Web_Encodings and
+" convert to UTF-8 for all Unicode encodings. Make
+" HTML encoding to Vim encoding detection be
+" case-insensitive for built-in pairs.
+" 7.3_v7b1: Remove use of setwinvar() function which cannot be
+" called in restricted mode (Andy Spencer). Use
+" 'fencoding' instead of 'encoding' to determine by
+" charset, and make sure the 'fenc' of the generated
+" file matches its indicated charset. Add charsets for
+" all of Vim's natively supported encodings.
+" 7.3_v6 (0d3f0e3d289b): Really fix bug with 'nowrapscan', 'magic' and other
+" user settings interfering with diff mode generation,
+" trailing whitespace (e.g. line number column) when
+" using html_no_pre, and bugs when using
+" html_hover_unfold.
+" 7.3_v5 ( unreleased ): Fix bug with 'nowrapscan' and also with out-of-sync
+" folds in diff mode when first line was folded.
+" 7.3_v4 (7e008c174cc3): Bugfixes, especially for xhtml markup, and diff mode
+" 7.3_v3 (a29075150aee): Refactor option handling and make html_use_css
+" default to true when not set to anything. Use strict
+" doctypes where possible. Rename use_xhtml option to
+" html_use_xhtml for consistency. Use .xhtml extension
+" when using this option. Add meta tag for settings.
+" 7.3_v2 (80229a724a11): Fix syntax highlighting in diff mode to use both the
+" diff colors and the normal syntax colors
+" 7.3_v1 (e7751177126b): Add conceal support and meta tags in output
+" Pre-v1 baseline: Mercurial changeset 3c9324c0800e
+"}}}
+"}}}
+
+" Define the :TOhtml command when:
+" - 'compatible' is not set
+" - this plugin was not already loaded
+" - user commands are available. {{{
+if !&cp && !exists(":TOhtml") && has("user_commands")
+ command -range=% -bar TOhtml :call tohtml#Convert2HTML(<line1>, <line2>)
+endif "}}}
+
+" Make sure any patches will probably use consistent indent
+" vim: ts=8 sw=2 sts=2 noet fdm=marker
diff --git a/runtime/plugin/vimballPlugin.vim b/runtime/plugin/vimballPlugin.vim
new file mode 100644
index 0000000000..59279774ca
--- /dev/null
+++ b/runtime/plugin/vimballPlugin.vim
@@ -0,0 +1,40 @@
+" vimballPlugin : construct a file containing both paths and files
+" Author: Charles E. Campbell, Jr.
+" Copyright: (c) 2004-2010 by Charles E. Campbell, Jr.
+" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
+" (see |copyright|) except use "Vimball" instead of "Vim".
+" No warranty, express or implied.
+" *** *** Use At-Your-Own-Risk! *** ***
+"
+" (Rom 2:1 WEB) Therefore you are without excuse, O man, whoever you are who
+" judge. For in that which you judge another, you condemn yourself. For
+" you who judge practice the same things.
+" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim
+
+" ---------------------------------------------------------------------
+" Load Once: {{{1
+if &cp || exists("g:loaded_vimballPlugin")
+ finish
+endif
+let g:loaded_vimballPlugin = "v35"
+let s:keepcpo = &cpo
+set cpo&vim
+
+" ------------------------------------------------------------------------------
+" Public Interface: {{{1
+com! -ra -complete=file -na=+ -bang MkVimball call vimball#MkVimball(<line1>,<line2>,<bang>0,<f-args>)
+com! -na=? -complete=dir UseVimball call vimball#Vimball(1,<f-args>)
+com! -na=0 VimballList call vimball#Vimball(0)
+com! -na=* -complete=dir RmVimball call vimball#SaveSettings()|call vimball#RmVimball(<f-args>)|call vimball#RestoreSettings()
+au BufEnter *.vba,*.vba.gz,*.vba.bz2,*.vba.zip,*.vba.xz setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")
+au SourceCmd *.vba.gz,*.vba.bz2,*.vba.zip,*.vba.xz if expand("%")!=expand("<afile>") | exe "1sp" fnameescape(expand("<afile>"))|endif|call vimball#Decompress(expand("<amatch>"))|so %|if expand("%")!=expand("<afile>")|close|endif
+au SourceCmd *.vba if expand("%")!=expand("<afile>") | exe "1sp" fnameescape(expand("<afile>"))|call vimball#Vimball(1)|close|else|call vimball#Vimball(1)|endif
+au BufEnter *.vmb,*.vmb.gz,*.vmb.bz2,*.vmb.zip,*.vmb.xz setlocal bt=nofile fmr=[[[,]]] fdm=marker|if &ff != 'unix'|setlocal ma ff=unix noma|endif|call vimball#ShowMesg(0,"Source this file to extract it! (:so %)")
+au SourceCmd *.vmb.gz,*.vmb.bz2,*.vmb.zip,*.vmb.xz if expand("%")!=expand("<afile>") | exe "1sp" fnameescape(expand("<afile>"))|endif|call vimball#Decompress(expand("<amatch>"))|so %|if expand("%")!=expand("<afile>")|close|endif
+au SourceCmd *.vmb if expand("%")!=expand("<afile>") | exe "1sp" fnameescape(expand("<afile>"))|call vimball#Vimball(1)|close|else|call vimball#Vimball(1)|endif
+
+" =====================================================================
+" Restoration And Modelines: {{{1
+" vim: fdm=marker
+let &cpo= s:keepcpo
+unlet s:keepcpo
diff --git a/runtime/plugin/zipPlugin.vim b/runtime/plugin/zipPlugin.vim
new file mode 100644
index 0000000000..e9bd0dc4bd
--- /dev/null
+++ b/runtime/plugin/zipPlugin.vim
@@ -0,0 +1,56 @@
+" zipPlugin.vim: Handles browsing zipfiles
+" PLUGIN PORTION
+" Date: Jun 07, 2013
+" Maintainer: Charles E Campbell <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
+" License: Vim License (see vim's :help license)
+" Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{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
+" holder be liable for any damages resulting from the use
+" of this software.
+"
+" (James 4:8 WEB) Draw near to God, and he will draw near to you.
+" Cleanse your hands, you sinners; and purify your hearts, you double-minded.
+" ---------------------------------------------------------------------
+" Load Once: {{{1
+if &cp || exists("g:loaded_zipPlugin")
+ finish
+endif
+let g:loaded_zipPlugin = "v27"
+let s:keepcpo = &cpo
+set cpo&vim
+
+" ---------------------------------------------------------------------
+" Options: {{{1
+if !exists("g:zipPlugin_ext")
+ let g:zipPlugin_ext= '*.zip,*.jar,*.xpi,*.ja,*.war,*.ear,*.celzip,*.oxt,*.kmz,*.wsz,*.xap,*.docx,*.docm,*.dotx,*.dotm,*.potx,*.potm,*.ppsx,*.ppsm,*.pptx,*.pptm,*.ppam,*.sldx,*.thmx,*.xlam,*.xlsx,*.xlsm,*.xlsb,*.xltx,*.xltm,*.xlam,*.crtx,*.vdw,*.glox,*.gcsx,*.gqsx'
+endif
+
+" ---------------------------------------------------------------------
+" Public Interface: {{{1
+augroup zip
+ au!
+ au BufReadCmd zipfile:* call zip#Read(expand("<amatch>"), 1)
+ au FileReadCmd zipfile:* call zip#Read(expand("<amatch>"), 0)
+ au BufWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
+ au FileWriteCmd zipfile:* call zip#Write(expand("<amatch>"))
+
+ if has("unix")
+ au BufReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 1)
+ au FileReadCmd zipfile:*/* call zip#Read(expand("<amatch>"), 0)
+ au BufWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
+ au FileWriteCmd zipfile:*/* call zip#Write(expand("<amatch>"))
+ endif
+
+ exe "au BufReadCmd ".g:zipPlugin_ext.' call zip#Browse(expand("<amatch>"))'
+augroup END
+
+" ---------------------------------------------------------------------
+" Restoration And Modelines: {{{1
+" vim: fdm=marker
+let &cpo= s:keepcpo
+unlet s:keepcpo